-
-
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
43de851
commit d6ea306
Showing
11 changed files
with
166 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import Modal from '@material-ui/core/Modal'; | ||
|
||
const useStyles = makeStyles(theme => ({ | ||
root: { | ||
transform: 'translateZ(0)', | ||
height: 300, | ||
flexGrow: 1, | ||
}, | ||
modal: { | ||
display: 'flex', | ||
padding: theme.spacing(1), | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
paper: { | ||
width: 400, | ||
backgroundColor: theme.palette.background.paper, | ||
border: '2px solid #000', | ||
boxShadow: theme.shadows[5], | ||
padding: theme.spacing(2, 4, 4), | ||
}, | ||
})); | ||
|
||
export default function ServerModal() { | ||
const classes = useStyles(); | ||
const rootRef = React.useRef(null); | ||
|
||
return ( | ||
<div className={classes.root} ref={rootRef}> | ||
<Modal | ||
disablePortal | ||
disableEnforceFocus | ||
disableAutoFocus | ||
open | ||
aria-labelledby="server-modal-title" | ||
aria-describedby="server-modal-description" | ||
className={classes.modal} | ||
container={() => rootRef.current} | ||
> | ||
<div className={classes.paper}> | ||
<h2 id="server-modal-title">Server-side modal</h2> | ||
<p id="server-modal-description"> | ||
You can disable the JavaScript, you will still see me. | ||
</p> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles'; | ||
import Modal from '@material-ui/core/Modal'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
root: { | ||
transform: 'translateZ(0)', | ||
height: 300, | ||
flexGrow: 1, | ||
}, | ||
modal: { | ||
display: 'flex', | ||
padding: theme.spacing(1), | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
paper: { | ||
width: 400, | ||
backgroundColor: theme.palette.background.paper, | ||
border: '2px solid #000', | ||
boxShadow: theme.shadows[5], | ||
padding: theme.spacing(2, 4, 4), | ||
}, | ||
}), | ||
); | ||
|
||
export default function ServerModal() { | ||
const classes = useStyles(); | ||
const rootRef = React.useRef<HTMLDivElement>(null); | ||
|
||
return ( | ||
<div className={classes.root} ref={rootRef}> | ||
<Modal | ||
disablePortal | ||
disableEnforceFocus | ||
disableAutoFocus | ||
open | ||
aria-labelledby="server-modal-title" | ||
aria-describedby="server-modal-description" | ||
className={classes.modal} | ||
container={() => rootRef.current} | ||
> | ||
<div className={classes.paper}> | ||
<h2 id="server-modal-title">Server-side modal</h2> | ||
<p id="server-modal-description"> | ||
You can disable the JavaScript, you will still see me. | ||
</p> | ||
</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
Oops, something went wrong.