File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 1- import useCurrentUser from "@/hooks/useCurrentUser" ;
2- import useNavigateTo from "@/hooks/useNavigateTo" ;
3- import { Routes } from "@/router" ;
41import { workspaceStore } from "@/store/v2" ;
52import { cn } from "@/utils" ;
63import UserAvatar from "./UserAvatar" ;
@@ -12,18 +9,13 @@ interface Props {
129
1310const BrandBanner = ( props : Props ) => {
1411 const { collapsed } = props ;
15- const navigateTo = useNavigateTo ( ) ;
16- const currentUser = useCurrentUser ( ) ;
1712 const workspaceGeneralSetting = workspaceStore . state . generalSetting ;
1813 const title = workspaceGeneralSetting . customProfile ?. title || "Memos" ;
1914 const avatarUrl = workspaceGeneralSetting . customProfile ?. logoUrl || "/full-logo.webp" ;
2015
2116 return (
2217 < div className = { cn ( "relative w-full h-auto shrink-0" , props . className ) } >
23- < div
24- className = { cn ( "w-auto flex flex-row justify-start items-center text-gray-800 dark:text-gray-400" , collapsed ? "px-1" : "px-3" ) }
25- onClick = { ( ) => navigateTo ( currentUser ? Routes . ROOT : Routes . EXPLORE ) }
26- >
18+ < div className = { cn ( "w-auto flex flex-row justify-start items-center text-gray-800 dark:text-gray-400" , collapsed ? "px-1" : "px-3" ) } >
2719 < UserAvatar className = "shrink-0" avatarUrl = { avatarUrl } />
2820 { ! collapsed && < span className = "ml-2 text-lg font-medium text-slate-800 dark:text-gray-300 shrink truncate" > { title } </ span > }
2921 </ div >
Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ const Navigation = observer((props: Props) => {
8080 ) }
8181 >
8282 < div className = "w-full px-1 py-1 flex flex-col justify-start items-start space-y-2 overflow-auto hide-scrollbar shrink" >
83- < BrandBanner className = "mb-2" collapsed = { collapsed } />
83+ < NavLink className = "mb-2" to = { currentUser ? Routes . ROOT : Routes . EXPLORE } >
84+ < BrandBanner collapsed = { collapsed } />
85+ </ NavLink >
8486 { navLinks . map ( ( navLink ) => (
8587 < NavLink
8688 className = { ( { isActive } ) =>
You can’t perform that action at this time.
0 commit comments