feat: add discard changes modal to profile edit

This commit is contained in:
Simon Emanuelsson
2024-08-26 12:39:13 +02:00
committed by Christel Westerberg
parent bcc0835386
commit b2de45ab5c
12 changed files with 246 additions and 165 deletions

View File

@@ -1,13 +1,23 @@
@keyframes modal-fade {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.overlay { .overlay {
position: fixed; align-items: center;
top: 0;
left: 0;
width: 100vw;
height: var(--visual-viewport-height);
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
display: flex; display: flex;
align-items: center; height: var(--visual-viewport-height);
justify-content: center; justify-content: center;
left: 0;
position: fixed;
top: 0;
width: 100vw;
z-index: 100; z-index: 100;
&[data-entering] { &[data-entering] {
@@ -19,52 +29,37 @@
} }
} }
.modal section { .modal {
background: var(--Main-Grey-White); background-color: var(--Base-Surface-Primary-light-Normal);
border-radius: var(--Corner-radius-Medium); border-radius: var(--Corner-radius-Medium);
padding: var(--Spacing-x4); box-shadow: 0px 4px 24px 0px rgba(38, 32, 30, 0.08);
padding-bottom: var(--Spacing-x6);
}
.container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: var(--Spacing-x3); gap: var(--Spacing-x3);
font-family: var(--typography-Body-Regular-fontFamily); max-width: 560px;
padding: var(--Spacing-x5) var(--Spacing-x4);
} }
.title { .header {
font-family: var(--typography-Subtitle-1-fontFamily);
text-align: center;
margin: 0;
padding-bottom: var(--Spacing-x1);
}
.bodyText {
text-align: center;
max-width: 425px;
margin: 0;
padding: 0;
}
.buttonContainer {
display: flex; display: flex;
justify-content: space-between; flex-direction: column;
gap: var(--Spacing-x2); gap: var(--Spacing-x2);
flex-wrap: wrap;
} }
.buttonContainer button { .footer {
flex-grow: 1; display: flex;
justify-content: center; flex-direction: column-reverse;
gap: var(--Spacing-x1);
} }
@keyframes modal-fade { @media screen and (min-width: 768px) {
from { .footer {
opacity: 0; align-items: center;
} flex-direction: row;
gap: var(--Spacing-x2);
to { & > button {
opacity: 1; flex: 1;
}
} }
} }

View File

@@ -0,0 +1,87 @@
"use client"
import {
Dialog as AriaDialog,
DialogTrigger,
Modal,
ModalOverlay,
} from "react-aria-components"
import LoadingSpinner from "@/components/LoadingSpinner"
import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import styles from "./dialog.module.css"
import type { DialogProps } from "@/types/components/dialog"
export default function Dialog({
bodyText,
cancelButtonText,
proceedHref,
proceedIsPending = false,
proceedOnClick = () => {},
proceedText,
titleText,
triggerButtonText,
}: DialogProps) {
return (
<DialogTrigger>
<Button intent="secondary" size="small" theme="base">
{triggerButtonText}
</Button>
<ModalOverlay className={styles.overlay} isDismissable>
<Modal>
<AriaDialog role="alertdialog">
{({ close }) => (
<section className={styles.modal}>
<header className={styles.header}>
<Subtitle textAlign="center">{titleText}</Subtitle>
<Body textAlign="center">{bodyText}</Body>
</header>
{proceedIsPending ? (
<LoadingSpinner />
) : (
<footer className={styles.footer}>
<Button
intent="secondary"
onPress={close}
size="medium"
theme="base"
>
{cancelButtonText}
</Button>
{proceedHref ? (
<Button
asChild
intent="primary"
size="medium"
theme="base"
>
<Link color="none" href={proceedHref}>
{proceedText}
</Link>
</Button>
) : (
<Button
intent="primary"
onPress={() => {
proceedOnClick(close)
}}
size="medium"
theme="base"
>
{proceedText}
</Button>
)}
</footer>
)}
</section>
)}
</AriaDialog>
</Modal>
</ModalOverlay>
</DialogTrigger>
)
}

View File

