@ -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 (
< 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"
onDoubleClick = { ( ) = > location . reload ( ) }
>
{ titleText }
{ workspaceGeneralSetting. customProfile ? . title || "Memos" }
< / span >
< / div >
< div className = "flex flex-row justify-end items-center" > { children } < / div >