Skip to content

Commit c3642f8

Browse files
author
Luke Bowerman
authored
docs: Fix broken link and correct Header presentation when site is deployed to folder (#1852)
1 parent f7673ba commit c3642f8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

www/src/components/HeaderContent/HeaderContent.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@ interface HeaderProps extends ThemeEditorProps {
3939
toggleNavigation: () => void
4040
}
4141

42+
const isDev = process.env.NODE_ENV === 'development'
43+
4244
export const HeaderContentLayout: FC<HeaderProps> = ({
4345
className,
4446
toggleNavigation,
4547
updateTheme,
4648
hasCustomTheme,
4749
}) => {
48-
const location = useLocation()
49-
const currentPath = location.pathname
50+
const { pathname } = useLocation()
51+
const showHamburger =
52+
pathname.substring(1).split('/').length < (isDev ? 2 : 4)
5053

5154
const data = useStaticQuery(graphql`
5255
query HeaderNav {
@@ -73,7 +76,7 @@ export const HeaderContentLayout: FC<HeaderProps> = ({
7376
height="100%"
7477
>
7578
<Space>
76-
{currentPath === '/' ? (
79+
{showHamburger ? (
7780
<span />
7881
) : (
7982
<IconButton

www/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const Intro = () => {
9797
Install
9898
</Heading>
9999
<Paragraph fontSize="small">
100-
Visit the <Link href="/develop/">Develop</Link> page for
100+
Visit the <Link to="develop">Develop</Link> page for
101101
instructions on installing{' '}
102102
<Code fontSize="small">@looker/components</Code>
103103
</Paragraph>

0 commit comments

Comments
 (0)