From ea394d89b27ec087dc005b17bba37ec1cb0e98cc Mon Sep 17 00:00:00 2001 From: Nikolay <44711630+Bitnik212@users.noreply.github.com> Date: Fri, 13 Dec 2024 08:23:16 +0300 Subject: [PATCH] fix: add server name change in mobile header (#4195) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [fix] add server name change in mobile header * Update web/src/components/MobileHeader.tsx * Update web/src/components/MobileHeader.tsx * Apply suggestions from code review --------- Co-authored-by: Николай Витальевич Никоноров Co-authored-by: Johnny --- web/src/components/MobileHeader.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsx index b852598832294..e36c49481f6ca 100644 --- a/web/src/components/MobileHeader.tsx +++ b/web/src/components/MobileHeader.tsx @@ -1,7 +1,9 @@ import clsx from "clsx"; -import { useState } from "react"; import useWindowScroll from "react-use/lib/useWindowScroll"; import useResponsiveWidth from "@/hooks/useResponsiveWidth"; +import { useWorkspaceSettingStore } from "@/store/v1"; +import { WorkspaceGeneralSetting } from "@/types/proto/api/v1/workspace_setting_service"; +import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting"; import NavigationDrawer from "./NavigationDrawer"; interface Props { @@ -12,8 +14,10 @@ interface Props { const MobileHeader = (props: Props) => { const { className, children } = props; const { sm } = useResponsiveWidth(); - const [titleText] = useState("Memos"); const { y: offsetTop } = useWindowScroll(); + const workspaceSettingStore = useWorkspaceSettingStore(); + const workspaceGeneralSetting = + workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({}); return (
{ className="font-bold text-lg leading-10 mr-1 text-ellipsis shrink-0 cursor-pointer overflow-hidden text-gray-700 dark:text-gray-300" onDoubleClick={() => location.reload()} > - {titleText} + {workspaceGeneralSetting.customProfile?.title || "Memos"}
{children}