Skip to content

Instantly share code, notes, and snippets.

@wschenk
Created November 30, 2017 22:55
Show Gist options
  • Save wschenk/252856a5e6bc0a0718dca8da98631a08 to your computer and use it in GitHub Desktop.
Save wschenk/252856a5e6bc0a0718dca8da98631a08 to your computer and use it in GitHub Desktop.
material-ui example login form
import React, {Component} from 'react';
import Button from 'material-ui/Button';
import TextField from 'material-ui/TextField';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
withMobileDialog
} from 'material-ui/Dialog';
class Login extends Component {
render() {
return (
<Dialog
open
onRequestClose={this.props.toggleLogin}
fullScreen={this.props.fullScreen}>
<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.props.toggleLogin} color="primary">
Cancel
</Button>
<Button onClick={this.props.toggleLogin} color="primary">
Subscribe
</Button>
</DialogActions>
</Dialog>
);
}
}
export default withMobileDialog()(Login);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment