diff --git a/src/pages/RevoltApp.tsx b/src/pages/RevoltApp.tsx index 5e564f6d1c31073c0fccb19dc1a62c5f46ded97c..bc309c3037314597105cdc772d126a6ac4e27997 100644 --- a/src/pages/RevoltApp.tsx +++ b/src/pages/RevoltApp.tsx @@ -10,6 +10,7 @@ import Notifications from "../context/revoltjs/Notifications"; import StateMonitor from "../context/revoltjs/StateMonitor"; import SyncManager from "../context/revoltjs/SyncManager"; +import { Titlebar } from "../components/native/Titlebar"; import BottomNavigation from "../components/navigation/BottomNavigation"; import LeftSidebar from "../components/navigation/LeftSidebar"; import RightSidebar from "../components/navigation/RightSidebar"; @@ -43,6 +44,9 @@ export default function App() { return ( <> + {window.isNative && !window.native.getConfig().frame && ( + <Titlebar /> + )} <OverlappingPanels width="100vw" height={ diff --git a/src/pages/app.tsx b/src/pages/app.tsx index 41436c4fc2768283c973640cb0fdbdb275001bbc..57badde4efa7f4d235d59ad187a247c16942f0fc 100644 --- a/src/pages/app.tsx +++ b/src/pages/app.tsx @@ -8,8 +8,6 @@ import { CheckAuth } from "../context/revoltjs/CheckAuth"; import Masks from "../components/ui/Masks"; import Preloader from "../components/ui/Preloader"; -import { Titlebar } from "../components/native/Titlebar"; - const Login = lazy(() => import("./login/Login")); const RevoltApp = lazy(() => import("./RevoltApp")); @@ -17,9 +15,6 @@ export function App() { return ( <Context> <Masks /> - {window.isNative && !window.native.getConfig().frame && ( - <Titlebar /> - )} {/* // @ts-expect-error */} <Suspense fallback={<Preloader type="spinner" />}> diff --git a/src/pages/developer/Developer.tsx b/src/pages/developer/Developer.tsx index fb07302693582cb46e7d3c21337c1335e0c661f2..7784d3aa098071cc04e8463ea576d5439fa0a2eb 100644 --- a/src/pages/developer/Developer.tsx +++ b/src/pages/developer/Developer.tsx @@ -1,5 +1,4 @@ import { Wrench } from "@styled-icons/boxicons-solid"; -import { observer } from "mobx-react-lite"; import { useContext } from "preact/hooks"; diff --git a/src/pages/login/Login.tsx b/src/pages/login/Login.tsx index 9e3d6f44f62c90750f4598a2bd3d839b26cad3f9..dcd252f0abd657fe5fdd42ade6859e1e71ee2d9a 100644 --- a/src/pages/login/Login.tsx +++ b/src/pages/login/Login.tsx @@ -11,6 +11,7 @@ import { AppContext } from "../../context/revoltjs/RevoltClient"; import LocaleSelector from "../../components/common/LocaleSelector"; +import { Titlebar } from "../../components/native/Titlebar"; import { APP_VERSION } from "../../version"; import background from "./background.jpg"; import { FormCreate } from "./forms/FormCreate"; @@ -23,52 +24,57 @@ export default function Login() { const client = useContext(AppContext); return ( - <div className={styles.login}> - <Helmet> - <meta name="theme-color" content={theme.background} /> - </Helmet> - <div className={styles.content}> - <div className={styles.attribution}> - <span> - API:{" "} - <code>{client.configuration?.revolt ?? "???"}</code>{" "} - · revolt.js: <code>{LIBRARY_VERSION}</code>{" "} - · App: <code>{APP_VERSION}</code> - </span> - <span> - <LocaleSelector /> - </span> - </div> - <div className={styles.modal}> - <Switch> - <Route path="/login/create"> - <FormCreate /> - </Route> - <Route path="/login/resend"> - <FormResend /> - </Route> - <Route path="/login/reset/:token"> - <FormReset /> - </Route> - <Route path="/login/reset"> - <FormSendReset /> - </Route> - <Route path="/"> - <FormLogin /> - </Route> - </Switch> - </div> - <div className={styles.attribution}> - <span> - <Text id="general.image_by" /> ‎@lorenzoherrera - ‏· unsplash.com - </span> + <> + {window.isNative && !window.native.getConfig().frame && ( + <Titlebar /> + )} + <div className={styles.login}> + <Helmet> + <meta name="theme-color" content={theme.background} /> + </Helmet> + <div className={styles.content}> + <div className={styles.attribution}> + <span> + API:{" "} + <code>{client.configuration?.revolt ?? "???"}</code>{" "} + · revolt.js: <code>{LIBRARY_VERSION}</code>{" "} + · App: <code>{APP_VERSION}</code> + </span> + <span> + <LocaleSelector /> + </span> + </div> + <div className={styles.modal}> + <Switch> + <Route path="/login/create"> + <FormCreate /> + </Route> + <Route path="/login/resend"> + <FormResend /> + </Route> + <Route path="/login/reset/:token"> + <FormReset /> + </Route> + <Route path="/login/reset"> + <FormSendReset /> + </Route> + <Route path="/"> + <FormLogin /> + </Route> + </Switch> + </div> + <div className={styles.attribution}> + <span> + <Text id="general.image_by" /> ‎@lorenzoherrera + ‏· unsplash.com + </span> + </div> </div> + <div + className={styles.bg} + style={{ background: `url('${background}')` }} + /> </div> - <div - className={styles.bg} - style={{ background: `url('${background}')` }} - /> - </div> + </> ); }