-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
c377e61
commit 58520f8
Showing
4 changed files
with
125 additions
and
11 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,89 @@ | ||
import React from 'react'; | ||
import Button from '@material-ui/core/Button'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogContentText from '@material-ui/core/DialogContentText'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
|
||
class ScrollDialog extends React.Component { | ||
state = { | ||
open: false, | ||
scroll: 'paper', | ||
}; | ||
|
||
handleClickOpen = scroll => () => { | ||
this.setState({ open: true, scroll }); | ||
}; | ||
|
||
handleClose = () => { | ||
this.setState({ open: false }); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<Button onClick={this.handleClickOpen('paper')}>scroll=paper</Button> | ||
<Button onClick={this.handleClickOpen('body')}>scroll=body</Button> | ||
<Dialog | ||
open={this.state.open} | ||
onClose={this.handleClose} | ||
scroll={this.state.scroll} | ||
aria-labelledby="scroll-dialog-title" | ||
> | ||
<DialogTitle id="scroll-dialog-title">Subscribe</DialogTitle> | ||
<DialogContent> | ||
<DialogContentText> | ||
Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac | ||
facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum | ||
at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus | ||
sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum | ||
nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur | ||
et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Cras | ||
mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, | ||
egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis | ||
lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla | ||
sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. | ||
Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis | ||
consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, | ||
egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis | ||
lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla | ||
sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. | ||
Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis | ||
consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, | ||
egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis | ||
lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla | ||
sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. | ||
Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis | ||
consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, | ||
egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis | ||
lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla | ||
sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. | ||
Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis | ||
consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, | ||
egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. | ||
Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis | ||
lacus vel augue laoreet rutrum faucibus dolor auctor. Aenean lacinia bibendum nulla | ||
sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. | ||
Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla. | ||
</DialogContentText> | ||
</DialogContent> | ||
<DialogActions> | ||
<Button onClick={this.handleClose} color="primary"> | ||
Cancel | ||
</Button> | ||
<Button onClick={this.handleClose} color="primary"> | ||
Subscribe | ||
</Button> | ||
</DialogActions> | ||
</Dialog> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default ScrollDialog; |
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