Skip to content

Commit 27a9156

Browse files
committed
simplify hash check
1 parent c6c4582 commit 27a9156

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/components/Banner.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@ interface BannerProps {
88
}
99

1010
const Banner = ({ href }: BannerProps): React.ReactElement => {
11-
const isTestRoute =
12-
typeof window !== "undefined" && window.location.hash === "#/test";
13-
const LogoComponent = isTestRoute
14-
? InstructureBugColor
15-
: InstructureBugClassic;
11+
const LogoComponent =
12+
window?.location?.hash === "#/test"
13+
? InstructureBugColor
14+
: InstructureBugClassic;
1615

1716
return (
18-
<View as="div" borderRadius="medium" overflowX="hidden" overflowY="hidden">
19-
<View as="div" className="logoWrapper" padding="medium">
17+
<View as="div" borderRadius="medium">
18+
<View
19+
as="div"
20+
className="logoWrapper"
21+
overflowY="hidden"
22+
padding="medium"
23+
>
2024
{href ? (
21-
<Link href={href}>
22-
<Heading as="h1" level="h1">
25+
<Heading level="h1">
26+
<Link href={href}>
2327
<LogoComponent />
24-
</Heading>
25-
</Link>
28+
</Link>
29+
</Heading>
2630
) : (
2731
<LogoComponent />
2832
)}

0 commit comments

Comments
 (0)