aboutsummaryrefslogtreecommitdiff
path: root/src/components/ModalScreen
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-08 12:58:45 +0300
committereug-vs <eug-vs@keemail.me>2020-10-08 12:58:45 +0300
commit0397903b9046e062fc6adb367183e2169bd4b4b6 (patch)
tree1c1dc32a8ad1299e278195d07d2f546c20bb871d /src/components/ModalScreen
parentd2146a79fb059cb41d03b16f799f89cbaf1c6312 (diff)
downloadwhich-ui-0397903b9046e062fc6adb367183e2169bd4b4b6.tar.gz
feat: return UserStrip to PollCreation
Diffstat (limited to 'src/components/ModalScreen')
-rw-r--r--src/components/ModalScreen/ModalScreen.tsx46
1 files changed, 36 insertions, 10 deletions
diff --git a/src/components/ModalScreen/ModalScreen.tsx b/src/components/ModalScreen/ModalScreen.tsx
index 6b7c52c..6ffc978 100644
--- a/src/components/ModalScreen/ModalScreen.tsx
+++ b/src/components/ModalScreen/ModalScreen.tsx
@@ -1,20 +1,36 @@
import React, { useCallback } from 'react';
import { useHistory } from 'react-router-dom';
import {
+ AppBar,
Dialog,
Toolbar,
Typography,
IconButton,
+ Divider,
useMediaQuery,
useTheme
} from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
import CloseIcon from '@material-ui/icons/Close';
interface PropTypes {
title: string;
}
+const useStyles = makeStyles(theme => ({
+ root: {
+ backgroundColor: theme.palette.background.default
+ },
+ content: {
+ padding: theme.spacing(3, 0, 0, 0)
+ },
+ toolbar: {
+ display: 'flex',
+ }
+}));
+
const ModalScreen: React.FC<PropTypes> = ({ title, children }) => {
+ const classes = useStyles();
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
const history = useHistory();
@@ -22,16 +38,26 @@ const ModalScreen: React.FC<PropTypes> = ({ title, children }) => {
const handleClose = useCallback(() => history.goBack(), [history]);
return (
- <Dialog fullScreen={isMobile} fullWidth open>
- <Toolbar color="primary">
- <IconButton edge="start" onClick={handleClose}>
- <CloseIcon />
- </IconButton>
- <Typography variant="h6">
- { title }
- </Typography>
- </Toolbar>
- { children }
+ <Dialog
+ open
+ PaperProps={{ className: classes.root }}
+ fullScreen={isMobile}
+ fullWidth
+ >
+ <AppBar position="static">
+ <Toolbar className={classes.toolbar}>
+ <IconButton edge="start" onClick={handleClose}>
+ <CloseIcon />
+ </IconButton>
+ <Typography variant="h6">
+ { title }
+ </Typography>
+ </Toolbar>
+ </AppBar>
+ <Divider />
+ <div className={classes.content}>
+ { children }
+ </div>
</Dialog>
);
};