Skip to content

Commit

Permalink
refactor(console): click console logo should navigate to root page (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao authored Jun 3, 2024
1 parent a495ab0 commit ac5d846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/console/src/components/Topbar/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
width: auto;
height: 28px;
color: var(--color-text);
cursor: pointer;
}

.line {
Expand Down
9 changes: 8 additions & 1 deletion packages/console/src/components/Topbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 (
<div className={classNames(styles.topbar, className)}>
<LogtoLogo className={styles.logo} />
<LogtoLogo
className={styles.logo}
onClick={() => {
navigate('/');
}}
/>
{isCloud && !hideTenantSelector && <TenantSelector />}
{!isCloud && !hideTitle && (
<>
Expand Down

0 comments on commit ac5d846

Please sign in to comment.