Skip to content

Commit

Permalink
Merge pull request #57 from dhis2/DHIS2-18375/email-verify-status-page
Browse files Browse the repository at this point in the history
feat: add email verification pages
  • Loading branch information
Chisomchima authored Dec 16, 2024
2 parents b3453ac + 5e759af commit dbbd781
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
26 changes: 24 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-08-28T07:47:39.528Z\n"
"PO-Revision-Date: 2024-08-28T07:47:39.528Z\n"
"POT-Creation-Date: 2024-12-16T14:17:34.112Z\n"
"PO-Revision-Date: 2024-12-16T14:17:34.112Z\n"

msgid "Please confirm that you are not a robot by checking the checkbox."
msgstr "Please confirm that you are not a robot by checking the checkbox."
Expand Down Expand Up @@ -133,6 +133,28 @@ msgstr "Download default template"
msgid "Download sidebar template"
msgstr "Download sidebar template"

msgid "Email Verification Failed"
msgstr "Email Verification Failed"

msgid "Unable to verify your email"
msgstr "Unable to verify your email"

msgid ""
"The verification link is invalid or has expired. Please request a new "
"verification email."
msgstr ""
"The verification link is invalid or has expired. Please request a new "
"verification email."

msgid "Email confirmed"
msgstr "Email confirmed"

msgid "Your email has been confirmed."
msgstr "Your email has been confirmed."

msgid "You can now close this page."
msgstr "You can now close this page."

msgid "Something went wrong"
msgstr "Something went wrong"

Expand Down
10 changes: 10 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import {
LoginPage,
CompleteRegistrationPage,
CreateAccountPage,
EmailVerificationFailure,
EmailVerificationSuccess,
PasswordResetRequestPage,
PasswordUpdatePage,
SafeModePage,
Expand All @@ -34,6 +36,14 @@ const LoginRoutes = () => {
<Routes>
<Route path="/" element={<LoginPage />} />
<Route path="/create-account" element={<CreateAccountPage />} />
<Route
path="/email-verification-success"
element={<EmailVerificationSuccess />}
/>
<Route
path="/email-verification-failure"
element={<EmailVerificationFailure />}
/>
<Route
path="/complete-registration"
element={<CompleteRegistrationPage />}
Expand Down
25 changes: 25 additions & 0 deletions src/pages/email-verification-failure.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import i18n from '@dhis2/d2-i18n'
import { NoticeBox } from '@dhis2/ui'
import React from 'react'
import { FormContainer } from '../components/index.js'
import { useLoginConfig } from '../providers/index.js'

function EmailVerificationFailure() {
const { lngs } = useLoginConfig()

return (
<FormContainer title={i18n.t('Email Verification Failed', { lngs })}>
<NoticeBox
error
title={i18n.t('Unable to verify your email', { lngs })}
>
{i18n.t(
'The verification link is invalid or has expired. Please request a new verification email.',
{ lngs }
)}
</NoticeBox>
</FormContainer>
)
}

export default EmailVerificationFailure
22 changes: 22 additions & 0 deletions src/pages/email-verification-success.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import i18n from '@dhis2/d2-i18n'
import { NoticeBox } from '@dhis2/ui'
import React from 'react'
import { FormContainer } from '../components/index.js'
import { useLoginConfig } from '../providers/index.js'

function EmailVerificationSuccess() {
const { lngs } = useLoginConfig()

return (
<FormContainer title={i18n.t('Email confirmed', { lngs })}>
<NoticeBox
valid
title={i18n.t('Your email has been confirmed.', { lngs })}
>
{i18n.t('You can now close this page.', { lngs })}
</NoticeBox>
</FormContainer>
)
}

export default EmailVerificationSuccess
2 changes: 2 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export { default as CompleteRegistrationPage } from './complete-registration.js'
export { default as CreateAccountPage } from './create-account.js'
export { default as EmailVerificationSuccess } from './email-verification-success.js'
export { default as EmailVerificationFailure } from './email-verification-failure.js'
export { default as LoginPage } from './login.js'
export { default as PasswordResetRequestPage } from './password-reset-request.js'
export { default as PasswordUpdatePage } from './password-update.js'
Expand Down

0 comments on commit dbbd781

Please sign in to comment.