@@ -13,8 +13,8 @@ import { profile } from "@/constants/routes/myPages"
import { trpc } from "@/lib/trpc/client" import { trpc } from "@/lib/trpc/client"
import { editProfile } from "@/actions/editProfile" import { editProfile } from "@/actions/editProfile"
import Dialog from "@/components/Dialog"
import Button from "@/components/TempDesignSystem/Button" import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
import Title from "@/components/TempDesignSystem/Text/Title" import Title from "@/components/TempDesignSystem/Text/Title"
import { toast } from "@/components/TempDesignSystem/Toasts" import { toast } from "@/components/TempDesignSystem/Toasts"
@@ -118,11 +118,16 @@ export default function Form({ user }: EditFormProps) {
</Title> </Title>
</hgroup> </hgroup>
<div className={styles.btnContainer}> <div className={styles.btnContainer}>
<Button asChild intent="secondary" size="small" theme="base"> <Dialog
<Link href={profile[lang]}> bodyText={intl.formatMessage({
{intl.formatMessage({ id: "Discard changes" })} id: "Any changes you've made will be lost.",
</Link> })}
</Button> cancelButtonText={intl.formatMessage({ id: "Go back to edit" })}
proceedHref={profile[lang]}
proceedText={intl.formatMessage({ id: "Yes, discard changes" })}
titleText={intl.formatMessage({ id: "Discard unsaved changes?" })}
triggerButtonText={intl.formatMessage({ id: "Discard changes" })}
/>
<Button <Button
disabled={!isValid || methods.formState.isSubmitting} disabled={!isValid || methods.formState.isSubmitting}
form={formId} form={formId}

View File

@@ -0,0 +1,58 @@
"use client"
import { useIntl } from "react-intl"
import { trpc } from "@/lib/trpc/client"
import Dialog from "@/components/Dialog"
import { Delete } from "@/components/Icons"
import { toast } from "@/components/TempDesignSystem/Toasts"
import type { DeleteCreditCardConfirmationProps } from "@/types/components/myPages/myProfile/creditCards"
export default function DeleteCreditCardConfirmation({
card,
}: DeleteCreditCardConfirmationProps) {
const intl = useIntl()
const trpcUtils = trpc.useUtils()
const deleteCard = trpc.user.creditCard.delete.useMutation({
onSuccess() {
trpcUtils.user.creditCards.invalidate()
toast.success(
intl.formatMessage({ id: "Your card was successfully removed!" })
)
},
onError() {
toast.error(
intl.formatMessage({
id: "Something went wrong and we couldn't remove your card. Please try again later.",
})
)
},
})
function handleProceedDeleteCard(close: () => void) {
deleteCard.mutate({ creditCardId: card.id }, { onSettled: close })
}
const lastFourDigits = card.truncatedNumber.slice(-4)
const bodyText = intl.formatMessage(
{
id: "Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?",
},
{ lastFourDigits }
)
return (
<Dialog
bodyText={bodyText}
cancelButtonText={intl.formatMessage({ id: "No, keep card" })}
proceedOnClick={handleProceedDeleteCard}
proceedText={intl.formatMessage({ id: "Yes, remove my card" })}
titleText={intl.formatMessage({ id: "Remove card from member profile" })}
triggerButtonText={<Delete color="burgundy" />}
/>
)
}

View File

@@ -1,99 +0,0 @@
"use client"
import {
Dialog,
DialogTrigger,
Heading,
Modal,
ModalOverlay,
} from "react-aria-components"
import { useIntl } from "react-intl"
import { trpc } from "@/lib/trpc/client"
import { Delete } from "@/components/Icons"
import LoadingSpinner from "@/components/LoadingSpinner"
import Button from "@/components/TempDesignSystem/Button"
import { toast } from "@/components/TempDesignSystem/Toasts"
import styles from "./deleteCreditCardConfirmation.module.css"
import type { DeleteCreditCardConfirmationProps } from "@/types/components/myPages/myProfile/creditCards"
export default function DeleteCreditCardConfirmation({
card,
}: DeleteCreditCardConfirmationProps) {
const intl = useIntl()
const trpcUtils = trpc.useUtils()
const deleteCard = trpc.user.creditCard.delete.useMutation({
onSuccess() {
trpcUtils.user.creditCards.invalidate()
toast.success(
intl.formatMessage({ id: "Your card was successfully removed!" })
)
},
onError() {
toast.error(
intl.formatMessage({
id: "Something went wrong and we couldn't remove your card. Please try again later.",
})
)
},
})
const lastFourDigits = card.truncatedNumber.slice(-4)
return (
<div>
<DialogTrigger>
<Button variant="icon" theme="base" intent="text">
<Delete color="burgundy" />
</Button>
<ModalOverlay className={styles.overlay} isDismissable>
<Modal className={styles.modal}>
<Dialog role="alertdialog">
{({ close }) => (
<div className={styles.container}>
<Heading slot="title" className={styles.title}>
{intl.formatMessage({
id: "Remove card from member profile",
})}
</Heading>
<p className={styles.bodyText}>
{`${intl.formatMessage({
id: "Are you sure you want to remove the card ending with",
})} ${lastFourDigits} ${intl.formatMessage({ id: "from your member profile?" })}`}
</p>
{deleteCard.isPending ? (
<LoadingSpinner />
) : (
<div className={styles.buttonContainer}>
<Button intent="secondary" theme="base" onClick={close}>
{intl.formatMessage({ id: "No, keep card" })}
</Button>
<Button
intent="primary"
theme="base"
onClick={() => {
deleteCard.mutate(
{ creditCardId: card.id },
{ onSettled: close }
)
}}
>
{intl.formatMessage({ id: "Yes, remove my card" })}
</Button>
</div>
)}
</div>
)}
</Dialog>
</Modal>
</ModalOverlay>
</DialogTrigger>
</div>
)
}

View File

@@ -10,7 +10,9 @@
"Amenities": "Faciliteter", "Amenities": "Faciliteter",
"An error occurred when adding a credit card, please try again later.": "Der opstod en fejl under tilføjelse af et kreditkort. Prøv venligst igen senere.", "An error occurred when adding a credit card, please try again later.": "Der opstod en fejl under tilføjelse af et kreditkort. Prøv venligst igen senere.",
"An error occurred when trying to update profile.": "Der opstod en fejl under forsøg på at opdatere profilen.", "An error occurred when trying to update profile.": "Der opstod en fejl under forsøg på at opdatere profilen.",
"Any changes you've made will be lost.": "Alle ændringer, du har foretaget, går tabt.",
"Are you sure you want to remove the card ending with": "Er du sikker på, at du vil fjerne kortet, der slutter med", "Are you sure you want to remove the card ending with": "Er du sikker på, at du vil fjerne kortet, der slutter med",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Er du sikker på, at du vil fjerne kortet, der slutter me {lastFourDigits} fra din medlemsprofil?",
"Arrival date": "Ankomstdato", "Arrival date": "Ankomstdato",
"as of today": "fra idag", "as of today": "fra idag",
"As our": "Som vores {level}", "As our": "Som vores {level}",
@@ -47,6 +49,7 @@
"Day": "Dag", "Day": "Dag",
"Description": "Beskrivelse", "Description": "Beskrivelse",
"Discard changes": "Kassér ændringer", "Discard changes": "Kassér ændringer",
"Discard unsaved changes?": "Slette ændringer, der ikke er gemt?",
"Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte morgenbuffet?", "Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte morgenbuffet?",
"Download the Scandic app": "Download Scandic-appen", "Download the Scandic app": "Download Scandic-appen",
"Edit": "Redigere", "Edit": "Redigere",
@@ -60,8 +63,8 @@
"Flexibility": "Fleksibilitet", "Flexibility": "Fleksibilitet",
"Former Scandic Hotel": "Tidligere Scandic Hotel", "Former Scandic Hotel": "Tidligere Scandic Hotel",
"From": "Fra", "From": "Fra",
"from your member profile?": "fra din medlemsprofil?",
"Get inspired": "Bliv inspireret", "Get inspired": "Bliv inspireret",
"Go back to edit": "Gå tilbage til redigering",
"Go back to overview": "Gå tilbage til oversigten", "Go back to overview": "Gå tilbage til oversigten",
"Highest level": "Højeste niveau", "Highest level": "Højeste niveau",
"Hotel facilities": "Hotel faciliteter", "Hotel facilities": "Hotel faciliteter",
@@ -69,6 +72,7 @@
"How do you want to sleep?": "Hvordan vil du sove?", "How do you want to sleep?": "Hvordan vil du sove?",
"How it works": "Hvordan det virker", "How it works": "Hvordan det virker",
"Join Scandic Friends": "Tilmeld dig Scandic Friends", "Join Scandic Friends": "Tilmeld dig Scandic Friends",
"km to city center": "km til byens centrum",
"Language": "Sprog", "Language": "Sprog",
"Level": "Niveau", "Level": "Niveau",
"Level 1": "Niveau 1", "Level 1": "Niveau 1",
@@ -113,8 +117,8 @@
"Phone is required": "Telefonnummer er påkrævet", "Phone is required": "Telefonnummer er påkrævet",
"Phone number": "Telefonnummer", "Phone number": "Telefonnummer",
"Please enter a valid phone number": "Indtast venligst et gyldigt telefonnummer", "Please enter a valid phone number": "Indtast venligst et gyldigt telefonnummer",
"points": "Point",
"Points": "Point", "Points": "Point",
"points": "Point",
"Points being calculated": "Point udregnes", "Points being calculated": "Point udregnes",
"Points earned prior to May 1, 2021": "Point optjent inden 1. maj 2021", "Points earned prior to May 1, 2021": "Point optjent inden 1. maj 2021",
"Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.", "Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.",
@@ -179,6 +183,7 @@
"Where to": "Hvor", "Where to": "Hvor",
"Which room class suits you the best?": "Hvilken rumklasse passer bedst til dig", "Which room class suits you the best?": "Hvilken rumklasse passer bedst til dig",
"Year": "År", "Year": "År",
"Yes, discard changes": "Ja, kasser ændringer",
"Yes, remove my card": "Ja, fjern mit kort", "Yes, remove my card": "Ja, fjern mit kort",
"You canceled adding a new credit card.": "Du har annulleret tilføjelsen af et nyt kreditkort.", "You canceled adding a new credit card.": "Du har annulleret tilføjelsen af et nyt kreditkort.",
"You have no previous stays.": "Du har ingen tidligere ophold.", "You have no previous stays.": "Du har ingen tidligere ophold.",

View File

@@ -9,7 +9,8 @@
"Amenities": "Annehmlichkeiten", "Amenities": "Annehmlichkeiten",
"An error occurred when adding a credit card, please try again later.": "Beim Hinzufügen einer Kreditkarte ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.", "An error occurred when adding a credit card, please try again later.": "Beim Hinzufügen einer Kreditkarte ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.",
"An error occurred when trying to update profile.": "Beim Versuch, das Profil zu aktualisieren, ist ein Fehler aufgetreten.", "An error occurred when trying to update profile.": "Beim Versuch, das Profil zu aktualisieren, ist ein Fehler aufgetreten.",
"Are you sure you want to remove the card ending with": "Möchten Sie die Karte mit der Endung", "Any changes you've made will be lost.": "Alle Änderungen, die Sie vorgenommen haben, gehen verloren.",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Möchten Sie die Karte mit der Endung {lastFourDigits} wirklich aus Ihrem Mitgliedsprofil entfernen?",
"Arrival date": "Ankunftsdatum", "Arrival date": "Ankunftsdatum",
"as of today": "Stand heute", "as of today": "Stand heute",
"As our": "Als unser {level}", "As our": "Als unser {level}",
@@ -46,6 +47,7 @@
"Day": "Tag", "Day": "Tag",
"Description": "Beschreibung", "Description": "Beschreibung",
"Discard changes": "Änderungen verwerfen", "Discard changes": "Änderungen verwerfen",
"Discard unsaved changes?": "Nicht gespeicherte Änderungen verwerfen?",
"Do you want to start the day with Scandics famous breakfast buffé?": "Möchten Sie den Tag mit Scandics berühmtem Frühstücksbuffet beginnen?", "Do you want to start the day with Scandics famous breakfast buffé?": "Möchten Sie den Tag mit Scandics berühmtem Frühstücksbuffet beginnen?",
"Download the Scandic app": "Laden Sie die Scandic-App herunter", "Download the Scandic app": "Laden Sie die Scandic-App herunter",
"Edit": "Bearbeiten", "Edit": "Bearbeiten",
@@ -59,8 +61,8 @@
"Flexibility": "Flexibilität", "Flexibility": "Flexibilität",
"Former Scandic Hotel": "Ehemaliges Scandic Hotel", "Former Scandic Hotel": "Ehemaliges Scandic Hotel",
"From": "Fromm", "From": "Fromm",
"from your member profile?": "wirklich aus Ihrem Mitgliedsprofil entfernen?",
"Get inspired": "Lassen Sie sich inspieren", "Get inspired": "Lassen Sie sich inspieren",
"Go back to edit": "Zurück zum Bearbeiten",
"Go back to overview": "Zurück zur Übersicht", "Go back to overview": "Zurück zur Übersicht",
"Highest level": "Höchstes Level", "Highest level": "Höchstes Level",
"Hotel facilities": "Hotel-Infos", "Hotel facilities": "Hotel-Infos",
@@ -68,6 +70,7 @@
"How do you want to sleep?": "Wie möchtest du schlafen?", "How do you want to sleep?": "Wie möchtest du schlafen?",
"How it works": "Wie es funktioniert", "How it works": "Wie es funktioniert",
"Join Scandic Friends": "Treten Sie Scandic Friends bei", "Join Scandic Friends": "Treten Sie Scandic Friends bei",
"km to city center": "km bis zum Stadtzentrum",
"Language": "Sprache", "Language": "Sprache",
"Level": "Level", "Level": "Level",
"Level 1": "Level 1", "Level 1": "Level 1",
@@ -173,6 +176,7 @@
"Where to": "Wohin", "Where to": "Wohin",
"Which room class suits you the best?": "Welche Zimmerklasse passt am besten zu Ihnen?", "Which room class suits you the best?": "Welche Zimmerklasse passt am besten zu Ihnen?",
"Year": "Jahr", "Year": "Jahr",
"Yes, discard changes": "Ja, Änderungen verwerfen",
"Yes, remove my card": "Ja, meine Karte entfernen", "Yes, remove my card": "Ja, meine Karte entfernen",
"You canceled adding a new credit card.": "Sie haben das Hinzufügen einer neuen Kreditkarte abgebrochen.", "You canceled adding a new credit card.": "Sie haben das Hinzufügen einer neuen Kreditkarte abgebrochen.",
"You have no previous stays.": "Sie haben keine vorherigen Aufenthalte.", "You have no previous stays.": "Sie haben keine vorherigen Aufenthalte.",

View File

@@ -10,7 +10,8 @@
"Amenities": "Amenities", "Amenities": "Amenities",
"An error occurred when adding a credit card, please try again later.": "An error occurred when adding a credit card, please try again later.", "An error occurred when adding a credit card, please try again later.": "An error occurred when adding a credit card, please try again later.",
"An error occurred when trying to update profile.": "An error occurred when trying to update profile.", "An error occurred when trying to update profile.": "An error occurred when trying to update profile.",
"Are you sure you want to remove the card ending with": "Are you sure you want to remove the card ending with", "Any changes you've made will be lost.": "Any changes you've made will be lost.",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?",
"Arrival date": "Arrival date", "Arrival date": "Arrival date",
"as of today": "as of today", "as of today": "as of today",
"As our": "As our {level}", "As our": "As our {level}",
@@ -47,6 +48,7 @@
"Day": "Day", "Day": "Day",
"Description": "Description", "Description": "Description",
"Discard changes": "Discard changes", "Discard changes": "Discard changes",
"Discard unsaved changes?": "Discard unsaved changes?",
"Distance to city centre": "{number}km to city centre", "Distance to city centre": "{number}km to city centre",
"Do you want to start the day with Scandics famous breakfast buffé?": "Do you want to start the day with Scandics famous breakfast buffé?", "Do you want to start the day with Scandics famous breakfast buffé?": "Do you want to start the day with Scandics famous breakfast buffé?",
"Download the Scandic app": "Download the Scandic app", "Download the Scandic app": "Download the Scandic app",
@@ -62,8 +64,8 @@
"Flexibility": "Flexibility", "Flexibility": "Flexibility",
"Former Scandic Hotel": "Former Scandic Hotel", "Former Scandic Hotel": "Former Scandic Hotel",
"From": "From", "From": "From",
"from your member profile?": "from your member profile?",
"Get inspired": "Get inspired", "Get inspired": "Get inspired",
"Go back to edit": "Go back to edit",
"Go back to overview": "Go back to overview", "Go back to overview": "Go back to overview",
"Highest level": "Highest level", "Highest level": "Highest level",
"Hotel facilities": "Hotel facilities", "Hotel facilities": "Hotel facilities",
@@ -74,6 +76,7 @@
"How do you want to sleep?": "How do you want to sleep?", "How do you want to sleep?": "How do you want to sleep?",
"How it works": "How it works", "How it works": "How it works",
"Join Scandic Friends": "Join Scandic Friends", "Join Scandic Friends": "Join Scandic Friends",
"km to city center": "km to city center",
"Language": "Language", "Language": "Language",
"Level": "Level", "Level": "Level",
"Level 1": "Level 1", "Level 1": "Level 1",
@@ -185,6 +188,7 @@
"Where to": "Where to", "Where to": "Where to",
"Which room class suits you the best?": "Which room class suits you the best?", "Which room class suits you the best?": "Which room class suits you the best?",
"Year": "Year", "Year": "Year",
"Yes, discard changes": "Yes, discard changes",
"Yes, remove my card": "Yes, remove my card", "Yes, remove my card": "Yes, remove my card",
"You canceled adding a new credit card.": "You canceled adding a new credit card.", "You canceled adding a new credit card.": "You canceled adding a new credit card.",
"You have no previous stays.": "You have no previous stays.", "You have no previous stays.": "You have no previous stays.",

View File

@@ -10,7 +10,8 @@
"Amenities": "Mukavuudet", "Amenities": "Mukavuudet",
"An error occurred when adding a credit card, please try again later.": "Luottokorttia lisättäessä tapahtui virhe. Yritä myöhemmin uudelleen.", "An error occurred when adding a credit card, please try again later.": "Luottokorttia lisättäessä tapahtui virhe. Yritä myöhemmin uudelleen.",
"An error occurred when trying to update profile.": "Profiilia päivitettäessä tapahtui virhe.", "An error occurred when trying to update profile.": "Profiilia päivitettäessä tapahtui virhe.",
"Are you sure you want to remove the card ending with": "Haluatko varmasti poistaa kortin, joka päättyy numeroon", "Any changes you've made will be lost.": "Kaikki tekemäsi muutokset menetetään.",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Haluatko varmasti poistaa kortin, joka päättyy numeroon {lastFourDigits} jäsenprofiilistasi?",
"Arrival date": "Saapumispäivä", "Arrival date": "Saapumispäivä",
"as of today": "tänään", "as of today": "tänään",
"As our": "{level}-etu", "As our": "{level}-etu",
@@ -47,6 +48,7 @@
"Day": "Päivä", "Day": "Päivä",
"Description": "Kuvaus", "Description": "Kuvaus",
"Discard changes": "Hylkää muutokset", "Discard changes": "Hylkää muutokset",
"Discard unsaved changes?": "Hylkäätkö tallentamattomat muutokset?",
"Do you want to start the day with Scandics famous breakfast buffé?": "Haluatko aloittaa päiväsi Scandicsin kuuluisalla aamiaisbuffella?", "Do you want to start the day with Scandics famous breakfast buffé?": "Haluatko aloittaa päiväsi Scandicsin kuuluisalla aamiaisbuffella?",
"Download the Scandic app": "Lataa Scandic-sovellus", "Download the Scandic app": "Lataa Scandic-sovellus",
"Edit": "Muokata", "Edit": "Muokata",
@@ -60,8 +62,8 @@
"Flexibility": "Joustavuus", "Flexibility": "Joustavuus",
"Former Scandic Hotel": "Entinen Scandic-hotelli", "Former Scandic Hotel": "Entinen Scandic-hotelli",
"From": "From", "From": "From",
"from your member profile?": "jäsenprofiilistasi?",
"Get inspired": "Inspiroidu", "Get inspired": "Inspiroidu",
"Go back to edit": "Palaa muokkaamaan",
"Go back to overview": "Palaa yleiskatsaukseen", "Go back to overview": "Palaa yleiskatsaukseen",
"Highest level": "Korkein taso", "Highest level": "Korkein taso",
"Hotel facilities": "Hotellin palvelut", "Hotel facilities": "Hotellin palvelut",
@@ -69,6 +71,7 @@
"How do you want to sleep?": "Kuinka haluat nukkua?", "How do you want to sleep?": "Kuinka haluat nukkua?",
"How it works": "Kuinka se toimii", "How it works": "Kuinka se toimii",
"Join Scandic Friends": "Liity jäseneksi", "Join Scandic Friends": "Liity jäseneksi",
"km to city center": "km keskustaan",
"Language": "Kieli", "Language": "Kieli",
"Level": "Level", "Level": "Level",
"Level 1": "Taso 1", "Level 1": "Taso 1",
@@ -78,7 +81,7 @@
"Level 5": "Taso 5", "Level 5": "Taso 5",
"Level 6": "Taso 6", "Level 6": "Taso 6",
"Level 7": "Taso 7", "Level 7": "Taso 7",
"Level up to unlock": "Nouse seuraavalle tasolle ja avaat seuraavan edun", "Level up to unlock": "Nosta taso avataksesi lukituksen",
"Log in": "Kirjaudu sisään", "Log in": "Kirjaudu sisään",
"Log in here": "Kirjaudu sisään", "Log in here": "Kirjaudu sisään",
"Log out": "Kirjaudu ulos", "Log out": "Kirjaudu ulos",
@@ -178,6 +181,7 @@
"Where to": "Minne", "Where to": "Minne",
"Which room class suits you the best?": "Mikä huoneluokka sopii sinulle parhaiten?", "Which room class suits you the best?": "Mikä huoneluokka sopii sinulle parhaiten?",
"Year": "Vuosi", "Year": "Vuosi",
"Yes, discard changes": "Kyllä, hylkää muutokset",
"Yes, remove my card": "Kyllä, poista korttini", "Yes, remove my card": "Kyllä, poista korttini",
"You canceled adding a new credit card.": "Peruutit uuden luottokortin lisäämisen.", "You canceled adding a new credit card.": "Peruutit uuden luottokortin lisäämisen.",
"You have no previous stays.": "Sinulla ei ole aiempia majoituksia.", "You have no previous stays.": "Sinulla ei ole aiempia majoituksia.",

View File

@@ -10,7 +10,8 @@
"Amenities": "Fasiliteter", "Amenities": "Fasiliteter",
"An error occurred when adding a credit card, please try again later.": "Det oppstod en feil ved å legge til et kredittkort. Prøv igjen senere.", "An error occurred when adding a credit card, please try again later.": "Det oppstod en feil ved å legge til et kredittkort. Prøv igjen senere.",
"An error occurred when trying to update profile.": "Det oppstod en feil under forsøk på å oppdatere profilen.", "An error occurred when trying to update profile.": "Det oppstod en feil under forsøk på å oppdatere profilen.",
"Are you sure you want to remove the card ending with": "Er du sikker på at du vil fjerne kortet som slutter på", "Any changes you've made will be lost.": "Eventuelle endringer du har gjort, går tapt.",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Er du sikker på at du vil fjerne kortet som slutter på {lastFourDigits} fra medlemsprofilen din?",
"Arrival date": "Ankomstdato", "Arrival date": "Ankomstdato",
"as of today": "per idag", "as of today": "per idag",
"As our": "Som vår {level}", "As our": "Som vår {level}",
@@ -47,6 +48,7 @@
"Day": "Dag", "Day": "Dag",
"Description": "Beskrivelse", "Description": "Beskrivelse",
"Discard changes": "Forkaste endringer", "Discard changes": "Forkaste endringer",
"Discard unsaved changes?": "Forkaste endringer som ikke er lagret?",
"Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte frokostbuffé?", "Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte frokostbuffé?",
"Download the Scandic app": "Last ned Scandic-appen", "Download the Scandic app": "Last ned Scandic-appen",
"Edit": "Redigere", "Edit": "Redigere",
@@ -60,8 +62,8 @@
"Flexibility": "Fleksibilitet", "Flexibility": "Fleksibilitet",
"Former Scandic Hotel": "Tidligere Scandic-hotell", "Former Scandic Hotel": "Tidligere Scandic-hotell",
"From": "Fra", "From": "Fra",
"from your member profile?": "fra medlemsprofilen din?",
"Get inspired": "Bli inspirert", "Get inspired": "Bli inspirert",
"Go back to edit": "Gå tilbake til redigering",
"Go back to overview": "Gå tilbake til oversikten", "Go back to overview": "Gå tilbake til oversikten",
"Highest level": "Høyeste nivå", "Highest level": "Høyeste nivå",
"Hotel facilities": "Hotelfaciliteter", "Hotel facilities": "Hotelfaciliteter",
@@ -69,6 +71,7 @@
"How do you want to sleep?": "Hvordan vil du sove?", "How do you want to sleep?": "Hvordan vil du sove?",
"How it works": "Hvordan det fungerer", "How it works": "Hvordan det fungerer",
"Join Scandic Friends": "Bli med i Scandic Friends", "Join Scandic Friends": "Bli med i Scandic Friends",
"km to city center": "km til sentrum",
"Language": "Språk", "Language": "Språk",
"Level": "Nivå", "Level": "Nivå",
"Level 1": "Nivå 1", "Level 1": "Nivå 1",
@@ -113,8 +116,8 @@
"Phone is required": "Telefon kreves", "Phone is required": "Telefon kreves",
"Phone number": "Telefonnummer", "Phone number": "Telefonnummer",
"Please enter a valid phone number": "Vennligst oppgi et gyldig telefonnummer", "Please enter a valid phone number": "Vennligst oppgi et gyldig telefonnummer",
"points": "poeng",
"Points": "Poeng", "Points": "Poeng",
"points": "Poeng",
"Points being calculated": "Poeng beregnes", "Points being calculated": "Poeng beregnes",
"Points earned prior to May 1, 2021": "Opptjente poeng før 1. mai 2021", "Points earned prior to May 1, 2021": "Opptjente poeng før 1. mai 2021",
"Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.", "Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.",
@@ -179,6 +182,7 @@
"Where to": "Hvor skal du", "Where to": "Hvor skal du",
"Which room class suits you the best?": "Hvilken romklasse passer deg best?", "Which room class suits you the best?": "Hvilken romklasse passer deg best?",
"Year": "År", "Year": "År",
"Yes, discard changes": "Ja, forkast endringer",
"Yes, remove my card": "Ja, fjern kortet mitt", "Yes, remove my card": "Ja, fjern kortet mitt",
"You canceled adding a new credit card.": "Du kansellerte å legge til et nytt kredittkort.", "You canceled adding a new credit card.": "Du kansellerte å legge til et nytt kredittkort.",
"You have no previous stays.": "Du har ingen tidligere opphold.", "You have no previous stays.": "Du har ingen tidligere opphold.",

View File

@@ -10,7 +10,8 @@
"Amenities": "Bekvämligheter", "Amenities": "Bekvämligheter",
"An error occurred when adding a credit card, please try again later.": "Ett fel uppstod när ett kreditkort lades till, försök igen senare.", "An error occurred when adding a credit card, please try again later.": "Ett fel uppstod när ett kreditkort lades till, försök igen senare.",
"An error occurred when trying to update profile.": "Ett fel uppstod när du försökte uppdatera profilen.", "An error occurred when trying to update profile.": "Ett fel uppstod när du försökte uppdatera profilen.",
"Are you sure you want to remove the card ending with": "Är du säker på att du vill ta bort kortet som slutar med", "Any changes you've made will be lost.": "Alla ändringar du har gjort kommer att gå förlorade.",
"Are you sure you want to remove the card ending with {lastFourDigits} from your member profile?": "Är du säker på att du vill ta bort kortet som slutar med {lastFourDigits} från din medlemsprofil?",
"Arrival date": "Ankomstdatum", "Arrival date": "Ankomstdatum",
"as of today": "från och med idag", "as of today": "från och med idag",
"As our": "Som vår {level}", "As our": "Som vår {level}",
@@ -47,6 +48,7 @@
"Day": "Dag", "Day": "Dag",
"Description": "Beskrivning", "Description": "Beskrivning",
"Discard changes": "Ignorera ändringar", "Discard changes": "Ignorera ändringar",
"Discard unsaved changes?": "Vill du ignorera ändringar som inte har sparats?",
"Do you want to start the day with Scandics famous breakfast buffé?": "Vill du starta dagen med Scandics berömda frukostbuffé?", "Do you want to start the day with Scandics famous breakfast buffé?": "Vill du starta dagen med Scandics berömda frukostbuffé?",
"Download the Scandic app": "Ladda ner Scandic-appen", "Download the Scandic app": "Ladda ner Scandic-appen",
"Edit": "Redigera", "Edit": "Redigera",
@@ -60,8 +62,8 @@
"Flexibility": "Flexibilitet", "Flexibility": "Flexibilitet",
"Former Scandic Hotel": "Tidigare Scandichotell", "Former Scandic Hotel": "Tidigare Scandichotell",
"From": "Från", "From": "Från",
"from your member profile?": "från din medlemsprofil?",
"Get inspired": "Bli inspirerad", "Get inspired": "Bli inspirerad",
"Go back to edit": "Gå tillbaka till redigeringen",
"Go back to overview": "Gå tillbaka till översikten", "Go back to overview": "Gå tillbaka till översikten",
"Highest level": "Högsta nivå", "Highest level": "Högsta nivå",
"Hotel facilities": "Hotellfaciliteter", "Hotel facilities": "Hotellfaciliteter",
@@ -71,6 +73,7 @@
"How do you want to sleep?": "Hur vill du sova?", "How do you want to sleep?": "Hur vill du sova?",
"How it works": "Hur det fungerar", "How it works": "Hur det fungerar",
"Join Scandic Friends": "Gå med i Scandic Friends", "Join Scandic Friends": "Gå med i Scandic Friends",
"km to city center": "km till stadens centrum",
"Language": "Språk", "Language": "Språk",
"Level": "Nivå", "Level": "Nivå",
"Level 1": "Nivå 1", "Level 1": "Nivå 1",
@@ -180,6 +183,7 @@
"Where to": "Vart", "Where to": "Vart",
"Which room class suits you the best?": "Vilken rumsklass passar dig bäst?", "Which room class suits you the best?": "Vilken rumsklass passar dig bäst?",
"Year": "År", "Year": "År",
"Yes, discard changes": "Ja, ignorera ändringar",
"Yes, remove my card": "Ja, ta bort mitt kort", "Yes, remove my card": "Ja, ta bort mitt kort",
"You canceled adding a new credit card.": "Du avbröt att lägga till ett nytt kreditkort.", "You canceled adding a new credit card.": "Du avbröt att lägga till ett nytt kreditkort.",
"You have no previous stays.": "Du har inga tidigare vistelser.", "You have no previous stays.": "Du har inga tidigare vistelser.",

View File

@@ -0,0 +1,10 @@
export interface DialogProps {
bodyText: string
cancelButtonText: string
proceedHref?: string
proceedIsPending?: boolean
proceedOnClick?: (close: () => void) => void
proceedText: string
titleText: string
triggerButtonText: React.ReactNode
}