feat: menu

This commit is contained in:
EleanorMao 2023-05-01 21:26:45 +08:00
parent 1931dbd152
commit 208a0ec475
3 changed files with 15 additions and 1 deletions

View File

@ -4,13 +4,14 @@ import {
StyledActivateButton, StyledBackground, StyledCloseIcon, StyledCopyright, StyledExtraContent, StyledActivateButton, StyledBackground, StyledCloseIcon, StyledCopyright, StyledExtraContent,
StyledIcon, StyledIcon,
StyledMenuContainer, StyledMenuContainer,
StyledMenuItem, StyledMenuItem, StyledNextIcon,
StyledPlainMenuContainer, StyledPlainMenuItem StyledPlainMenuContainer, StyledPlainMenuItem
} from './styled' } from './styled'
import { Paths } from 'routes/Paths' import { Paths } from 'routes/Paths'
import { menuConfig } from 'routes/menuConfig' import { menuConfig } from 'routes/menuConfig'
import { Text } from '../Typography' import { Text } from '../Typography'
import { ReactComponent as CloseSvg } from 'icons/close.svg' import { ReactComponent as CloseSvg } from 'icons/close.svg'
import { ReactComponent as CaretRightSvg } from 'icons/caretRight.svg'
export interface MenuProps { export interface MenuProps {
onClose: () => void onClose: () => void
@ -47,6 +48,7 @@ export const Menu: FC<MenuProps> = ({ onLogout, onClose }) => {
rel={item.target === '_blank' ? "noopener noreferrer" : undefined}> rel={item.target === '_blank' ? "noopener noreferrer" : undefined}>
<StyledIcon component={item.icon} /> <StyledIcon component={item.icon} />
{item.title} {item.title}
<StyledNextIcon component={CaretRightSvg} />
</StyledPlainMenuItem> </StyledPlainMenuItem>
))} ))}
<StyledExtraContent> <StyledExtraContent>

View File

@ -105,3 +105,12 @@ export const StyledPlainMenuItem = styled(NavLink)`
color: ${props => props.theme.brandPrimary}; color: ${props => props.theme.brandPrimary};
} }
` `
export const StyledNextIcon = styled(Icon)`
width: 9px;
height: 14px;
position: absolute;
right: 24px;
top: 50%;
transform: translate3d(0, -50%, 0);
`

3
src/icons/caretRight.svg Normal file
View File

@ -0,0 +1,3 @@
<svg width="9" height="14" viewBox="0 0 9 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.05806 0.308058C1.30214 0.0639806 1.69786 0.0639806 1.94194 0.308058L8.19194 6.55806C8.43602 6.80214 8.43602 7.19786 8.19194 7.44194L1.94194 13.6919C1.69786 13.936 1.30214 13.936 1.05806 13.6919C0.813981 13.4479 0.813981 13.0521 1.05806 12.8081L6.86612 7L1.05806 1.19194C0.813981 0.947864 0.813981 0.552136 1.05806 0.308058Z" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 500 B