import Typography from '@mui/material/Typography'; import {useTheme} from '@mui/material/styles'; import Icon from '@mui/material/Icon'; import FormControlLabel from '@mui/material/FormControlLabel'; import Checkbox from '@mui/material/Checkbox'; import Button from '@mui/material/Button'; import Box from '@mui/material/Box'; import {useTranslation, Trans} from 'react-i18next'; import {useState} from 'react'; import pageUtils from '../../../lib/pageUtils'; import CommonConfirm from '../../../layouts/ConfirmLayout'; import {useUpdateMeMutation} from '../../../generated/graphql'; import router from 'next/router'; import useSettings from '../../../hooks/useSettings'; import moment from 'moment'; const Confirm = () => { const theme = useTheme(); const {t} = useTranslation(); const settings = useSettings(); const [updateMe] = useUpdateMeMutation(); const [newsletterConsent, setNewsletterConsent] = useState(false); const [tosConsent, setTosConsent] = useState(false); const onSubmit = async () => { const tosAcceptationDate = tosConsent ? moment().toISOString() : null; await updateMe({ variables: {userUpdate: {newsletterConsent, tosAcceptationDate}}, }); router.push('/dashboard'); }; return ( {t('signup.create')} {t('confirm.google.title')} mail setNewsletterConsent(checked) } /> } label={t('signup.newsletter.consent')} /> , 'data-privacy-link': ( ), }} /> } control={ setTosConsent(e.target.checked)} /> } /> ); }; export default Confirm; export const getServerSideProps = pageUtils.getServerSideProps();