11import { Typography , Box } from '@mui/material'
22import { useRouter } from 'next/router'
33import { HeaderItemColor , HeaderMenuItem , HeaderItemBehaviorStyles } from 'src/components/organisms/Header'
4- // import Link from 'next/link'
4+ import Link from 'next/link'
55
66export interface HeaderMenuProps {
77 menuList : HeaderMenuItem [ ]
@@ -16,40 +16,35 @@ export const HeaderMenu = ({ menuList, itemColor, itemBehaviorStyles }: HeaderMe
1616 < Box sx = { { display : 'flex' , gap : '8px' , margin : '0 24px 0 auto' } } >
1717 { menuList . map ( ( list , i ) => {
1818 return list . href ? (
19- // TODO(maito1201): Enable this conditional branch when screen transition is implemented.
20- /*
21- list.href === '/' ? (
19+ list . openNewTab ? (
20+ // TODO(taigakiyokawa): Revert using `next/link` when pages have implemented.
21+ < a href = { list . href } target = "_blank" rel = "noreferrer" key = { i } >
22+ < Typography
23+ sx = { {
24+ borderBottom : router . pathname === list . href ? '3px solid' : '' ,
25+ color : itemColor . default ,
26+ p : '4px 8px' ,
27+ ...itemBehaviorStyles
28+ } }
29+ >
30+ { list . label }
31+ </ Typography >
32+ </ a >
33+ ) : (
2234 < Link href = { list . href } key = { i } >
23- <a>
24- <Typography
25- sx={{
26- borderBottom: router.pathname === list.href ? '3px solid' : '',
27- color: itemColor.default,
28- p: '4px 8px',
29- ...itemBehaviorStyles
30- }}
31- >
32- {list.label}
33- </Typography>
34- </a>
35+ < Typography
36+ sx = { {
37+ borderBottom : router . pathname === list . href ? '3px solid' : '' ,
38+ color : itemColor . default ,
39+ p : '4px 8px' ,
40+ ...itemBehaviorStyles
41+ } }
42+ >
43+ { list . label }
44+ </ Typography >
3545 </ Link >
36- ) : (
37- */
38- // TODO(taigakiyokawa): Revert using `next/link` when pages have implemented.
39- < a href = { list . href } target = "_blank" rel = "noreferrer" key = { i } >
40- < Typography
41- sx = { {
42- borderBottom : router . pathname === list . href ? '3px solid' : '' ,
43- color : itemColor . default ,
44- p : '4px 8px' ,
45- ...itemBehaviorStyles
46- } }
47- >
48- { list . label }
49- </ Typography >
50- </ a >
46+ )
5147 ) : (
52- // )
5348 < Typography
5449 onClick = { list . onClick }
5550 sx = { {
0 commit comments