-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ebe81d
commit 5bc45b2
Showing
34 changed files
with
89 additions
and
295 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
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/styles'; | ||
import Popover from '@material-ui/core/Popover'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Button from '@material-ui/core/Button'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
typography: { | ||
padding: theme.spacing(2), | ||
}, | ||
})); | ||
|
||
function SimplePopover() { | ||
const classes = useStyles(); | ||
const [anchorEl, setAnchorEl] = React.useState(null); | ||
|
||
function handleClick(event) { | ||
setAnchorEl(event.currentTarget); | ||
} | ||
|
||
function handleClose() { | ||
setAnchorEl(null); | ||
} | ||
|
||
const open = Boolean(anchorEl); | ||
const id = open ? 'simple-popover' : null; | ||
|
||
return ( | ||
<div> | ||
<Button aria-describedby={id} variant="contained" onClick={handleClick}> | ||
Open Popover | ||
</Button> | ||
<Popover | ||
id={id} | ||
open={open} | ||
anchorEl={anchorEl} | ||
onClose={handleClose} | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'center', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center', | ||
}} | ||
> | ||
<Typography className={classes.typography}>The content of the Popover.</Typography> | ||
</Popover> | ||
</div> | ||
); | ||
} | ||
|
||
export default SimplePopover; |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.