refactor: more TS code
This commit is contained in:
@@ -6,7 +6,7 @@ import { useDispatch, useSelector } from "react-redux";
|
||||
import PinList from "./PinList";
|
||||
import FavList from "../FavList";
|
||||
import { useReadMessageMutation } from "../../../app/services/message";
|
||||
import { updateRemeberedNavs } from "../../../app/slices/ui";
|
||||
import { updateRememberedNavs } from "../../../app/slices/ui";
|
||||
import useMessageFeed from "../../../common/hook/useMessageFeed";
|
||||
import useConfig from "../../../common/hook/useConfig";
|
||||
import ChannelIcon from "../../../common/component/ChannelIcon";
|
||||
@@ -76,9 +76,9 @@ export default function ChannelChat({ cid = "", dropFiles = [] }) {
|
||||
// dispatch(readMessage(msgIds));
|
||||
// };
|
||||
useEffect(() => {
|
||||
dispatch(updateRemeberedNavs());
|
||||
dispatch(updateRememberedNavs());
|
||||
return () => {
|
||||
dispatch(updateRemeberedNavs({ path: pathname }));
|
||||
dispatch(updateRememberedNavs({ path: pathname }));
|
||||
};
|
||||
}, [pathname]);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function HomePage() {
|
||||
loginUid,
|
||||
ui: {
|
||||
ready,
|
||||
remeberedNavs: { chat: chatPath, user: userPath }
|
||||
rememberedNavs: { chat: chatPath, user: userPath }
|
||||
}
|
||||
} = useAppSelector((store) => {
|
||||
return {
|
||||
|
||||
@@ -138,7 +138,6 @@ export default function Overview({ id = 0 }) {
|
||||
</div>
|
||||
</div>
|
||||
{changed && <SaveTip saveHandler={handleUpdate} resetHandler={handleReset} />}
|
||||
{/* <button onClick={handleUpdate} className="btn">update</button> */}
|
||||
</StyledWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,26 +29,8 @@ const useNavs = (cid: number): Nav[] => {
|
||||
title: "Members",
|
||||
component: <ManageMembers cid={cid} />
|
||||
}
|
||||
// {
|
||||
// name: "permissions",
|
||||
// title: "Permissions",
|
||||
// },
|
||||
// {
|
||||
// name: "invites",
|
||||
// title: "Invites",
|
||||
// },
|
||||
// {
|
||||
// name: "integrations",
|
||||
// title: "Integrations",
|
||||
// },
|
||||
]
|
||||
}
|
||||
// {
|
||||
// title: "User Management",
|
||||
// items: [
|
||||
|
||||
// ],
|
||||
// },
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect } from "react";
|
||||
import { NavLink, useParams, useLocation } from "react-router-dom";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import { updateRemeberedNavs } from "../../app/slices/ui";
|
||||
import { updateRememberedNavs } from "../../app/slices/ui";
|
||||
import Search from "../../common/component/Search";
|
||||
import User from "../../common/component/User";
|
||||
import Profile from "../../common/component/Profile";
|
||||
@@ -16,9 +16,9 @@ export default function UsersPage() {
|
||||
const { user_id } = useParams();
|
||||
const userIds = useSelector((store) => store.users.ids);
|
||||
useEffect(() => {
|
||||
dispatch(updateRemeberedNavs({ key: "user" }));
|
||||
dispatch(updateRememberedNavs({ key: "user" }));
|
||||
return () => {
|
||||
dispatch(updateRemeberedNavs({ key: "user", path: pathname }));
|
||||
dispatch(updateRememberedNavs({ key: "user", path: pathname }));
|
||||
};
|
||||
}, [pathname]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user