chore: rename again
This commit is contained in:
@@ -6,7 +6,7 @@ import IconInvite from "../../assets/icons/add.person.svg";
|
||||
import IconMention from "../../assets/icons/mention.svg";
|
||||
import ChannelIcon from "./ChannelIcon";
|
||||
import ChannelModal from "./ChannelModal";
|
||||
import ContactsModal from "./UsersModal";
|
||||
import UsersModal from "./UsersModal";
|
||||
import InviteModal from "./InviteModal";
|
||||
|
||||
const Styled = styled.ul`
|
||||
@@ -47,7 +47,7 @@ export default function AddEntriesMenu() {
|
||||
const [inviteModalVisible, setInviteModalVisible] = useState(false);
|
||||
|
||||
const [channelModalVisible, setChannelModalVisible] = useState(false);
|
||||
const [usersModalVisible, setContactsModalVisible] = useState(false);
|
||||
const [usersModalVisible, setUsersModalVisible] = useState(false);
|
||||
const toggleInviteModalVisible = () => {
|
||||
setInviteModalVisible((prev) => {
|
||||
if (!prev) {
|
||||
@@ -56,8 +56,8 @@ export default function AddEntriesMenu() {
|
||||
return !prev;
|
||||
});
|
||||
};
|
||||
const toggleContactsModalVisible = () => {
|
||||
setContactsModalVisible((prevVisible) => {
|
||||
const toggleUsersModalVisible = () => {
|
||||
setUsersModalVisible((prevVisible) => {
|
||||
if (!prevVisible) {
|
||||
hideAll();
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export default function AddEntriesMenu() {
|
||||
<ChannelIcon personal={true} className="icon" />
|
||||
New Private Channel
|
||||
</li>
|
||||
<li className="item" onClick={toggleContactsModalVisible}>
|
||||
<li className="item" onClick={toggleUsersModalVisible}>
|
||||
<IconMention className="icon" />
|
||||
New Message
|
||||
</li>
|
||||
@@ -96,7 +96,7 @@ export default function AddEntriesMenu() {
|
||||
</li>
|
||||
</Styled>
|
||||
{channelModalVisible && <ChannelModal personal={isPrivate} closeModal={handleCloseModal} />}
|
||||
{usersModalVisible && <ContactsModal closeModal={toggleContactsModalVisible} />}
|
||||
{usersModalVisible && <UsersModal closeModal={toggleUsersModalVisible} />}
|
||||
{inviteModalVisible && <InviteModal closeModal={toggleInviteModalVisible} />}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ import IconChat from "../../assets/icons/placeholder.chat.svg";
|
||||
import IconAsk from "../../assets/icons/placeholder.question.svg";
|
||||
import IconInvite from "../../assets/icons/placeholder.invite.svg";
|
||||
import IconDownload from "../../assets/icons/placeholder.download.svg";
|
||||
import ContactsModal from "./UsersModal";
|
||||
import UsersModal from "./UsersModal";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
|
||||
const Styled = styled.div`
|
||||
@@ -75,19 +75,19 @@ const BlankPlaceholder: FC<Props> = ({ type = "chat" }) => {
|
||||
const server = useAppSelector((store) => store.server);
|
||||
const [inviteModalVisible, setInviteModalVisible] = useState(false);
|
||||
const [createChannelVisible, setCreateChannelVisible] = useState(false);
|
||||
const [userListVisible, setContactListVisible] = useState(false);
|
||||
const [userListVisible, setUserListVisible] = useState(false);
|
||||
const toggleChannelModalVisible = () => {
|
||||
setCreateChannelVisible((prev) => !prev);
|
||||
};
|
||||
const toggleContactListVisible = () => {
|
||||
setContactListVisible((prev) => !prev);
|
||||
const toggleUserListVisible = () => {
|
||||
setUserListVisible((prev) => !prev);
|
||||
};
|
||||
const toggleInviteModalVisible = () => {
|
||||
setInviteModalVisible((prev) => !prev);
|
||||
};
|
||||
const chatTip =
|
||||
type == "chat" ? "Create a Channel to Start a Conversation" : "Send a Direct Message";
|
||||
const chatHandler = type == "chat" ? toggleChannelModalVisible : toggleContactListVisible;
|
||||
const chatHandler = type == "chat" ? toggleChannelModalVisible : toggleUserListVisible;
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -121,7 +121,7 @@ const BlankPlaceholder: FC<Props> = ({ type = "chat" }) => {
|
||||
{createChannelVisible && (
|
||||
<ChannelModal personal={true} closeModal={toggleChannelModalVisible} />
|
||||
)}
|
||||
{userListVisible && <ContactsModal closeModal={toggleContactListVisible} />}
|
||||
{userListVisible && <UsersModal closeModal={toggleUserListVisible} />}
|
||||
{inviteModalVisible && <InviteModal closeModal={toggleInviteModalVisible} />}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import styled from "styled-components";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import { hideAll } from "tippy.js";
|
||||
import toast from "react-hot-toast";
|
||||
import { useUpdateContactMutation } from "../../app/services/user";
|
||||
import { useUpdateUserMutation } from "../../app/services/user";
|
||||
import User from "./User";
|
||||
import StyledMenu from "./styled/Menu";
|
||||
import InviteLink from "./InviteLink";
|
||||
@@ -11,7 +11,7 @@ import moreIcon from "../../assets/icons/more.svg?url";
|
||||
import IconOwner from "../../assets/icons/owner.svg";
|
||||
import IconArrowDown from "../../assets/icons/arrow.down.mini.svg";
|
||||
import IconCheck from "../../assets/icons/check.sign.svg";
|
||||
import useContactOperation from "../hook/useContactOperation";
|
||||
import useUserOperation from "../hook/useUserOperation";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
|
||||
const StyledWrapper = styled.section`
|
||||
@@ -126,8 +126,8 @@ const ManageMembers: FC<Props> = ({ cid }) => {
|
||||
loginUser: store.authData.user
|
||||
};
|
||||
});
|
||||
const { copyEmail, removeFromChannel, removeUser } = useContactOperation({ cid });
|
||||
const [updateContact, { isSuccess: updateSuccess }] = useUpdateContactMutation();
|
||||
const { copyEmail, removeFromChannel, removeUser } = useUserOperation({ cid });
|
||||
const [updateUser, { isSuccess: updateSuccess }] = useUpdateUserMutation();
|
||||
|
||||
useEffect(() => {
|
||||
if (updateSuccess) {
|
||||
@@ -138,7 +138,7 @@ const ManageMembers: FC<Props> = ({ cid }) => {
|
||||
const handleToggleRole = ({ ignore = false, uid = null, isAdmin = true }) => {
|
||||
hideAll();
|
||||
if (ignore) return;
|
||||
updateContact({ id: uid, is_admin: isAdmin });
|
||||
updateUser({ id: uid, is_admin: isAdmin });
|
||||
};
|
||||
const channel = channels.byId[cid] ?? null;
|
||||
const uids = channel ? (channel.is_public ? users.ids : channel.members) : users.ids;
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
import { createGlobalStyle } from 'styled-components';
|
||||
import { createGlobalStyle } from "styled-components";
|
||||
|
||||
const MarkdownOverrides = createGlobalStyle`
|
||||
[class^='toastui-editor-'] {
|
||||
.toastui-editor-md-container {
|
||||
border-bottom: none;
|
||||
|
||||
.toastui-editor-md-preview {
|
||||
padding-right: 0;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.toastui-editor-md-splitter {
|
||||
background-color: #D0D5DD;
|
||||
}
|
||||
|
||||
.ProseMirror {
|
||||
height: 100%;
|
||||
}
|
||||
@@ -23,7 +20,6 @@ const MarkdownOverrides = createGlobalStyle`
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ProseMirror, p, .toastui-editor.md-mode {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
@@ -77,27 +73,18 @@ const MarkdownOverrides = createGlobalStyle`
|
||||
white-space: nowrap;
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
/* display: flex;
|
||||
flex-direction:column;
|
||||
margin-left: 20px; */
|
||||
|
||||
> li:before {
|
||||
margin-top: 8px;
|
||||
margin-left: -14px;
|
||||
background-color: #475467;
|
||||
}
|
||||
|
||||
/* list-style-type: disc; */
|
||||
|
||||
}
|
||||
|
||||
ul,
|
||||
ol {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
color: #475467;
|
||||
/* list-style-position: inside; */
|
||||
}
|
||||
|
||||
h1,
|
||||
|
||||
@@ -10,7 +10,6 @@ const Styled = styled.span`
|
||||
strong {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
/* padding-right: 5px; */
|
||||
}
|
||||
.btns {
|
||||
gap: 5px;
|
||||
|
||||
@@ -7,7 +7,7 @@ import IconMore from "../../../assets/icons/more.svg";
|
||||
import Avatar from "../Avatar";
|
||||
import StyledWrapper from "./styled";
|
||||
import StyledMenu from "../styled/Menu";
|
||||
import useContactOperation from "../../hook/useContactOperation";
|
||||
import useUserOperation from "../../hook/useUserOperation";
|
||||
import { useAppSelector } from "../../../app/store";
|
||||
|
||||
interface Props {
|
||||
@@ -26,7 +26,7 @@ const Profile: FC<Props> = ({ uid, type = "embed", cid }) => {
|
||||
canRemoveFromChannel,
|
||||
canRemove,
|
||||
removeUser
|
||||
} = useContactOperation({ uid, cid });
|
||||
} = useUserOperation({ uid, cid });
|
||||
|
||||
const { data } = useAppSelector((store) => {
|
||||
return {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FC, ReactElement } from "react";
|
||||
import Tippy from "@tippyjs/react";
|
||||
import useContactOperation from "../../hook/useContactOperation";
|
||||
import useUserOperation from "../../hook/useUserOperation";
|
||||
import ContextMenu from "../ContextMenu";
|
||||
|
||||
interface Props {
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
children: ReactElement;
|
||||
}
|
||||
|
||||
const ContactContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide, children }) => {
|
||||
const UserContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide, children }) => {
|
||||
const {
|
||||
canCall,
|
||||
call,
|
||||
@@ -23,7 +23,7 @@ const ContactContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide
|
||||
canRemoveFromChannel,
|
||||
removeFromChannel,
|
||||
removeUser
|
||||
} = useContactOperation({
|
||||
} = useUserOperation({
|
||||
uid,
|
||||
cid
|
||||
});
|
||||
@@ -72,4 +72,4 @@ const ContactContextMenu: FC<Props> = ({ enable = false, uid, cid, visible, hide
|
||||
);
|
||||
};
|
||||
|
||||
export default ContactContextMenu;
|
||||
export default UserContextMenu;
|
||||
|
||||
@@ -55,7 +55,7 @@ interface Props {
|
||||
closeModal: () => void;
|
||||
}
|
||||
|
||||
const ContactsModal: FC<Props> = ({ closeModal }) => {
|
||||
const UsersModal: FC<Props> = ({ closeModal }) => {
|
||||
const wrapperRef = useRef<HTMLDivElement>(null);
|
||||
const { users, updateInput, input } = useFilteredUsers();
|
||||
useOutsideClick(wrapperRef, closeModal);
|
||||
@@ -89,4 +89,4 @@ const ContactsModal: FC<Props> = ({ closeModal }) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ContactsModal;
|
||||
export default UsersModal;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useDispatch, batch } from "react-redux";
|
||||
import { resetFootprint } from "../../app/slices/footprint";
|
||||
import { resetChannels } from "../../app/slices/channels";
|
||||
import { resetContacts } from "../../app/slices/users";
|
||||
import { resetUsers } from "../../app/slices/users";
|
||||
import { resetChannelMsg } from "../../app/slices/message.channel";
|
||||
import { resetUserMsg } from "../../app/slices/message.user";
|
||||
import { resetReactionMessage } from "../../app/slices/message.reaction";
|
||||
@@ -21,7 +21,7 @@ export default function useLogout() {
|
||||
dispatch(resetChannelMsg());
|
||||
dispatch(resetUserMsg());
|
||||
dispatch(resetChannels());
|
||||
dispatch(resetContacts());
|
||||
dispatch(resetUsers());
|
||||
dispatch(resetMessage());
|
||||
dispatch(resetReactionMessage());
|
||||
dispatch(resetFileMessage());
|
||||
|
||||
@@ -4,7 +4,7 @@ import toast from "react-hot-toast";
|
||||
import { useNavigate, useMatch } from "react-router-dom";
|
||||
import { hideAll } from "tippy.js";
|
||||
import { useRemoveMembersMutation } from "../../app/services/channel";
|
||||
import { useLazyDeleteContactQuery } from "../../app/services/user";
|
||||
import { useLazyDeleteUserQuery } from "../../app/services/user";
|
||||
import useConfig from "./useConfig";
|
||||
import useCopy from "./useCopy";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
@@ -12,11 +12,11 @@ interface Props {
|
||||
uid?: number;
|
||||
cid?: number;
|
||||
}
|
||||
const useContactOperation: FC<Props> = ({ uid, cid }) => {
|
||||
const useUserOperation: FC<Props> = ({ uid, cid }) => {
|
||||
const [passedUid, setPassedUid] = useState(undefined);
|
||||
const { values: agoraConfig } = useConfig("agora");
|
||||
const isUserDetailPath = useMatch(`/users/${uid}`);
|
||||
const [removeUser, { isSuccess: removeUserSuccess }] = useLazyDeleteContactQuery();
|
||||
const [removeUser, { isSuccess: removeUserSuccess }] = useLazyDeleteUserQuery();
|
||||
const [removeInChannel, { isSuccess: removeSuccess }] = useRemoveMembersMutation();
|
||||
const navigateTo = useNavigate();
|
||||
const { copy } = useCopy();
|
||||
@@ -89,4 +89,4 @@ const useContactOperation: FC<Props> = ({ uid, cid }) => {
|
||||
call
|
||||
};
|
||||
};
|
||||
export default useContactOperation;
|
||||
export default useUserOperation;
|
||||
Reference in New Issue
Block a user