|
@@ -23,6 +23,7 @@ import {
|
|
|
} from "react-router-dom";
|
|
|
import { SideBar } from "./sidebar";
|
|
|
import { useAppConfig } from "../store/config";
|
|
|
+import { AuthPage } from "./auth";
|
|
|
|
|
|
export function Loading(props: { noLogo?: boolean }) {
|
|
|
return (
|
|
@@ -102,6 +103,7 @@ function Screen() {
|
|
|
const config = useAppConfig();
|
|
|
const location = useLocation();
|
|
|
const isHome = location.pathname === Path.Home;
|
|
|
+ const isAuth = location.pathname === Path.Auth;
|
|
|
const isMobileScreen = useMobileScreen();
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -119,17 +121,25 @@ function Screen() {
|
|
|
}`
|
|
|
}
|
|
|
>
|
|
|
- <SideBar className={isHome ? styles["sidebar-show"] : ""} />
|
|
|
-
|
|
|
- <div className={styles["window-content"]} id={SlotID.AppBody}>
|
|
|
- <Routes>
|
|
|
- <Route path={Path.Home} element={<Chat />} />
|
|
|
- <Route path={Path.NewChat} element={<NewChat />} />
|
|
|
- <Route path={Path.Masks} element={<MaskPage />} />
|
|
|
- <Route path={Path.Chat} element={<Chat />} />
|
|
|
- <Route path={Path.Settings} element={<Settings />} />
|
|
|
- </Routes>
|
|
|
- </div>
|
|
|
+ {isAuth ? (
|
|
|
+ <>
|
|
|
+ <AuthPage />
|
|
|
+ </>
|
|
|
+ ) : (
|
|
|
+ <>
|
|
|
+ <SideBar className={isHome ? styles["sidebar-show"] : ""} />
|
|
|
+
|
|
|
+ <div className={styles["window-content"]} id={SlotID.AppBody}>
|
|
|
+ <Routes>
|
|
|
+ <Route path={Path.Home} element={<Chat />} />
|
|
|
+ <Route path={Path.NewChat} element={<NewChat />} />
|
|
|
+ <Route path={Path.Masks} element={<MaskPage />} />
|
|
|
+ <Route path={Path.Chat} element={<Chat />} />
|
|
|
+ <Route path={Path.Settings} element={<Settings />} />
|
|
|
+ </Routes>
|
|
|
+ </div>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|