Skip to content

Commit

Permalink
rework confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
eike-hass committed Jul 19, 2024
1 parent b644b2f commit 5f70f21
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 80 deletions.
18 changes: 11 additions & 7 deletions web/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,19 @@
}
},
"government": {
"confirm": {
"confirmation": {
"confirmation": "Your Identity Credential Was Sent To Your Wallet",
"title": "🎉",
"success": "Congratulations, You Claimed Your Identity!",
"nextStep": "Register your Company"
"nextStep": "Next, Register your Company"
}
},
"company": {
"confirm": {
"confirmation": {
"confirmation": "Your Company Credential Was Sent To Your Wallet",
"title": "🎉",
"success": "Congratulations, You Setup your Company!",
"nextStep": "Claim Insurance"
"nextStep": "Next, Claim Open a Bank Account"
},
"incorporatedCompanies": {
"newlyIncorporatedCompanies": "Newly Incorporated Companies"
Expand All @@ -203,10 +205,11 @@
}
},
"bank": {
"confirm": {
"confirmation": {
"confirmation": "Your Bank Credential Was Sent To Your Wallet",
"title": "🎉",
"success": "Congratulations, You Claimed Your Bank Account!",
"nextStep": "Apply for Insurance"
"nextStep": "Next, Apply for Insurance"
},
"bankData": {
"accountTypes": {
Expand All @@ -219,8 +222,9 @@
}
},
"insurance": {
"confirm": {
"confirmation": {
"confirmation": "Your Insurance Credential Was Sent To Your Wallet",
"title": "🎉",
"success": "Congratulations, You Claimed Your Insurance!",
"nextStep": "Ready for business"
},
Expand Down
27 changes: 3 additions & 24 deletions web/src/pages/Company/Confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,21 @@ import { useTranslation } from 'react-i18next';
*/
const Confirmation: React.FC = () => {
const { nextStep, theme } = useStep();
const [companyId, setCompanyId] = useState('');
const [title, setTitle] = useState('');

const { t } = useTranslation();

useEffect(() => {
async function determineCompanyId () {
setCompanyId(await getCompanyId());
switch (theme) {
case 'bank':
setTitle("pages.general.confirmation.titleBank");
break;
case 'insurance':
setTitle("pages.general.confirmation.titleInsurance");
break;
case 'company':
setTitle("pages.general.confirmation.titleCompany");
break;
default:
setTitle("pages.general.confirmation.titleCompany");
break;
}
}
determineCompanyId();
}, [companyId, theme]);

return (
<Layout>
<RandomGraphicElement elements={5}>
<div className='confirmation-page'>
<div className='selv-wrapper'>
<img src={selv} alt='Selv app logo' />
<h4>{t("pages.company.confirmation.confirmation")}</h4>
<h4>{t("pages.company.confirmation.title")}</h4>
</div>
<h2>{t(title)}</h2>
<p>{t("pages.general.confirmation.success")}</p>
<h2>{t("pages.company.confirmation.confirmation")}</h2>
<p>{t("pages.company.confirmation.success")}</p>
<Link to={nextStep}>
<Button>
{t("pages.general.confirmation.nextStep")}
Expand Down
25 changes: 1 addition & 24 deletions web/src/pages/Government/Confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,9 @@ import { useTranslation } from 'react-i18next';
*/
const Confirmation: React.FC = () => {
const { nextStep, theme } = useStep();
const [companyId, setCompanyId] = useState('');
const [title, setTitle] = useState('');

const { t } = useTranslation();

useEffect(() => {
async function determineCompanyId () {
setCompanyId(await getCompanyId());
switch (theme) {
case 'bank':
setTitle("pages.general.confirmation.titleBank");
break;
case 'insurance':
setTitle("pages.general.confirmation.titleInsurance");
break;
case 'company':
setTitle("pages.general.confirmation.titleCompany");
break;
default:
setTitle("pages.general.confirmation.titleCompany");
break;
}
}
determineCompanyId();
}, [companyId, theme]);

return (
<Layout>
<RandomGraphicElement elements={5}>
Expand All @@ -46,7 +23,7 @@ const Confirmation: React.FC = () => {
<img src={selv} alt='Selv app logo' />
<h4>{t("pages.government.confirmation.confirmation")}</h4>
</div>
<h2>{t(title)}</h2>
<h2>{t("pages.government.confirmation.title")}</h2>
<p>{t("pages.government.confirmation.success")}</p>
<Link to={nextStep}>
<Button>
Expand Down
26 changes: 1 addition & 25 deletions web/src/pages/Insurance/Confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,8 @@ import { useTranslation } from 'react-i18next';
*/
const Confirmation: React.FC = () => {
const { nextStep, theme } = useStep();
const [companyId, setCompanyId] = useState('');
const [title, setTitle] = useState('');

const { t } = useTranslation();

useEffect(() => {
async function determineCompanyId () {
setCompanyId(await getCompanyId());
switch (theme) {
case 'bank':
setTitle("pages.general.confirmation.titleBank");
break;
case 'insurance':
setTitle("pages.general.confirmation.titleInsurance");
break;
case 'company':
setTitle("pages.general.confirmation.titleCompany");
break;
default:
setTitle("pages.general.confirmation.titleCompany");
break;
}
}
determineCompanyId();
}, [companyId, theme]);

return (
<Layout>
<RandomGraphicElement elements={5}>
Expand All @@ -46,7 +22,7 @@ const Confirmation: React.FC = () => {
<img src={selv} alt='Selv app logo' />
<h4>{t("pages.insurance.confirmation.confirmation")}</h4>
</div>
<h2>{t(title)}</h2>
<h2>{t("pages.insurance.confirmation.title")}</h2>
<p>{t("pages.insurance.confirmation.success")}</p>
<Link to={nextStep}>
<Button>
Expand Down

0 comments on commit 5f70f21

Please sign in to comment.