mirror of
https://github.com/graphql-hive/console
synced 2026-05-24 01:28:32 +00:00
fix hive logo click, should redirect to current org (#107)
Co-authored-by: Kamil Kisiela <kamil.kisiela@gmail.com>
This commit is contained in:
parent
6c5f8bc12e
commit
18b77d090f
1 changed files with 11 additions and 1 deletions
|
|
@ -3,10 +3,20 @@ import NextLink from 'next/link';
|
|||
import clsx from 'clsx';
|
||||
|
||||
import { HiveLogo } from '@/components/v2/icon';
|
||||
import { useRouteSelector } from '@/lib/hooks/use-route-selector';
|
||||
|
||||
export const HiveLink = ({ className }: { className?: string }): ReactElement => {
|
||||
const router = useRouteSelector();
|
||||
const orgId = router.organizationId;
|
||||
|
||||
return (
|
||||
<NextLink href="/" passHref>
|
||||
<NextLink
|
||||
href={
|
||||
// orgId can be undefined on /404 route
|
||||
orgId ? `/${orgId}` : '/'
|
||||
}
|
||||
passHref
|
||||
>
|
||||
<a className={clsx('inline-flex items-center focus:ring', className)}>
|
||||
<HiveLogo />
|
||||
<div className="ml-2.5">
|
||||
|
|
|
|||
Loading…
Reference in a new issue