chore: rename again
This commit is contained in:
@@ -25,7 +25,7 @@ import IconHeadphone from "../../../assets/icons/headphone.svg";
|
||||
import addIcon from "../../../assets/icons/add.svg?url";
|
||||
import {
|
||||
// StyledNotification,
|
||||
StyledContacts,
|
||||
StyledUsers,
|
||||
StyledChannelChat,
|
||||
StyledHeader
|
||||
} from "./styled";
|
||||
@@ -186,7 +186,7 @@ export default function ChannelChat({ cid = "", dropFiles = [] }) {
|
||||
users={
|
||||
membersVisible ? (
|
||||
<>
|
||||
<StyledContacts>
|
||||
<StyledUsers>
|
||||
{addVisible && (
|
||||
<div className="add" onClick={toggleAddVisible}>
|
||||
<img className="icon" src={addIcon} />
|
||||
@@ -206,7 +206,7 @@ export default function ChannelChat({ cid = "", dropFiles = [] }) {
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</StyledContacts>
|
||||
</StyledUsers>
|
||||
</>
|
||||
) : null
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export const StyledNotification = styled.div`
|
||||
outline: none;
|
||||
}
|
||||
`;
|
||||
export const StyledContacts = styled.div`
|
||||
export const StyledUsers = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useUpdateMuteSettingMutation } from "../../../app/services/user";
|
||||
import { useReadMessageMutation } from "../../../app/services/message";
|
||||
import { removeUserSession } from "../../../app/slices/message.user";
|
||||
import ContextMenu from "../../../common/component/ContextMenu";
|
||||
import useContactOperation from "../../../common/hook/useContactOperation";
|
||||
import useUserOperation from "../../../common/hook/useUserOperation";
|
||||
|
||||
export default function SessionContextMenu({
|
||||
context = "user",
|
||||
@@ -17,7 +17,7 @@ export default function SessionContextMenu({
|
||||
setInviteChannelId,
|
||||
children
|
||||
}) {
|
||||
const { canCopyEmail, copyEmail } = useContactOperation({ uid: context == "user" ? id : null });
|
||||
const { canCopyEmail, copyEmail } = useUserOperation({ uid: context == "user" ? id : null });
|
||||
const [muteChannel] = useUpdateMuteSettingMutation();
|
||||
const [updateReadIndex] = useReadMessageMutation();
|
||||
const pathMatched = useMatch(`/chat/dm/${id}`);
|
||||
|
||||
@@ -15,7 +15,7 @@ import Tooltip from "../../common/component/Tooltip";
|
||||
import ChannelChat from "./ChannelChat";
|
||||
import DMChat from "./DMChat";
|
||||
import ChannelList from "./ChannelList";
|
||||
import ContactsModal from "../../common/component/UsersModal";
|
||||
import UsersModal from "../../common/component/UsersModal";
|
||||
import ChannelModal from "../../common/component/ChannelModal";
|
||||
import DMList from "./DMList";
|
||||
|
||||
@@ -28,10 +28,10 @@ export default function ChatPage() {
|
||||
};
|
||||
});
|
||||
const [channelModalVisible, setChannelModalVisible] = useState(false);
|
||||
const [usersModalVisible, setContactsModalVisible] = useState(false);
|
||||
const [usersModalVisible, setUsersModalVisible] = useState(false);
|
||||
const { channel_id, user_id } = useParams();
|
||||
const toggleContactsModalVisible = () => {
|
||||
setContactsModalVisible((prev) => !prev);
|
||||
const toggleUsersModalVisible = () => {
|
||||
setUsersModalVisible((prev) => !prev);
|
||||
};
|
||||
const toggleChannelModalVisible = () => {
|
||||
setChannelModalVisible((prev) => !prev);
|
||||
@@ -49,7 +49,7 @@ export default function ChatPage() {
|
||||
{channelModalVisible && (
|
||||
<ChannelModal closeModal={toggleChannelModalVisible} personal={true} />
|
||||
)}
|
||||
{usersModalVisible && <ContactsModal closeModal={toggleContactsModalVisible} />}
|
||||
{usersModalVisible && <UsersModal closeModal={toggleUsersModalVisible} />}
|
||||
<StyledWrapper>
|
||||
<div className="left">
|
||||
<Server />
|
||||
@@ -74,7 +74,7 @@ export default function ChatPage() {
|
||||
DIRECT MESSAGE
|
||||
</span>
|
||||
<Tooltip tip="New DM" placement="bottom">
|
||||
<AddIcon className="add_icon" onClick={toggleContactsModalVisible} />
|
||||
<AddIcon className="add_icon" onClick={toggleUsersModalVisible} />
|
||||
</Tooltip>
|
||||
</h3>
|
||||
<nav className="nav">
|
||||
|
||||
@@ -9,20 +9,20 @@ import Server from "../../common/component/Server";
|
||||
import CurrentUser from "../../common/component/CurrentUser";
|
||||
import ChannelChat from "./ChannelChat";
|
||||
import DMChat from "./DMChat";
|
||||
import ContactsModal from "../../common/component/UsersModal";
|
||||
import UsersModal from "../../common/component/UsersModal";
|
||||
import ChannelModal from "../../common/component/ChannelModal";
|
||||
import SessionList from "./SessionList";
|
||||
export default function ChatPage() {
|
||||
const [channelModalVisible, setChannelModalVisible] = useState(false);
|
||||
const [usersModalVisible, setContactsModalVisible] = useState(false);
|
||||
const [usersModalVisible, setUsersModalVisible] = useState(false);
|
||||
const { channel_id, user_id } = useParams();
|
||||
const { sessionUids } = useSelector((store) => {
|
||||
return {
|
||||
sessionUids: store.userMessage.ids
|
||||
};
|
||||
});
|
||||
const toggleContactsModalVisible = () => {
|
||||
setContactsModalVisible((prev) => !prev);
|
||||
const toggleUsersModalVisible = () => {
|
||||
setUsersModalVisible((prev) => !prev);
|
||||
};
|
||||
const toggleChannelModalVisible = () => {
|
||||
setChannelModalVisible((prev) => !prev);
|
||||
@@ -38,7 +38,7 @@ export default function ChatPage() {
|
||||
{channelModalVisible && (
|
||||
<ChannelModal closeModal={toggleChannelModalVisible} personal={true} />
|
||||
)}
|
||||
{usersModalVisible && <ContactsModal closeModal={toggleContactsModalVisible} />}
|
||||
{usersModalVisible && <UsersModal closeModal={toggleUsersModalVisible} />}
|
||||
<StyledWrapper>
|
||||
<div className="left">
|
||||
<Server />
|
||||
|
||||
@@ -13,7 +13,7 @@ import Notification from "../../common/component/Notification";
|
||||
import Manifest from "../../common/component/Manifest";
|
||||
|
||||
import ChatIcon from "../../assets/icons/chat.svg";
|
||||
import ContactIcon from "../../assets/icons/user.svg";
|
||||
import UserIcon from "../../assets/icons/user.svg";
|
||||
import FavIcon from "../../assets/icons/bookmark.svg";
|
||||
import FolderIcon from "../../assets/icons/folder.svg";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
@@ -74,7 +74,7 @@ export default function HomePage() {
|
||||
</NavLink>
|
||||
<NavLink className="link" to={userNav}>
|
||||
<Tooltip tip="Members">
|
||||
<ContactIcon />
|
||||
<UserIcon />
|
||||
</Tooltip>
|
||||
</NavLink>
|
||||
<NavLink className="link" to={"/favs"}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect } from "react";
|
||||
import initCache, { useRehydrate } from "../../app/cache";
|
||||
import { useLazyGetFavoritesQuery } from "../../app/services/message";
|
||||
import { useLazyGetContactsQuery } from "../../app/services/user";
|
||||
import { useLazyGetUsersQuery } from "../../app/services/user";
|
||||
import { useLazyGetServerQuery } from "../../app/services/server";
|
||||
import useStreaming from "../../common/hook/useStreaming";
|
||||
import { useAppSelector } from "../../app/store";
|
||||
@@ -26,9 +26,9 @@ export default function usePreload() {
|
||||
}
|
||||
] = useLazyGetFavoritesQuery();
|
||||
const [
|
||||
getContacts,
|
||||
getUsers,
|
||||
{ isLoading: usersLoading, isSuccess: usersSuccess, isError: usersError, data: users }
|
||||
] = useLazyGetContactsQuery();
|
||||
] = useLazyGetUsersQuery();
|
||||
const [
|
||||
getServer,
|
||||
{ isLoading: serverLoading, isSuccess: serverSuccess, isError: serverError, data: server }
|
||||
@@ -43,7 +43,7 @@ export default function usePreload() {
|
||||
|
||||
useEffect(() => {
|
||||
if (rehydrated) {
|
||||
getContacts();
|
||||
getUsers();
|
||||
getServer();
|
||||
getFavorites();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ const SendMagicLinkPage = lazy(() => import("./sendMagicLink"));
|
||||
const RegPage = lazy(() => import("./reg/Register"));
|
||||
const LoginPage = lazy(() => import("./login"));
|
||||
const OAuthPage = lazy(() => import("./oauth"));
|
||||
const ContactsPage = lazy(() => import("./users"));
|
||||
const UsersPage = lazy(() => import("./users"));
|
||||
const FavoritesPage = lazy(() => import("./favs"));
|
||||
const OnboardingPage = lazy(() => import("./onboarding"));
|
||||
const InvitePage = lazy(() => import("./invite"));
|
||||
@@ -143,7 +143,7 @@ const PageRoutes = () => {
|
||||
index
|
||||
element={
|
||||
<Suspense fallback={<Loading />}>
|
||||
<ContactsPage />
|
||||
<UsersPage />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
@@ -151,7 +151,7 @@ const PageRoutes = () => {
|
||||
path=":user_id"
|
||||
element={
|
||||
<Suspense fallback={<Loading />}>
|
||||
<ContactsPage />
|
||||
<UsersPage />
|
||||
</Suspense>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -9,7 +9,7 @@ import Profile from "../../common/component/Profile";
|
||||
import StyledWrapper from "./styled";
|
||||
import BlankPlaceholder from "../../common/component/BlankPlaceholder";
|
||||
|
||||
export default function ContactsPage() {
|
||||
export default function UsersPage() {
|
||||
const dispatch = useDispatch();
|
||||
const { pathname } = useLocation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user