mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-26 00:15:23 +00:00
Creation of Gno Modal component
This commit is contained in:
parent
d41a7f7d09
commit
10ffef27d5
46
src/components/Modal/index.jsx
Normal file
46
src/components/Modal/index.jsx
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
// @flow
|
||||||
|
import * as React from 'react'
|
||||||
|
import Modal from '@material-ui/core/Modal'
|
||||||
|
import { withStyles } from '@material-ui/core/styles'
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
title: string,
|
||||||
|
description: string,
|
||||||
|
open: boolean,
|
||||||
|
handleClose: Function,
|
||||||
|
children: React$Node,
|
||||||
|
classes: Object,
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = theme => ({
|
||||||
|
root: {
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
display: 'flex',
|
||||||
|
},
|
||||||
|
paper: {
|
||||||
|
position: 'absolute',
|
||||||
|
width: theme.spacing.unit * 50,
|
||||||
|
backgroundColor: theme.palette.background.paper,
|
||||||
|
boxShadow: theme.shadows[5],
|
||||||
|
padding: theme.spacing.unit * 4,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const GnoModal = ({
|
||||||
|
title, description, open, children, handleClose, classes,
|
||||||
|
}: Props) => (
|
||||||
|
<Modal
|
||||||
|
aria-labelledby={title}
|
||||||
|
aria-describedby={description}
|
||||||
|
open={open}
|
||||||
|
onClose={handleClose}
|
||||||
|
className={classes.root}
|
||||||
|
>
|
||||||
|
<div className={classes.paper}>
|
||||||
|
{ children }
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
)
|
||||||
|
|
||||||
|
export default withStyles(styles)(GnoModal)
|
Loading…
x
Reference in New Issue
Block a user