A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: show titlebar on auth pages (#9093)
01zulfi9bea4adcf9d7
diff --git a/apps/web/src/components/title-bar/index.tsx b/apps/web/src/components/title-bar/index.tsxindex a7e7798f3..d9787d312 100644--- a/apps/web/src/components/title-bar/index.tsx+++ b/apps/web/src/components/title-bar/index.tsx@@ -68,13 +68,23 @@ export function getWindowControls(];}export const TITLE_BAR_HEIGHT = 37;-export function TitleBar({ isUnderlay = isMac() }: { isUnderlay?: boolean }) {+export function TitleBar({+ isUnderlay = isMac(),+ force = false+}: {+ isUnderlay?: boolean;+ force?: boolean;+}) {const { isFullscreen, hasNativeWindowControls, isMaximized } =useWindowControls();const isTablet = useTablet();const isMobile = useMobile();- if ((!isMac() && !isMobile && !isTablet) || (isFullscreen && isMac()))+ if (+ !force &&+ ((!isMac() && !isMobile && !isTablet) || (isFullscreen && isMac()))+ ) {return null;+ }const tools = getWindowControls(hasNativeWindowControls,diff --git a/apps/web/src/root.tsx b/apps/web/src/root.tsxindex 050d9aa4f..4510b3ee0 100644--- a/apps/web/src/root.tsx+++ b/apps/web/src/root.tsx@@ -28,7 +28,7 @@ import {import { desktop } from "./common/desktop-bridge";import { useKeyStore } from "./interfaces/key-store";import { usePromise } from "@notesnook/common";-import { AuthProps } from "./views/auth";+import { AuthProps, isAuthRouteActive } from "./views/auth";import { loadDatabase } from "./hooks/use-database";import AppLock from "./views/app-lock";import { Text } from "@theme-ui/components";@@ -57,7 +57,7 @@ export async function startApp(children?: React.ReactNode) {root.render(<>- <TitleBar />+ <TitleBar force={isAuthRouteActive()} /><ErrorBoundary><GlobalErrorHandler><BaseThemeProviderdiff --git a/apps/web/src/views/auth.tsx b/apps/web/src/views/auth.tsxindex a24d7730a..2c1e3379c 100644--- a/apps/web/src/views/auth.tsx+++ b/apps/web/src/views/auth.tsx@@ -30,7 +30,12 @@ import {Warn} from "../components/icons";import Field, { FieldProps } from "../components/field";-import { getQueryParams, hardNavigate, makeURL } from "../navigation";+import {+ getCurrentPath,+ getQueryParams,+ hardNavigate,+ makeURL+} from "../navigation";import { store as userstore } from "../stores/user-store";import { db } from "../common/db";import Config from "../utils/config";@@ -163,6 +168,11 @@ const routePaths: Record<AuthRoutes, string> = {signup: "/signup"};+export function isAuthRouteActive() {+ const path = getCurrentPath();+ return Object.values(routePaths).includes(path);+}+const authorizedRoutes: AuthRoutes[] = ["login:email","login:password",