Skip to content

Commit e5c8348

Browse files
authored
chore: logo 클릭 시 query 유지 (#545)
* chore: logo 클릭 시 query * chore: code-review
1 parent d6b29d2 commit e5c8348

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/spectator/src/components/layout/header.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Link from 'next/link';
77
import { useParams, useRouter } from 'next/navigation';
88

99
import { routes } from '~/constants/routes';
10+
import { useOrganizationId } from '~/hooks/useOrganizationId';
1011
import { normalizeSportParam } from '~/utils/sport-route';
1112

1213
type Props = {
@@ -21,6 +22,9 @@ export const Header = ({ arrow, center, menu }: Props) => {
2122
const sportType = normalizeSportParam(params?.sport);
2223
const homeHref = sportType ? routes.home({ sport: sportType }) : routes.root;
2324

25+
const { organizationId } = useOrganizationId();
26+
const homeHrefWithQuery = { pathname: homeHref, query: { organizationId } };
27+
2428
return (
2529
<header className="sticky top-0 z-header h-12 w-full shrink-0 border-b border-neutral-100 bg-white">
2630
<div className="row-between relative h-full w-full px-5">
@@ -36,7 +40,7 @@ export const Header = ({ arrow, center, menu }: Props) => {
3640
</button>
3741
<Link
3842
className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 truncate"
39-
href={homeHref}
43+
href={homeHrefWithQuery}
4044
>
4145
<HCCLogo width="71.5" height="21" className="text-[var(--color-primary-600)]" />
4246
</Link>
@@ -45,7 +49,7 @@ export const Header = ({ arrow, center, menu }: Props) => {
4549
) : (
4650
<>
4751
<div className="center-y gap-4">
48-
<Link className="flex items-end select-none" href={homeHref}>
52+
<Link className="flex items-end select-none" href={homeHrefWithQuery}>
4953
<HCCLogo width="71.5" height="21" className="text-[var(--color-primary-600)]" />
5054
</Link>
5155
{center}

0 commit comments

Comments
 (0)