From 569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a Mon Sep 17 00:00:00 2001 From: piotrruss Date: Mon, 6 Sep 2021 23:13:22 +0200 Subject: added stadard linter --- pages/verify.js | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'pages/verify.js') diff --git a/pages/verify.js b/pages/verify.js index 2f7c863..022562c 100644 --- a/pages/verify.js +++ b/pages/verify.js @@ -1,20 +1,20 @@ import styles from 'styles/Main.module.scss' -import {useState} from 'react' +import { useState } from 'react' import useUser from 'hooks/useUser' import useSettings from 'hooks/useSettings' import fetchJson from 'helpers/fetchJson' -import {Layout} from 'components' +import { Layout } from 'components' import Splash from 'components/Splash' const Verify = () => { - const {t} = useSettings() + const { t } = useSettings() const [errorMsg, setErrorMsg] = useState('') const [loading, setLoading] = useState(false) const [sending, setSending] = useState(false) const [resent, setResent] = useState(false) - const {user, mutateUser} = useUser({ + const { user, mutateUser } = useUser({ redirectToLogin: true, - redirectToApps: true, + redirectToApps: true }) const handleSendMail = async e => { @@ -40,7 +40,7 @@ const Verify = () => { await fetchJson('/api/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({_id: user._id, key}), + body: JSON.stringify({ _id: user._id, key }) }) ) } catch (err) { @@ -55,33 +55,35 @@ const Verify = () => { {!user || loading ? ( - ) : ( + ) + : (

{t('verification_title')}

{`${t('verification_text')} ${user.email}`}

- - + +
{ sending ? (

{t('sending')}

- ) : ( - resent - ? ( -

{t('verification_sent_again')}

- ) : ( -

{t('verification_not_received')}  - {t('verification_send_again')}. -

- ) - ) + ) + : ( + resent + ? ( +

{t('verification_sent_again')}

+ ) + : ( +

{t('verification_not_received')}  + {t('verification_send_again')}. +

+ ) + ) } {errorMsg &&

{errorMsg}

}
- ) - } + )} ) } -- cgit v1.2.3