Skip to content

Instantly share code, notes, and snippets.

@AtwoodTM
Forked from wschenk/login.js
Created May 20, 2018 01:34
Show Gist options
  • Save AtwoodTM/cb9fb68c872e907dda15b37ce9fa9437 to your computer and use it in GitHub Desktop.
Save AtwoodTM/cb9fb68c872e907dda15b37ce9fa9437 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