-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from daodaoedu/feature/2.2_partner_profile
2.2 partner profile / 夥伴資訊
- Loading branch information
Showing
6 changed files
with
446 additions
and
493 deletions.
There are no files selected for viewing
This file contains 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,68 @@ | ||
import { useState } from 'react'; | ||
import styled from '@emotion/styled'; | ||
import { Box, Button, Menu, MenuItem } from '@mui/material'; | ||
import MoreVertRoundedIcon from '@mui/icons-material/MoreVertRounded'; | ||
import Icon from '@mui/material/Icon'; | ||
|
||
const StyledMenu = styled((props) => ( | ||
<Menu | ||
elevation={0} | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'left', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'left', | ||
}} | ||
{...props} | ||
/> | ||
))(() => ({ | ||
'& .MuiPaper-root': { | ||
borderRadius: 8, | ||
minWidth: 150, | ||
padding: '12px', | ||
boxShadow: '0px 4px 10px 0px rgba(196, 194, 193, 0.40)', | ||
}, | ||
'& .MuiMenu-list': { | ||
padding: '0', | ||
}, | ||
'& .MuiMenuItem-root': { | ||
padding: '8px', | ||
}, | ||
})); | ||
|
||
export default function Dropdown({ sx }) { | ||
const [anchorEl, setAnchorEl] = useState(null); | ||
const open = Boolean(anchorEl); | ||
const handleClick = (event) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<Box sx={{ ...sx }}> | ||
<Button | ||
aria-haspopup="true" | ||
aria-expanded={open ? 'true' : undefined} | ||
disableElevation | ||
onClick={handleClick} | ||
sx={{ | ||
color: '#536166', | ||
padding: '5px', | ||
minWidth: 'unset', | ||
borderRadius: '100%', | ||
}} | ||
> | ||
<Icon color="#536166" component={MoreVertRoundedIcon} /> | ||
</Button> | ||
<StyledMenu anchorEl={anchorEl} open={open} onClose={handleClose}> | ||
<MenuItem onClick={handleClose} disableRipple> | ||
檢舉 | ||
</MenuItem> | ||
</StyledMenu> | ||
</Box> | ||
); | ||
} |
Oops, something went wrong.
ca536a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
daodao-f2e – ./
daodao-f2e.vercel.app
daodao-f2e-git-dev-daodaoedu.vercel.app
daodao-f2e-daodaoedu.vercel.app