Skip to content

Commit

Permalink
fix: add server name change in mobile header (#4195)
Browse files Browse the repository at this point in the history
* [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: Николай Витальевич Никоноров <[email protected]>
Co-authored-by: Johnny <[email protected]>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent cb569c9 commit ea394d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions web/src/components/MobileHeader.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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 (
<div
Expand All @@ -29,7 +33,7 @@ const MobileHeader = (props: Props) => {
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"}
</span>
</div>
<div className="flex flex-row justify-end items-center">{children}</div>
Expand Down

0 comments on commit ea394d8

Please sign in to comment.