From 3d0d6b200a9fc503348693b8b4a0c7c03421eb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Fri, 30 Jul 2021 22:14:28 +0200 Subject: [PATCH] Create SignalDialog component --- components/jwenn-signal/signal-dialog.js | 92 ++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 components/jwenn-signal/signal-dialog.js diff --git a/components/jwenn-signal/signal-dialog.js b/components/jwenn-signal/signal-dialog.js new file mode 100644 index 0000000..0d7a27d --- /dev/null +++ b/components/jwenn-signal/signal-dialog.js @@ -0,0 +1,92 @@ +import React from 'react' +import Image from 'next/image' +import {useRouter} from 'next/router' +import PropTypes from 'prop-types' +import {withStyles} from '@material-ui/core/styles' +import {Box, Button, Dialog} from '@material-ui/core' +import MuiDialogTitle from '@material-ui/core/DialogTitle' +import MuiDialogContent from '@material-ui/core/DialogContent' +import IconButton from '@material-ui/core/IconButton' +import CloseIcon from '@material-ui/icons/Close' +import Typography from '@material-ui/core/Typography' +import {Signal} from '@icons-pack/react-simple-icons' + +import QRCode from '../../public/signal-qr-code.jpg' + +const signalGourpUrl = process.env.NEXT_PUBLIC_SIGNAL_URL || 'https://signal.org/fr/download/' + +const styles = theme => ({ + root: { + margin: 0, + padding: theme.spacing(2) + }, + closeButton: { + position: 'absolute', + right: theme.spacing(1), + top: theme.spacing(1), + color: theme.palette.grey[500] + } +}) + +const DialogTitle = withStyles(styles)(props => { + const {children, classes, onClose, ...other} = props + return ( + + {children} + {onClose ? ( + + + + ) : null} + + ) +}) + +const DialogContent = withStyles(theme => ({ + root: { + padding: theme.spacing(2) + } +}))(MuiDialogContent) + +export default function SignalDialog({ouve, handleFemen}) { + const router = useRouter() + + const handleClick = () => { + router.push(signalGourpUrl) + } + + return ( +
+ + + Groupe Signal + + + + + + + + + + +
+ ) +} + +SignalDialog.propTypes = { + ouve: PropTypes.bool.isRequired, + handleFemen: PropTypes.func.isRequired +}