-
-
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.
Merge branch 'master' into feat/rtg-strict
- Loading branch information
Showing
1,417 changed files
with
2,367 additions
and
2,200 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 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React from 'react'; | ||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | ||
import Typography from '@material-ui/core/Typography'; | ||
import Modal from '@material-ui/core/Modal'; | ||
import Button from '@material-ui/core/Button'; | ||
|
||
function rand() { | ||
return Math.round(Math.random() * 20) - 10; | ||
} | ||
|
||
function getModalStyle() { | ||
const top = 50 + rand(); | ||
const left = 50 + rand(); | ||
|
||
return { | ||
top: `${top}%`, | ||
left: `${left}%`, | ||
transform: `translate(-${top}%, -${left}%)`, | ||
}; | ||
} | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
paper: { | ||
position: 'absolute', | ||
width: 400, | ||
backgroundColor: theme.palette.background.paper, | ||
boxShadow: theme.shadows[5], | ||
padding: theme.spacing(4), | ||
outline: 'none', | ||
}, | ||
}), | ||
); | ||
|
||
export default function SimpleModal() { | ||
const [open, setOpen] = React.useState(false); | ||
// getModalStyle is not a pure function, we roll the style only on the first render | ||
const [modalStyle] = React.useState(getModalStyle); | ||
|
||
const handleOpen = () => { | ||
setOpen(true); | ||
}; | ||
|
||
const handleClose = () => { | ||
setOpen(false); | ||
}; | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<div> | ||
<Typography gutterBottom>Click to get the full Modal experience!</Typography> | ||
<Button onClick={handleOpen}>Open Modal</Button> | ||
<Modal | ||
aria-labelledby="simple-modal-title" | ||
aria-describedby="simple-modal-description" | ||
open={open} | ||
onClose={handleClose} | ||
> | ||
<div style={modalStyle} className={classes.paper}> | ||
<Typography variant="h6" id="modal-title"> | ||
Text in a modal | ||
</Typography> | ||
<Typography variant="subtitle1" id="simple-modal-description"> | ||
Duis mollis, est non commodo luctus, nisi erat porttitor ligula. | ||
</Typography> | ||
<SimpleModal /> | ||
</div> | ||
</Modal> | ||
</div> | ||
); | ||
} |
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
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
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
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.