11import React from 'react' ;
22import './header.scss' ;
3- import { NavLink } from 'react-router-dom' ;
3+ import { NavLink , useLocation } from 'react-router-dom' ;
44import pkg from '../../../../../packages/react/package.json' ;
55import { Link } from '@tiny-design/react' ;
66import { IconGithub } from '@tiny-design/icons' ;
@@ -15,14 +15,17 @@ const { version, repository } = pkg;
1515export const Header = ( ) : React . ReactElement => {
1616 const { toggle } = useSidebarToggle ( ) ;
1717 const { siteLocale : s } = useLocaleContext ( ) ;
18+ const { pathname } = useLocation ( ) ;
19+ const isHome = pathname === '/' ;
1820
1921 return (
2022 < header className = "header" >
2123 < div className = "header__left" >
2224 < button
2325 className = "header__menu-toggle"
2426 onClick = { toggle }
25- aria-label = "Toggle menu" >
27+ aria-label = "Toggle menu"
28+ style = { isHome ? { display : 'none' } : undefined } >
2629 < svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" strokeWidth = "2" >
2730 < line x1 = "3" y1 = "6" x2 = "21" y2 = "6" />
2831 < line x1 = "3" y1 = "12" x2 = "21" y2 = "12" />
@@ -38,7 +41,7 @@ export const Header = (): React.ReactElement => {
3841 </ div >
3942 < nav className = "header__nav" >
4043 < ul className = "header__nav-list" >
41- < li className = "header__nav-item" >
44+ < li className = "header__nav-item header__home-link " >
4245 < NavLink end to = "/" className = "header__link" >
4346 { s . nav . home }
4447 </ NavLink >
@@ -67,7 +70,7 @@ export const Header = (): React.ReactElement => {
6770 < span className = "header__version" > v{ version } </ span >
6871 </ a >
6972 </ li >
70- < li className = "header__nav-item" >
73+ < li className = "header__nav-item header__github-link " >
7174 < Link href = { repository . url } underline = { false } rel = "noreferrer noopener" >
7275 < IconGithub color = "currentColor" size = { 19 } />
7376 </ Link >
0 commit comments