Skip to content

Commit d39df28

Browse files
chore: Temporarily change links of Header to the links to HTML pages build by Sessionize (#173)
* chore: Remove `next/link` temporary for forwarding to HTML pages build by Sessionize * chore: Temporarily change links of Header to the links to HTML pages build by Sessionize * fix(HeaderMenu): Use `next/link` when href is `/`
1 parent adf00da commit d39df28

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

src/components/molecules/HeaderMenu/index.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react'
22
import { Typography, Box } from '@mui/material'
3-
import Link from 'next/link'
43
import { useRouter } from 'next/router'
54
import { HeaderItemColor, HeaderMenuItem, HeaderItemBehaviorStyles } from 'src/components/organisms/Header'
5+
import Link from 'next/link'
66

77
export interface HeaderMenuProps {
88
menuList: HeaderMenuItem[]
@@ -17,8 +17,24 @@ export const HeaderMenu = ({ menuList, itemColor, itemBehaviorStyles }: HeaderMe
1717
<Box sx={{ display: 'flex', gap: '8px', margin: '0 24px 0 auto' }}>
1818
{menuList.map((list, i) => {
1919
return list.href ? (
20-
<Link href={list.href} key={i}>
21-
<a>
20+
list.href === '/' ? (
21+
<Link href={list.href} key={i}>
22+
<a>
23+
<Typography
24+
sx={{
25+
borderBottom: router.pathname === list.href ? '3px solid' : '',
26+
color: itemColor.default,
27+
p: '4px 8px',
28+
...itemBehaviorStyles
29+
}}
30+
>
31+
{list.label}
32+
</Typography>
33+
</a>
34+
</Link>
35+
) : (
36+
// TODO(taigakiyokawa): Revert using `next/link` when pages have implemented.
37+
<a href={list.href} target="_blank" rel="noreferrer" key={i}>
2238
<Typography
2339
sx={{
2440
borderBottom: router.pathname === list.href ? '3px solid' : '',
@@ -30,7 +46,7 @@ export const HeaderMenu = ({ menuList, itemColor, itemBehaviorStyles }: HeaderMe
3046
{list.label}
3147
</Typography>
3248
</a>
33-
</Link>
49+
)
3450
) : (
3551
<Typography
3652
onClick={list.onClick}

src/components/organisms/Header/index.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,12 @@ export const Header = () => {
5555
const menuList: HeaderMenuItem[] = useMemo(() => {
5656
return [
5757
{ href: '/', label: 'Home' },
58-
{ href: '/sessions', label: 'Sessions' },
59-
{ href: '/timetable', label: 'Timetable' },
60-
{ href: '/floor_guide', label: 'Floor Guide' },
58+
// TODO(taigakiyokawa): Revert to `/sessions` when the page has implemented.
59+
{ href: 'https://sessionize.com/api/v2/jmtn42ls/view/Sessions', label: 'Sessions' },
60+
// TODO(taigakiyokawa): Revert to `/timetable` when the page has implemented.
61+
{ href: 'https://sessionize.com/api/v2/jmtn42ls/view/GridSmart', label: 'Timetable' },
62+
// TODO(taigakiyokawa): Revert comment out when the page has implemented.
63+
// { href: '/floor_guide', label: 'Floor Guide' },
6164
{
6265
label: t('change_language'),
6366
onClick: handleChangeLanguage

0 commit comments

Comments
 (0)