Skip to content

Commit

Permalink
fix: add dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlLiu2023 committed Mar 27, 2023
1 parent 44ae268 commit 475ad09
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions apps/storefront/src/components/B3DropDown.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ListItemButton from '@mui/material/ListItemButton'
import ListItemText from '@mui/material/ListItemText'
import ExpandLess from '@mui/icons-material/ExpandLess'
import ExpandMore from '@mui/icons-material/ExpandMore'
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'
import ArrowDropUpIcon from '@mui/icons-material/ArrowDropUp'
import Menu from '@mui/material/Menu'
import MenuItem from '@mui/material/MenuItem'

Expand Down Expand Up @@ -59,7 +59,7 @@ export const B3DropDown: <T>(props: B3DropDownProps<T>) => ReactElement = ({
onClick={handleClick}
>
<ListItemText primary={title} />
{open ? <ExpandLess /> : <ExpandMore />}
{open ? <ArrowDropUpIcon /> : <ArrowDropDownIcon />}
</ListItemButton>
<Menu
anchorEl={open}
Expand Down
27 changes: 12 additions & 15 deletions apps/storefront/src/components/layout/B3AccountInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ import {
GlobaledContext,
} from '@/shared/global'

// import {
// B3DropDown,
// } from '../B3DropDown'
import {
B3DropDown,
} from '../B3DropDown'

interface ListProps {
[key: string]: string
}

const list: Array<ListProps> = [
// {
// name: 'Account Settings',
// key: '/account-settings',
// type: 'path',
// },
{
name: 'Account Settings',
key: '/account-settings',
type: 'path',
},
{
name: 'Log out',
name: 'Logout',
key: 'logout',
type: 'button',
},
Expand Down Expand Up @@ -107,22 +107,19 @@ export const B3AccountInfo = ({
</Box>
) : (
<Box sx={{
width: '150px',
minWidth: '150px',
display: 'flex',
justifyContent: 'end',
mr: '8px',
fontSize: '16px',
color: '#333333',
}}
>
{ name }
{/* <B3DropDown
<B3DropDown
title={name}
width="150px"
handleItemClick={handleItemClick}
list={list}
/> */}

/>
</Box>
)
}
Expand Down

0 comments on commit 475ad09

Please sign in to comment.