feat(SW-898): add pending ui text to signup button

This commit is contained in:
Chuma McPhoy
2024-11-18 11:18:55 +01:00
parent cfaa92260a
commit 5c571c3c0c
7 changed files with 14 additions and 2 deletions

View File

@@ -37,6 +37,10 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
const email = intl.formatMessage({ id: "Email address" }) const email = intl.formatMessage({ id: "Email address" })
const phoneNumber = intl.formatMessage({ id: "Phone number" }) const phoneNumber = intl.formatMessage({ id: "Phone number" })
const zipCode = intl.formatMessage({ id: "Zip code" }) const zipCode = intl.formatMessage({ id: "Zip code" })
const signupButtonText = intl.formatMessage({
id: "Sign up to Scandic Friends",
})
const signingUpPendingText = intl.formatMessage({ id: "Signing up..." })
const signup = trpc.user.signup.useMutation({ const signup = trpc.user.signup.useMutation({
onSuccess: (data) => { onSuccess: (data) => {
@@ -183,7 +187,7 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
onClick={() => methods.trigger()} onClick={() => methods.trigger()}
data-testid="trigger-validation" data-testid="trigger-validation"
> >
{intl.formatMessage({ id: "Sign up to Scandic Friends" })} {signupButtonText}
</Button> </Button>
) : ( ) : (
<Button <Button
@@ -194,7 +198,9 @@ export default function SignupForm({ link, subtitle, title }: SignUpFormProps) {
disabled={methods.formState.isSubmitting || signup.isPending} disabled={methods.formState.isSubmitting || signup.isPending}
data-testid="submit" data-testid="submit"
> >
{intl.formatMessage({ id: "Sign up to Scandic Friends" })} {methods.formState.isSubmitting || signup.isPending
? signingUpPendingText
: signupButtonText}
</Button> </Button>
)} )}
</form> </form>

View File

@@ -337,6 +337,7 @@
"Show wellness & exercise": "Vis velvære og motion", "Show wellness & exercise": "Vis velvære og motion",
"Sign up bonus": "Velkomstbonus", "Sign up bonus": "Velkomstbonus",
"Sign up to Scandic Friends": "Tilmeld dig Scandic Friends", "Sign up to Scandic Friends": "Tilmeld dig Scandic Friends",
"Signing up...": "Tilmelder...",
"Skip to main content": "Spring over og gå til hovedindhold", "Skip to main content": "Spring over og gå til hovedindhold",
"Something went wrong and we couldn't add your card. Please try again later.": "Noget gik galt, og vi kunne ikke tilføje dit kort. Prøv venligst igen senere.", "Something went wrong and we couldn't add your card. Please try again later.": "Noget gik galt, og vi kunne ikke tilføje dit kort. Prøv venligst igen senere.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Noget gik galt, og vi kunne ikke fjerne dit kort. Prøv venligst igen senere.", "Something went wrong and we couldn't remove your card. Please try again later.": "Noget gik galt, og vi kunne ikke fjerne dit kort. Prøv venligst igen senere.",

View File

@@ -336,6 +336,7 @@
"Show wellness & exercise": "Zeige Wellness und Bewegung", "Show wellness & exercise": "Zeige Wellness und Bewegung",
"Sign up bonus": "Anmelde-Bonus", "Sign up bonus": "Anmelde-Bonus",
"Sign up to Scandic Friends": "Treten Sie Scandic Friends bei", "Sign up to Scandic Friends": "Treten Sie Scandic Friends bei",
"Signing up...": "Registrierung läuft...",
"Skip to main content": "Direkt zum Inhalt", "Skip to main content": "Direkt zum Inhalt",
"Something went wrong and we couldn't add your card. Please try again later.": "Ein Fehler ist aufgetreten und wir konnten Ihre Karte nicht hinzufügen. Bitte versuchen Sie es später erneut.", "Something went wrong and we couldn't add your card. Please try again later.": "Ein Fehler ist aufgetreten und wir konnten Ihre Karte nicht hinzufügen. Bitte versuchen Sie es später erneut.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Ein Fehler ist aufgetreten und wir konnten Ihre Karte nicht entfernen. Bitte versuchen Sie es später noch einmal.", "Something went wrong and we couldn't remove your card. Please try again later.": "Ein Fehler ist aufgetreten und wir konnten Ihre Karte nicht entfernen. Bitte versuchen Sie es später noch einmal.",

View File

@@ -366,6 +366,7 @@
"Show wellness & exercise": "Show wellness & exercise", "Show wellness & exercise": "Show wellness & exercise",
"Sign up bonus": "Sign up bonus", "Sign up bonus": "Sign up bonus",
"Sign up to Scandic Friends": "Sign up to Scandic Friends", "Sign up to Scandic Friends": "Sign up to Scandic Friends",
"Signing up...": "Signing up...",
"Skip to main content": "Skip to main content", "Skip to main content": "Skip to main content",
"Something went wrong and we couldn't add your card. Please try again later.": "Something went wrong and we couldn't add your card. Please try again later.", "Something went wrong and we couldn't add your card. Please try again later.": "Something went wrong and we couldn't add your card. Please try again later.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Something went wrong and we couldn't remove your card. Please try again later.", "Something went wrong and we couldn't remove your card. Please try again later.": "Something went wrong and we couldn't remove your card. Please try again later.",

View File

@@ -338,6 +338,7 @@
"Show wellness & exercise": "Näytä hyvinvointi ja liikunta", "Show wellness & exercise": "Näytä hyvinvointi ja liikunta",
"Sign up bonus": "Liittymisbonus", "Sign up bonus": "Liittymisbonus",
"Sign up to Scandic Friends": "Liity Scandic Friends -jäseneksi", "Sign up to Scandic Friends": "Liity Scandic Friends -jäseneksi",
"Signing up...": "Rekisteröidytään...",
"Skip to main content": "Siirry pääsisältöön", "Skip to main content": "Siirry pääsisältöön",
"Something went wrong and we couldn't add your card. Please try again later.": "Jotain meni pieleen, emmekä voineet lisätä korttiasi. Yritä myöhemmin uudelleen.", "Something went wrong and we couldn't add your card. Please try again later.": "Jotain meni pieleen, emmekä voineet lisätä korttiasi. Yritä myöhemmin uudelleen.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Jotain meni pieleen, emmekä voineet poistaa korttiasi. Yritä myöhemmin uudelleen.", "Something went wrong and we couldn't remove your card. Please try again later.": "Jotain meni pieleen, emmekä voineet poistaa korttiasi. Yritä myöhemmin uudelleen.",

View File

@@ -335,6 +335,7 @@
"Show wellness & exercise": "Vis velvære og trening", "Show wellness & exercise": "Vis velvære og trening",
"Sign up bonus": "Velkomstbonus", "Sign up bonus": "Velkomstbonus",
"Sign up to Scandic Friends": "Bli med i Scandic Friends", "Sign up to Scandic Friends": "Bli med i Scandic Friends",
"Signing up...": "Registrerer...",
"Skip to main content": "Gå videre til hovedsiden", "Skip to main content": "Gå videre til hovedsiden",
"Something went wrong and we couldn't add your card. Please try again later.": "Noe gikk galt, og vi kunne ikke legge til kortet ditt. Prøv igjen senere.", "Something went wrong and we couldn't add your card. Please try again later.": "Noe gikk galt, og vi kunne ikke legge til kortet ditt. Prøv igjen senere.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Noe gikk galt, og vi kunne ikke fjerne kortet ditt. Vennligst prøv igjen senere.", "Something went wrong and we couldn't remove your card. Please try again later.": "Noe gikk galt, og vi kunne ikke fjerne kortet ditt. Vennligst prøv igjen senere.",

View File

@@ -335,6 +335,7 @@
"Show wellness & exercise": "Visa välbefinnande och träning", "Show wellness & exercise": "Visa välbefinnande och träning",
"Sign up bonus": "Välkomstbonus", "Sign up bonus": "Välkomstbonus",
"Sign up to Scandic Friends": "Bli medlem i Scandic Friends", "Sign up to Scandic Friends": "Bli medlem i Scandic Friends",
"Signing up...": "Registrerar...",
"Skip to main content": "Fortsätt till huvudinnehåll", "Skip to main content": "Fortsätt till huvudinnehåll",
"Something went wrong and we couldn't add your card. Please try again later.": "Något gick fel och vi kunde inte lägga till ditt kort. Försök igen senare.", "Something went wrong and we couldn't add your card. Please try again later.": "Något gick fel och vi kunde inte lägga till ditt kort. Försök igen senare.",
"Something went wrong and we couldn't remove your card. Please try again later.": "Något gick fel och vi kunde inte ta bort ditt kort. Försök igen senare.", "Something went wrong and we couldn't remove your card. Please try again later.": "Något gick fel och vi kunde inte ta bort ditt kort. Försök igen senare.",