refactor: guest mode

This commit is contained in:
Tristan Yang
2022-09-02 08:59:19 +08:00
parent 3247de57db
commit 265bf11ad0
20 changed files with 140 additions and 366 deletions
+1 -34
View File
@@ -23,13 +23,9 @@ import RequireAuth from "../common/component/RequireAuth";
import RequireNoAuth from "../common/component/RequireNoAuth";
import Meta from "../common/component/Meta";
import HomePage from "./home";
import GeustPage from "./guest";
// import GuestChannelChatPage from "./guest/ChannelChat";
import ChatPage from "./chat";
import Loading from "../common/component/Loading";
import store, { useAppSelector } from "../app/store";
import OffTip from "./guest/OffTip";
import GuestOnly from "../common/component/GuestOnly";
let toastId: string;
const PageRoutes = () => {
const {
@@ -93,34 +89,13 @@ const PageRoutes = () => {
/>
<Route path="/invite" element={<InvitePage />} />
<Route path="/onboarding" element={<OnboardingPage />} />
{/* guest mode */}
<Route path="/v">
<Route
index
element={
<GuestOnly>
<GeustPage />
</GuestOnly>
}
/>
<Route
path="c/:cid"
element={
<GuestOnly>
<GeustPage />
</GuestOnly>
}
/>
<Route path="off" element={<OffTip />} />
</Route>
<Route
path="/"
element={
// <Suspense fallback={<Loading />}>
<RequireAuth>
<HomePage />
</RequireAuth>
// </Suspense>
}
>
<Route path="setting">
@@ -203,15 +178,7 @@ const PageRoutes = () => {
);
};
// const local_key = "AUTH_DATA";
export default function ReduxRoutes() {
// const [authData, setAuthData] = useState(
// JSON.parse(localStorage.getItem(local_key))
// );
// const updateAuthData = (data) => {
// localStorage.setItem(local_key, JSON.stringify(data));
// setAuthData(data);
// };
return (
<Provider store={store}>
<Meta />