aboutsummaryrefslogtreecommitdiffstats
path: root/pages/verify.js
diff options
context:
space:
mode:
authorGravatar piotrruss <mail@pruss.it> 2021-09-06 23:13:22 +0200
committerGravatar piotrruss <mail@pruss.it> 2021-09-06 23:13:22 +0200
commit569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a (patch)
tree8d1cb94a56d60b9d726222277b7516fc59895613 /pages/verify.js
parent275bd1d0a9aea90696c145cf992d522a0d6b0aa8 (diff)
downloadmy_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.gz
my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.bz2
my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.zip
added stadard linter
Diffstat (limited to 'pages/verify.js')
-rw-r--r--pages/verify.js44
1 files changed, 23 insertions, 21 deletions
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
? (
<Splash fixed />
- ) : (
+ )
+ : (
<div className={`window window--popup ${styles.verify}`}>
<p>{t('verification_title')}</p>
<p>{`${t('verification_text')} ${user.email}`}</p>
<form onSubmit={handleKey}>
- <input type="text" placeholder={t('verification_key')} name="key" />
- <button className="window__button" type="submit">{t('verify')}</button>
+ <input type='text' placeholder={t('verification_key')} name='key' />
+ <button className='window__button' type='submit'>{t('verify')}</button>
</form>
{
sending
? (
<p>{t('sending')}</p>
- ) : (
- resent
- ? (
- <p>{t('verification_sent_again')}</p>
- ) : (
- <p>{t('verification_not_received')}&nbsp;
- <span className={styles.email} onClick={handleSendMail}>{t('verification_send_again')}</span>.
- </p>
- )
- )
+ )
+ : (
+ resent
+ ? (
+ <p>{t('verification_sent_again')}</p>
+ )
+ : (
+ <p>{t('verification_not_received')}&nbsp;
+ <span className={styles.email} onClick={handleSendMail}>{t('verification_send_again')}</span>.
+ </p>
+ )
+ )
}
{errorMsg && <p className={styles.error}>{errorMsg}</p>}
</div>
- )
- }
+ )}
</Layout>
)
}