mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: add server name change in mobile header (#4195)
* [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: Николай Витальевич Никоноров <nnv@bitt.moe> Co-authored-by: Johnny <yourselfhosted@gmail.com>
This commit is contained in:
@ -1,7 +1,9 @@
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { useState } from "react";
|
|
||||||
import useWindowScroll from "react-use/lib/useWindowScroll";
|
import useWindowScroll from "react-use/lib/useWindowScroll";
|
||||||
import useResponsiveWidth from "@/hooks/useResponsiveWidth";
|
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";
|
import NavigationDrawer from "./NavigationDrawer";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@ -12,8 +14,10 @@ interface Props {
|
|||||||
const MobileHeader = (props: Props) => {
|
const MobileHeader = (props: Props) => {
|
||||||
const { className, children } = props;
|
const { className, children } = props;
|
||||||
const { sm } = useResponsiveWidth();
|
const { sm } = useResponsiveWidth();
|
||||||
const [titleText] = useState("Memos");
|
|
||||||
const { y: offsetTop } = useWindowScroll();
|
const { y: offsetTop } = useWindowScroll();
|
||||||
|
const workspaceSettingStore = useWorkspaceSettingStore();
|
||||||
|
const workspaceGeneralSetting =
|
||||||
|
workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.GENERAL).generalSetting || WorkspaceGeneralSetting.fromPartial({});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -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"
|
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()}
|
onDoubleClick={() => location.reload()}
|
||||||
>
|
>
|
||||||
{titleText}
|
{workspaceGeneralSetting.customProfile?.title || "Memos"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row justify-end items-center">{children}</div>
|
<div className="flex flex-row justify-end items-center">{children}</div>
|
||||||
|
Reference in New Issue
Block a user