UNPKG

@rnga/orders

Version:

## Get schema from @prisma-cms 1. yarn get-api-schema -e http://localhost:4000 2. yarn build-api-fragments

92 lines (76 loc) 1.95 kB
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Dialog, { DialogActions, DialogContent, DialogContentText, DialogTitle } from "material-ui/Dialog"; import AppBar from "material-ui/AppBar"; import CloseIcon from "material-ui-icons/Close"; import { withStyles, Typography, IconButton, Toolbar } from 'material-ui'; const styles = theme => ({ badge: { margin: theme.spacing.unit * 2, }, padding: { padding: `0 ${theme.spacing.unit * 1.5}px`, }, appBar: { position: 'relative', }, flex: { flex: 1, }, title: { marginLeft: 20, }, content: { // padding: "20px 0", padding: 0, height: "100%", // border: "1px solid red", }, }); class UiDialog extends Component { static propTypes = { classes: PropTypes.object.isRequired, title: PropTypes.string.isRequired, handleClose: PropTypes.func.isRequired, actions: PropTypes.array, }; render() { const { classes, title, children, handleClose, actions, ...other } = this.props; return ( <Dialog fullScreen open={true} onClose={() => { }} aria-labelledby="responsive-dialog-title" {...other} > <AppBar className={classes.appBar}> <Toolbar> <Typography variant="title" color="inherit" className={[classes.flex, classes.title].join(" ")}> {title} </Typography> <IconButton color="inherit" onClick={handleClose} aria-label="Close"> <CloseIcon /> </IconButton> </Toolbar> </AppBar> <DialogContent className={classes.content} > {children} </DialogContent> {actions && actions.length ? <DialogActions> {actions} </DialogActions> : null} </Dialog> ); } } export default withStyles(styles)(UiDialog);