ens-usernames/app/components/ens/EditOptions.js

73 lines
2.2 KiB
JavaScript
Raw Normal View History

2018-08-16 22:06:37 +00:00
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
2018-09-27 20:32:06 +00:00
import ListItemIcon from '@material-ui/core/ListItemIcon';
2018-08-16 22:06:37 +00:00
import ListItemText from '@material-ui/core/ListItemText';
import DialogTitle from '@material-ui/core/DialogTitle';
import Dialog from '@material-ui/core/Dialog';
import PersonIcon from '@material-ui/icons/Person';
import EditIcon from '@material-ui/icons/Edit';
import DeleteOutline from '@material-ui/icons/Delete';
import Typography from '@material-ui/core/Typography';
import blue from '@material-ui/core/colors/blue';
const styles = {
2018-09-27 20:32:06 +00:00
paper: {
margin: 0,
maxWidth: '100%',
borderRadius: '6px 6px 0 0',
},
2018-08-16 22:06:37 +00:00
list: {
width: '100%',
position: 'absolute',
bottom: 0,
margin: 0
}
};
class SimpleDialog extends React.Component {
handleClose = () => {
this.props.onClose(this.props.selectedValue);
};
handleListItemClick = value => {
this.props.onClose(value);
};
render() {
const { classes, onClose, selectedValue, canBeReleased, ...other } = this.props;
2018-08-16 22:06:37 +00:00
return (
2018-09-27 20:32:06 +00:00
<Dialog classes={{paper: classes.paper,}} onClose={this.handleClose} fullWidth paperFullWidth style={{alignItems: 'flex-end'}} aria-labelledby="simple-dialog-title" {...other}>
2018-08-16 22:06:37 +00:00
<List>
<ListItem button onClick={() => this.handleListItemClick('edit')} key="edit">
2018-09-27 20:32:06 +00:00
<ListItemIcon>
2018-08-16 22:06:37 +00:00
<EditIcon />
2018-09-27 20:32:06 +00:00
</ListItemIcon>
2018-08-16 22:06:37 +00:00
<ListItemText primary="Edit Contact Code" />
</ListItem>
{canBeReleased && <ListItem button onClick={() => this.handleListItemClick('release')}>
2018-09-27 20:32:06 +00:00
<ListItemIcon>
2018-08-16 22:06:37 +00:00
<DeleteOutline />
2018-09-27 20:32:06 +00:00
</ListItemIcon>
2018-08-16 22:06:37 +00:00
<ListItemText primary="Release Name" />
</ListItem>}
2018-08-16 22:06:37 +00:00
</List>
</Dialog>
);
}
}
SimpleDialog.propTypes = {
classes: PropTypes.object.isRequired,
onClose: PropTypes.func,
selectedValue: PropTypes.string,
};
const SimpleDialogWrapped = withStyles(styles)(SimpleDialog);
export default SimpleDialogWrapped;