From 093622681c30e022a14543a73626b8ba9dd6e7dd Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:05:14 +0000 Subject: Better success page --- src/components/Navbar/Navbar.astro | 8 ++- src/i18n/translations/pages/signUp.ts | 23 -------- src/i18n/translations/pages/signUp/index.ts | 23 ++++++++ src/i18n/translations/pages/signUp/success.ts | 29 ++++++++++ src/layouts/Layout.astro | 5 +- src/layouts/Page.astro | 5 +- src/pages/[locale]/sign-up/index.astro | 13 +++-- src/pages/[locale]/sign-up/success.astro | 81 ++++++++++++++++----------- 8 files changed, 120 insertions(+), 67 deletions(-) delete mode 100644 src/i18n/translations/pages/signUp.ts create mode 100644 src/i18n/translations/pages/signUp/index.ts create mode 100644 src/i18n/translations/pages/signUp/success.ts diff --git a/src/components/Navbar/Navbar.astro b/src/components/Navbar/Navbar.astro index 4fa05a9..0722f01 100644 --- a/src/components/Navbar/Navbar.astro +++ b/src/components/Navbar/Navbar.astro @@ -3,13 +3,19 @@ import Breadcrumbs from './Breadcrumbs.astro'; import SwitchLanguageLink from '../SwitchLanguageLink.astro'; import NavLinks from './NavLinks.astro'; import Logo from './Logo.astro'; + +interface Props { + noBreadcrumbs?: boolean; +} + +const { noBreadcrumbs } = Astro.props; --- diff --git a/src/i18n/translations/pages/signUp.ts b/src/i18n/translations/pages/signUp.ts deleted file mode 100644 index 15a9dcf..0000000 --- a/src/i18n/translations/pages/signUp.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { TranslationsDictionary } from '$types/TranslationsDictionary'; - -const tPage = { - title: { - sco: () => 'Sign up', - 'en-GB': () => 'Sign up', - }, - 'label-email': { - sco: () => 'Email', - 'en-GB': () => 'Email', - }, - 'label-display-name': { - sco: () => 'Name', - 'en-GB': () => 'Name', - }, - submit: { - sco: () => 'Sign up', - 'en-GB': () => 'Sign up', - }, -}; - -type Raw = typeof tPage; -export default tPage as TranslationsDictionary; diff --git a/src/i18n/translations/pages/signUp/index.ts b/src/i18n/translations/pages/signUp/index.ts new file mode 100644 index 0000000..15a9dcf --- /dev/null +++ b/src/i18n/translations/pages/signUp/index.ts @@ -0,0 +1,23 @@ +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; + +const tPage = { + title: { + sco: () => 'Sign up', + 'en-GB': () => 'Sign up', + }, + 'label-email': { + sco: () => 'Email', + 'en-GB': () => 'Email', + }, + 'label-display-name': { + sco: () => 'Name', + 'en-GB': () => 'Name', + }, + submit: { + sco: () => 'Sign up', + 'en-GB': () => 'Sign up', + }, +}; + +type Raw = typeof tPage; +export default tPage as TranslationsDictionary; diff --git a/src/i18n/translations/pages/signUp/success.ts b/src/i18n/translations/pages/signUp/success.ts new file mode 100644 index 0000000..d853917 --- /dev/null +++ b/src/i18n/translations/pages/signUp/success.ts @@ -0,0 +1,29 @@ +import type { TranslationsDictionary } from '$types/TranslationsDictionary'; + +const tPage = { + title: { + sco: () => 'Successfullie signed up', + 'en-GB': () => 'Successfully signed up', + }, + 'para-1': { + sco: ({ displayName }: { displayName: string }) => ` + Walcome, ${displayName}! You hae successfullie registered a new account + wi us. + `, + 'en-GB': ({ displayName }: { displayName: string }) => ` + Welcome, ${displayName}! You have successfully registered a new account + with us. + `, + }, + 'para-2': { + sco: ({ userId }: { userId: string }) => ` + Your new unique user ID is ${userId}. Uise this neist time you wad log in. + `, + 'en-GB': ({ userId }: { userId: string }) => ` + Your new unique user ID is ${userId}. Use this next time you want to log in. + `, + }, +}; + +type Raw = typeof tPage; +export default tPage as TranslationsDictionary; diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index a5315be..938bfe5 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -10,9 +10,10 @@ import type Locale from '$types/Locale'; interface Props { title: string; + noBreadcrumbs?: boolean; } -const { title } = Astro.props; +const { noBreadcrumbs, title } = Astro.props; const locale = getLocaleFromPathOrDefault(Astro.url.pathname); const t = translate(locale); @@ -55,7 +56,7 @@ function qualifiedLocalisedPath(newLocale: Locale) { Skip to content - +