-
Notifications
You must be signed in to change notification settings - Fork 3
feat: header with link #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b8a77cc
feat: specified commercial transaction (#71)
maito1201 31726a5
feat: header with link
maito1201 dafc492
refactoring
maito1201 d8b15f2
Update src/components/molecules/HeaderMenu/index.tsx
maito1201 e1f8d04
Update src/components/molecules/HeaderMenu/index.tsx
maito1201 fa70293
Update src/components/molecules/HeaderMenu/index.tsx
maito1201 6c236c5
Update src/styles/theme.ts
maito1201 deac456
Update src/components/molecules/HeaderMenu/index.tsx
maito1201 76515a6
Update src/components/modals/ModalHeaderMenu/index.tsx
maito1201 b1551c2
Update src/components/modals/ModalHeaderMenu/index.tsx
maito1201 82a8106
fix build
maito1201 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { Box, Modal, Slide, ButtonBase, Typography, IconButton } from '@mui/material' | ||
import CloseIcon from '@mui/icons-material/Close' | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
import { Logo } from 'src/components/atoms' | ||
import { Colors } from 'src/styles/color' | ||
import { HeaderMenuItem } from 'src/components/organisms/Header' | ||
|
||
export interface ModalHeaderMenuProps { | ||
open: boolean | ||
onClose: () => void | ||
menuList: HeaderMenuItem[] | ||
} | ||
|
||
export const ModalHeaderMenu = ({ open, onClose, menuList }: ModalHeaderMenuProps) => { | ||
const router = useRouter() | ||
|
||
return ( | ||
<Modal open={open} onClose={onClose} sx={{ display: 'flex', zIndex: 9999, bottom: 'auto' }}> | ||
<Slide in={open} direction="down"> | ||
<Box | ||
width={1} | ||
pt="12px" | ||
pb="24px" | ||
px="16px" | ||
color={Colors.text.white} | ||
sx={{ background: Colors.background.brand_color }} | ||
display="flex" | ||
flexDirection="column" | ||
> | ||
<Box display="flex" alignItems="center" justifyContent="space-between" width={1} mb="16px"> | ||
<Box> | ||
<Logo | ||
sx={{ | ||
width: '140px', | ||
height: '24px', | ||
color: Colors.text.white | ||
}} | ||
/> | ||
</Box> | ||
<IconButton color="inherit" onClick={onClose}> | ||
<CloseIcon fontSize="large" /> | ||
</IconButton> | ||
</Box> | ||
<Box | ||
display="flex" | ||
flex={1} | ||
gap="16px" | ||
flexDirection="column" | ||
alignItems="center" | ||
justifyContent="space-between" | ||
> | ||
{menuList.map((list, i) => { | ||
return ( | ||
<Link key={i} href={list.href || router.asPath}> | ||
<a> | ||
<Box | ||
sx={{ | ||
cursor: 'pointer', | ||
boxSizing: 'border-box', | ||
color: Colors.text.white, | ||
textDecoration: 'none', | ||
borderBottom: router.pathname === list.href ? '3px solid' : '' | ||
}} | ||
> | ||
{list.onClick ? ( | ||
<ButtonBase onClick={list.onClick}> | ||
<Typography variant="body1" color="inherit" sx={{ textAlign: 'left' }}> | ||
{list.label} | ||
</Typography> | ||
</ButtonBase> | ||
) : ( | ||
<Typography variant="body1" color="inherit" sx={{ textAlign: 'left' }}> | ||
{list.label} | ||
</Typography> | ||
)} | ||
</Box> | ||
</a> | ||
</Link> | ||
) | ||
})} | ||
</Box> | ||
</Box> | ||
</Slide> | ||
</Modal> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react' | ||
import { Typography, Box } from '@mui/material' | ||
import Link from 'next/link' | ||
import { useRouter } from 'next/router' | ||
import { HeaderItemColor, HeaderMenuItem, HeaderItemBehaviorStyles } from 'src/components/organisms/Header' | ||
|
||
export interface HeaderMenuProps { | ||
menuList: HeaderMenuItem[] | ||
itemColor: HeaderItemColor | ||
itemBehaviorStyles: HeaderItemBehaviorStyles | ||
} | ||
|
||
export const HeaderMenu = ({ menuList, itemColor, itemBehaviorStyles }: HeaderMenuProps) => { | ||
const router = useRouter() | ||
|
||
return ( | ||
<Box sx={{ display: 'flex', gap: '8px', margin: '0 24px 0 auto' }}> | ||
{menuList.map((list, i) => { | ||
return list.href ? ( | ||
<Link href={list.href} key={i}> | ||
<a> | ||
<Typography | ||
sx={{ | ||
borderBottom: router.pathname === list.href ? '3px solid' : '', | ||
color: itemColor.default, | ||
p: '4px 8px', | ||
...itemBehaviorStyles | ||
}} | ||
> | ||
{list.label} | ||
</Typography> | ||
</a> | ||
</Link> | ||
) : ( | ||
<Typography | ||
onClick={list.onClick} | ||
sx={{ | ||
color: itemColor.default, | ||
p: '4px 8px', | ||
...itemBehaviorStyles | ||
}} | ||
> | ||
{list.label} | ||
</Typography> | ||
) | ||
})} | ||
</Box> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import i18n from 'src/i18n/configs' | ||
|
||
export const handleChangeLanguage = () => { | ||
switch (i18n.language) { | ||
case 'ja': | ||
i18n.changeLanguage('en') | ||
return | ||
case 'en': | ||
i18n.changeLanguage('ja') | ||
return | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PageTop } from 'src/components/pages' | ||
|
||
type InitialProps = {} | ||
type Props = {} & InitialProps | ||
|
||
const Index = (_: Props) => { | ||
/* TODO: 各ページの実装 */ | ||
return <PageTop /> | ||
} | ||
|
||
export default Index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PageTop } from 'src/components/pages' | ||
|
||
type InitialProps = {} | ||
type Props = {} & InitialProps | ||
|
||
const Index = (_: Props) => { | ||
/* TODO: 各ページの実装 */ | ||
return <PageTop /> | ||
} | ||
|
||
export default Index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { PageTop } from 'src/components/pages' | ||
|
||
type InitialProps = {} | ||
type Props = {} & InitialProps | ||
|
||
const Index = (_: Props) => { | ||
/* TODO: 各ページの実装 */ | ||
return <PageTop /> | ||
} | ||
|
||
export default Index |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.