From 70c557f9db91252e55a2b3f1eaba112a50c13804 Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Mon, 3 Jun 2024 19:36:40 +0800 Subject: [PATCH] refactor(console): click console logo should navigate to root page --- packages/console/src/components/Topbar/index.module.scss | 1 + packages/console/src/components/Topbar/index.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/console/src/components/Topbar/index.module.scss b/packages/console/src/components/Topbar/index.module.scss index 583f80fedcf..4946b7d325d 100644 --- a/packages/console/src/components/Topbar/index.module.scss +++ b/packages/console/src/components/Topbar/index.module.scss @@ -11,6 +11,7 @@ width: auto; height: 28px; color: var(--color-text); + cursor: pointer; } .line { diff --git a/packages/console/src/components/Topbar/index.tsx b/packages/console/src/components/Topbar/index.tsx index 3ce52672493..dbce591d586 100644 --- a/packages/console/src/components/Topbar/index.tsx +++ b/packages/console/src/components/Topbar/index.tsx @@ -14,6 +14,7 @@ import DynamicT from '@/ds-components/DynamicT'; import Spacer from '@/ds-components/Spacer'; import TextLink from '@/ds-components/TextLink'; import useDocumentationUrl from '@/hooks/use-documentation-url'; +import useTenantPathname from '@/hooks/use-tenant-pathname'; import { onKeyDownHandler } from '@/utils/a11y'; import ContactModal from './ContactModal'; @@ -32,11 +33,17 @@ type Props = { function Topbar({ className, hideTenantSelector, hideTitle }: Props) { const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); + const { navigate } = useTenantPathname(); const LogtoLogo = isCloud ? CloudLogo : Logo; return (
- + { + navigate('/'); + }} + /> {isCloud && !hideTenantSelector && } {!isCloud && !hideTitle && ( <>