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

73 lines
2.1 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Avatar from '@material-ui/core/Avatar';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
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 = {
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, ...other } = this.props;
return (
<Dialog onClose={this.handleClose} aria-labelledby="simple-dialog-title" {...other}>
<List>
<ListItem button onClick={() => this.handleListItemClick('edit')} key="edit">
<ListItemAvatar>
<Avatar>
<EditIcon />
</Avatar>
</ListItemAvatar>
<ListItemText primary="Edit Contact Code" />
</ListItem>
<ListItem button onClick={() => this.handleListItemClick('release')}>
<ListItemAvatar>
<Avatar>
<DeleteOutline />
</Avatar>
</ListItemAvatar>
<ListItemText primary="Release Name" />
</ListItem>
</List>
</Dialog>
);
}
}
SimpleDialog.propTypes = {
classes: PropTypes.object.isRequired,
onClose: PropTypes.func,
selectedValue: PropTypes.string,
};
const SimpleDialogWrapped = withStyles(styles)(SimpleDialog);
export default SimpleDialogWrapped;