chore: update prettier setting

This commit is contained in:
zerosoul
2022-06-12 15:30:14 +08:00
parent 14b4678d9e
commit 516794d352
209 changed files with 2435 additions and 4588 deletions
@@ -30,10 +30,7 @@ export default function DeleteConfirmModal({ id, closeModal }) {
description="Are you sure want to delete this channel?"
buttons={
<>
<Button
onClick={closeModal.bind(null, undefined)}
className="cancel"
>
<Button onClick={closeModal.bind(null, undefined)} className="cancel">
Cancel
</Button>
<Button onClick={handleDelete} className="danger">
+4 -11
View File
@@ -4,7 +4,7 @@ import toast from "react-hot-toast";
import {
useGetChannelQuery,
useUpdateChannelMutation,
useUpdateIconMutation,
useUpdateIconMutation
} from "../../app/services/channel";
import AvatarUploader from "../../common/component/AvatarUploader";
import Input from "../../common/component/styled/Input";
@@ -46,7 +46,7 @@ export default function Overview({ id = 0 }) {
const { loginUser, channel } = useSelector((store) => {
return {
loginUser: store.contacts.byId[store.authData.uid],
channel: store.channels.byId[id],
channel: store.channels.byId[id]
};
});
const { data, refetch } = useGetChannelQuery(id);
@@ -102,12 +102,7 @@ export default function Overview({ id = 0 }) {
console.log("channel icon", channel);
return (
<StyledWrapper>
<AvatarUploader
type="channel"
url={channel?.icon}
name={name}
uploadImage={updateIcon}
/>
<AvatarUploader type="channel" url={channel?.icon} name={name} uploadImage={updateIcon} />
<div className="inputs">
<div className="input">
<Label htmlFor="name">Channel Name</Label>
@@ -136,9 +131,7 @@ export default function Overview({ id = 0 }) {
/>
</div>
</div>
{changed && (
<SaveTip saveHandler={handleUpdate} resetHandler={handleReset} />
)}
{changed && <SaveTip saveHandler={handleUpdate} resetHandler={handleReset} />}
{/* <button onClick={handleUpdate} className="btn">update</button> */}
</StyledWrapper>
);
+6 -10
View File
@@ -12,7 +12,7 @@ export default function ChannelSetting() {
return {
loginUid: store.authData.uid,
isAdmin: store.contacts.byId[store.authData.uid]?.is_admin,
channel: store.channels.byId[cid],
channel: store.channels.byId[cid]
};
});
const navigate = useNavigate();
@@ -52,22 +52,18 @@ export default function ChannelSetting() {
dangers={[
canLeave && {
title: "Leave Channel",
handler: toggleLeaveConfrim,
handler: toggleLeaveConfrim
},
canDelete && {
title: "Delete Channel",
handler: toggleDeleteConfrim,
},
handler: toggleDeleteConfrim
}
]}
>
{currNav.component}
</StyledSettingContainer>
{deleteConfirm && (
<DeleteConfirmModal closeModal={toggleDeleteConfrim} id={cid} />
)}
{leaveConfirm && (
<LeaveChannel closeModal={toggleLeaveConfrim} id={cid} />
)}
{deleteConfirm && <DeleteConfirmModal closeModal={toggleDeleteConfrim} id={cid} />}
{leaveConfirm && <LeaveChannel closeModal={toggleLeaveConfrim} id={cid} />}
</>
);
}
+5 -5
View File
@@ -8,13 +8,13 @@ const useNavs = (channelId) => {
{
name: "overview",
title: "Overview",
component: <Overview id={channelId} />,
component: <Overview id={channelId} />
},
{
name: "members",
title: "Members",
component: <ManageMembers cid={channelId} />,
},
component: <ManageMembers cid={channelId} />
}
// {
// name: "permissions",
// title: "Permissions",
@@ -27,8 +27,8 @@ const useNavs = (channelId) => {
// name: "integrations",
// title: "Integrations",
// },
],
},
]
}
// {
// title: "User Management",
// items: [