From 06609971a7f05e8abc70d08f9cbd3ff5ab1f536d Mon Sep 17 00:00:00 2001 From: Local Admin Date: Tue, 27 Jan 2026 00:37:06 +0000 Subject: [PATCH] feat(ui): show selection bar in desktop header --- web/src/components/DesktopHeader.tsx | 25 +++++++++++++++++++++++++ web/src/components/MobileHeader.tsx | 10 +++++----- web/src/layouts/MainLayout.tsx | 8 +++++++- 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 web/src/components/DesktopHeader.tsx diff --git a/web/src/components/DesktopHeader.tsx b/web/src/components/DesktopHeader.tsx new file mode 100644 index 000000000..2b6ddfe90 --- /dev/null +++ b/web/src/components/DesktopHeader.tsx @@ -0,0 +1,25 @@ +import { Link } from "react-router-dom"; +import { useInstance } from "@/contexts/InstanceContext"; +import UserAvatar from "@/components/UserAvatar"; + +const DesktopHeader = () => { + const { generalSetting } = useInstance(); + const title = generalSetting.customProfile?.title || "Memos"; + const avatarUrl = generalSetting.customProfile?.logoUrl || "/full-logo.webp"; + + return ( +
+
+ + + {title} + +
+
+
+
+
+ ); +}; + +export default DesktopHeader; diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsx index 273754b4b..dc7c42d60 100644 --- a/web/src/components/MobileHeader.tsx +++ b/web/src/components/MobileHeader.tsx @@ -19,16 +19,16 @@ const MobileHeader = (props: Props) => { return (
0 && "shadow-md", className, )} > - {!sm && } -
-
- {children} +
+ {!sm && } +
{children}
+
); }; diff --git a/web/src/layouts/MainLayout.tsx b/web/src/layouts/MainLayout.tsx index 55570641e..ef413c146 100644 --- a/web/src/layouts/MainLayout.tsx +++ b/web/src/layouts/MainLayout.tsx @@ -2,6 +2,7 @@ import { useEffect, useMemo, useState } from "react"; import { matchPath, Outlet, useLocation } from "react-router-dom"; import type { MemoExplorerContext } from "@/components/MemoExplorer"; import { MemoExplorer, MemoExplorerDrawer } from "@/components/MemoExplorer"; +import DesktopHeader from "@/components/DesktopHeader"; import MobileHeader from "@/components/MobileHeader"; import { userServiceClient } from "@/connect"; import useCurrentUser from "@/hooks/useCurrentUser"; @@ -80,7 +81,12 @@ const MainLayout = () => {
)}
-
+ {md && ( +
+ +
+ )} +