56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
import React from 'react';
|
|
import Button from 'material-ui/Button';
|
|
import TextField from 'material-ui/TextField';
|
|
import Dialog, {
|
|
DialogActions,
|
|
DialogContent,
|
|
DialogContentText,
|
|
DialogTitle,
|
|
} from 'material-ui/Dialog';
|
|
|
|
export default class FormDialog extends React.Component {
|
|
state = {
|
|
open: false,
|
|
};
|
|
|
|
handleClickOpen = () => {
|
|
this.setState({ open: true });
|
|
};
|
|
|
|
handleRequestClose = () => {
|
|
this.setState({ open: false });
|
|
};
|
|
|
|
render() {
|
|
return (
|
|
<div>
|
|
<Button onClick={this.handleClickOpen}>Open form dialog</Button>
|
|
<Dialog open={this.state.open} onRequestClose={this.handleRequestClose}>
|
|
<DialogTitle>Subscribe</DialogTitle>
|
|
<DialogContent>
|
|
<DialogContentText>
|
|
To subscribe to this website, please enter your email address here. We will send
|
|
updates occationally.
|
|
</DialogContentText>
|
|
<TextField
|
|
autoFocus
|
|
margin="dense"
|
|
id="name"
|
|
label="Email Address"
|
|
type="email"
|
|
fullWidth
|
|
/>
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<Button onClick={this.handleRequestClose} color="primary">
|
|
Cancel
|
|
</Button>
|
|
<Button onClick={this.handleRequestClose} color="primary">
|
|
Subscribe
|
|
</Button>
|
|
</DialogActions>
|
|
</Dialog>
|
|
</div>
|
|
);
|
|
}
|
|
} |