-
{`${formatMessage({ id: "Total Points" })}*`}
+
{`${formatMessage({ id: "Your points" })}*`}
{`${formatMessage({ id: "Points" })}: ${membership ? membership.currentPoints : "N/A"}`}
diff --git a/components/MyPages/Blocks/Points/Overview/Points/index.tsx b/components/MyPages/Blocks/Points/Overview/Points/index.tsx
new file mode 100644
index 000000000..78c2da3a5
--- /dev/null
+++ b/components/MyPages/Blocks/Points/Overview/Points/index.tsx
@@ -0,0 +1,55 @@
+import {
+ MembershipLevelEnum,
+ membershipLevels,
+} from "@/constants/membershipLevels"
+
+import PointsContainer from "@/components/MyPages/Blocks/Overview/Stats/Points/Container"
+import {
+ NextLevelNightsColumn,
+ NextLevelPointsColumn,
+ StayOnLevelColumn,
+ YourPointsColumn,
+} from "@/components/MyPages/Blocks/Overview/Stats/Points/PointsColumn"
+import { getMembershipLevelObject } from "@/utils/membershipLevel"
+import { getMembership } from "@/utils/user"
+
+import { UserProps } from "@/types/components/myPages/user"
+import { LangParams } from "@/types/params"
+
+/* TODO */
+export default async function Points({ user, lang }: UserProps & LangParams) {
+ const membership = getMembership(user.memberships)
+ const nextLevel = getMembershipLevelObject(
+ membership?.nextLevel as MembershipLevelEnum,
+ lang
+ )
+
+ return (
+
+
+ {nextLevel && (
+ <>
+ {membership?.currentPoints ? (
+
+ ) : (
+ <>
+
+ {nextLevel?.level === membershipLevels.L7 && (
+
+ )}
+ >
+ )}
+ >
+ )}
+
+ )
+}
diff --git a/components/MyPages/Blocks/Points/Overview/index.tsx b/components/MyPages/Blocks/Points/Overview/index.tsx
new file mode 100644
index 000000000..0bd594352
--- /dev/null
+++ b/components/MyPages/Blocks/Points/Overview/index.tsx
@@ -0,0 +1,39 @@
+import { serverClient } from "@/lib/trpc/server"
+
+import SectionContainer from "@/components/Section/Container"
+import SectionHeader from "@/components/Section/Header"
+import SectionLink from "@/components/Section/Link"
+import Divider from "@/components/TempDesignSystem/Divider"
+
+import Friend from "../../Overview/Friend"
+import Hero from "../../Overview/Friend/Hero"
+import Stats from "../../Overview/Stats"
+
+import styles from "./overview.module.css"
+
+import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
+import type { LangParams } from "@/types/params"
+
+export default async function PointsOverview({
+ link,
+ subtitle,
+ title,
+ lang,
+}: AccountPageComponentProps & LangParams) {
+ const user = await serverClient().user.get()
+ if (!user) {
+ return null
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/components/MyPages/Blocks/Points/Overview/overview.module.css b/components/MyPages/Blocks/Points/Overview/overview.module.css
new file mode 100644
index 000000000..35c8c607a
--- /dev/null
+++ b/components/MyPages/Blocks/Points/Overview/overview.module.css
@@ -0,0 +1,9 @@
+.divider {
+ padding-top: var(--Spacing-x2);
+}
+
+@media screen and (min-width: 768px) {
+ .divider {
+ display: none;
+ }
+}
diff --git a/components/TempDesignSystem/Divider/divider.module.css b/components/TempDesignSystem/Divider/divider.module.css
index e4031ab65..80dac16d0 100644
--- a/components/TempDesignSystem/Divider/divider.module.css
+++ b/components/TempDesignSystem/Divider/divider.module.css
@@ -13,6 +13,10 @@
border-bottom-color: var(--Scandic-Brand-Burgundy);
}
+.pale {
+ border-bottom-color: var(--Primary-Dark-On-Surface-Text);
+}
+
.peach {
border-bottom-color: var(--Primary-Light-On-Surface-Divider);
}
diff --git a/components/TempDesignSystem/Divider/variants.ts b/components/TempDesignSystem/Divider/variants.ts
index 2bb604bf5..9c11e2c5a 100644
--- a/components/TempDesignSystem/Divider/variants.ts
+++ b/components/TempDesignSystem/Divider/variants.ts
@@ -10,6 +10,7 @@ export const dividerVariants = cva(styles.divider, {
beige: styles.beige,
white: styles.white,
subtle: styles.subtle,
+ pale: styles.pale,
},
opacity: {
100: styles.opacity100,
diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json
index 462e7cca1..ffafd9b1b 100644
--- a/i18n/dictionaries/da.json
+++ b/i18n/dictionaries/da.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "Alle værelser er udstyret med standardfaciliteter",
"Already a friend?": "Allerede en ven?",
"Arrival date": "Ankomstdato",
+ "as of today": "fra idag",
"As our": "Som vores",
"As our Close Friend": "Som vores nære ven",
"At the hotel": "På hotellet",
"Book": "Bestil",
"Booking number": "Bestillingsnummer",
+ "by": "inden",
"Cancel": "Afbestille",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tjek de kreditkort, der er gemt på din profil. Betal med et gemt kort, når du er logget ind for en mere jævn weboplevelse.",
"Choose room": "Vælg rum",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Kunne ikke finde den anmodede ressource",
"Country": "Land",
"Country code": "Landekode",
- "Current level": "Nuværende niveau",
+ "Your current level": "Dit nuværende niveau",
"Current password": "Nuværende kodeord",
"characters": "tegn",
"Date of Birth": "Fødselsdato",
@@ -41,6 +43,7 @@
"From": "Fra",
"Get inspired": "Blive inspireret",
"Go back to overview": "Gå tilbage til oversigten",
+ "Highest level": "Højeste niveau",
"How it works": "Hvordan det virker",
"Join Scandic Friends": "Tilmeld dig Scandic Friends",
"Language": "Sprog",
@@ -60,12 +63,13 @@
"My wishes": "Mine ønsker",
"New password": "Nyt kodeord",
"Next": "Næste",
- "Next level": "Næste niveau",
+ "next level:": "Næste niveau:",
"No content published": "Intet indhold offentliggjort",
"No transactions available": "Ingen tilgængelige transaktioner",
"Not found": "Ikke fundet",
"night": "nat",
"nights": "nætter",
+ "Nights needed to level up": "Nætter nødvendige for at komme i niveau",
"number": "nummer",
"On your journey": "På din rejse",
"Open": "Åben",
@@ -77,9 +81,10 @@
"Please enter a valid phone number": "Indtast venligst et gyldigt telefonnummer",
"Points": "Points",
"Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.",
- "Points until next level": "Point indtil næste niveau",
+ "Points needed to level up": "Point nødvendige for at komme i niveau",
+ "Points needed to stay on level": "Point nødvendige for at holde sig på niveau",
+ "points expiring by": "point udløber den",
"Previous victories": "Tidligere sejre",
- "points until next level": "point indtil næste niveau",
"Read more": "Læs mere",
"Read more about the hotel": "Læs mere om hotellet",
"Retype new password": "Gentag den nye adgangskode",
@@ -95,6 +100,7 @@
"Street": "Gade",
"special character": "speciel karakter",
"Total Points": "Samlet antal point",
+ "Your points": "Dine pointer",
"Transaction date": "Overførselsdato",
"Transactions": "Transaktioner",
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json
index 2d9bf6d6e..9021dfdec 100644
--- a/i18n/dictionaries/de.json
+++ b/i18n/dictionaries/de.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "Alle Zimmer sind mit den üblichen Annehmlichkeiten ausgestattet",
"Already a friend?": "Schon ein Freund?",
"Arrival date": "Ankunftsdatum",
+ "as of today": "Ab heute",
"As our": "Als unsere",
"As our Close Friend": "Als unser enger Freund",
"At the hotel": "Im Hotel",
"Book": "Buch",
"Booking number": "Buchungsnummer",
+ "by": "bis",
"Cancel": "Stornieren",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sehen Sie sich die in Ihrem Profil gespeicherten Kreditkarten an. Bezahlen Sie mit einer gespeicherten Karte, wenn Sie angemeldet sind, für ein reibungsloseres Web-Erlebnis.",
"Choose room": "Zimmer wählen",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Die angeforderte Ressource konnte nicht gefunden werden.",
"Country": "Land",
"Country code": "Landesvorwahl",
- "Current level": "Aktuelles Level",
+ "Your current level": "Ihr aktuelles Level",
"Current password": "Aktuelles Passwort",
"characters": "figuren",
"Date of Birth": "Geburtsdatum",
@@ -41,6 +43,7 @@
"From": "Fromm",
"Get inspired": "Lass dich inspirieren",
"Go back to overview": "Zurück zur Übersicht",
+ "Highest level": "Höchstes Level",
"How it works": "Wie es funktioniert",
"Join Scandic Friends": "Treten Sie Scandic Friends bei",
"Language": "Sprache",
@@ -60,12 +63,13 @@
"My wishes": "Meine Wünsche",
"New password": "Neues Kennwort",
"Next": "Nächste",
- "Next level": "Nächste Ebene",
+ "next level:": "Nächste Ebene:",
"No content published": "Kein Inhalt veröffentlicht",
"No transactions available": "Keine Transaktionen verfügbar",
"Not found": "Nicht gefunden",
"night": "nacht",
"nights": "nächte",
+ "Nights needed to level up": "Nächte, die zum Levelaufstieg benötigt werden",
"number": "nummer",
"On your journey": "Auf deiner Reise",
"Open": "Offen",
@@ -77,9 +81,10 @@
"Please enter a valid phone number": "Bitte geben Sie eine gültige Telefonnummer ein",
"Points": "Punkte",
"Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.",
- "Points until next level": "Punkte bis zum nächsten Level",
+ "Points needed to level up": "Punkte, die zum Levelaufstieg benötigt werden",
+ "Points needed to stay on level": "Erforderliche Punkte, um auf diesem Niveau zu bleiben",
+ "points expiring by": "punkte verfallen bis zum",
"Previous victories": "Bisherige Siege",
- "points until next level": "punkte bis zum nächsten Level",
"Read more": "Mehr lesen",
"Read more about the hotel": "Lesen Sie mehr über das Hotel",
"Retype new password": "Neues Passwort erneut eingeben",
@@ -95,6 +100,7 @@
"Street": "Straße",
"special character": "sonderzeichen",
"Total Points": "Gesamtpunktzahl",
+ "Your points": "Deine Punkte",
"Transaction date": "Transaktionsdatum",
"Transactions": "Transaktionen",
"Tripadvisor reviews": "{rating} ({count} Bewertungen auf Tripadvisor)",
diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json
index 2b3ebf24d..78b517806 100644
--- a/i18n/dictionaries/en.json
+++ b/i18n/dictionaries/en.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "All rooms comes with standard amenities",
"Already a friend?": "Already a friend?",
"Arrival date": "Arrival date",
+ "as of today": "as of today",
"As our": "As our",
"As our Close Friend": "As our Close Friend",
"At the hotel": "At the hotel",
"Book": "Book",
"Booking number": "Booking number",
+ "by": "by",
"Cancel": "Cancel",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.",
"Choose room": "Choose room",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Could not find requested resource",
"Country": "Country",
"Country code": "Country code",
- "Current level": "Current level",
+ "Your current level": "Your current level",
"Current password": "Current password",
"characters": "characters",
"Date of Birth": "Date of Birth",
@@ -46,6 +48,7 @@
"hotelPages.rooms.roomCard.person": "person",
"hotelPages.rooms.roomCard.persons": "persons",
"hotelPages.rooms.roomCard.seeRoomDetails": "See room details",
+ "Highest level": "Highest level",
"How it works": "How it works",
"Join Scandic Friends": "Join Scandic Friends",
"Language": "Language",
@@ -65,12 +68,13 @@
"My wishes": "My wishes",
"New password": "New password",
"Next": "Next",
- "Next level": "Next level",
+ "next level:": "next level:",
"No content published": "No content published",
"No transactions available": "No transactions available",
"Not found": "Not found",
"night": "night",
"nights": "nights",
+ "Nights needed to level up": "Nights needed to level up",
"number": "number",
"On your journey": "On your journey",
"Open": "Open",
@@ -82,9 +86,10 @@
"Please enter a valid phone number": "Please enter a valid phone number",
"Points": "Points",
"Points may take up to 10 days to be displayed.": "Points may take up to 10 days to be displayed.",
- "Points until next level": "Points until next level",
+ "Points needed to level up": "Points needed to level up",
+ "Points needed to stay on level": "Points needed to stay on level",
+ "points expiring by": "points expiring by",
"Previous victories": "Previous victories",
- "points until next level": "points until next level",
"Read more": "Read more",
"Read more about the hotel": "Read more about the hotel",
"Retype new password": "Retype new password",
@@ -100,6 +105,7 @@
"Street": "Street",
"special character": "special character",
"Total Points": "Total Points",
+ "Your points": "Your points",
"Transaction date": "Transaction date",
"Transactions": "Transactions",
"Tripadvisor reviews": "{rating} ({count} reviews on Tripadvisor)",
diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json
index d9b7a37ae..5e834587b 100644
--- a/i18n/dictionaries/fi.json
+++ b/i18n/dictionaries/fi.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "Kaikissa huoneissa on perusmukavuudet",
"Already a friend?": "Oletko jo ystävä?",
"Arrival date": "Saapumispäivä",
+ "as of today": "tästä päivästä lähtien",
"As our": "Kuin meidän",
"As our Close Friend": "Läheisenä ystävänämme",
"At the hotel": "Hotellissa",
"Book": "Kirja",
"Booking number": "Varausnumero",
+ "by": "mennessä",
"Cancel": "Peruuttaa",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Tarkista profiiliisi tallennetut luottokortit. Maksa tallennetulla kortilla kirjautuneena, jotta verkkokokemus on sujuvampi.",
"Choose room": "Valitse huone",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Pyydettyä resurssia ei löytynyt",
"Country": "Maa",
"Country code": "Maatunnus",
- "Current level": "Nykyinen taso",
+ "Your current level": "Nykyinen tasosi",
"Current password": "Nykyinen salasana",
"characters": "hahmoja",
"Date of Birth": "Syntymäaika",
@@ -41,6 +43,7 @@
"From": "From",
"Get inspired": "Inspiroidu",
"Go back to overview": "Palaa yleiskatsaukseen",
+ "Highest level": "Korkein taso",
"How it works": "Kuinka se toimii",
"Join Scandic Friends": "Liity Scandic Friends",
"Language": "Kieli",
@@ -60,12 +63,13 @@
"My wishes": "Toiveeni",
"New password": "Uusi salasana",
"Next": "Seuraava",
- "Next level": "Seuraava taso",
+ "next level:": "Seuraava taso:",
"No content published": "Ei julkaistua sisältöä",
"No transactions available": "Ei tapahtumia saatavilla",
"Not found": "Ei löydetty",
"night": "yö",
"nights": "yöt",
+ "Nights needed to level up": "Yöt, joita tarvitaan tasolle",
"number": "määrä",
"On your journey": "Matkallasi",
"Open": "Avata",
@@ -77,9 +81,10 @@
"Please enter a valid phone number": "Ole hyvä ja näppäile voimassaoleva puhelinnumero",
"Points": "Pisteet",
"Points may take up to 10 days to be displayed.": "Pisteiden näyttäminen voi kestää jopa 10 päivää.",
- "Points until next level": "Pisteitä seuraavalle tasolle",
+ "Points needed to level up": "Pisteitä tarvitaan tasolle pääsemiseksi",
+ "Points needed to stay on level": "Tällä tasolla pysymiseen tarvittavat pisteet",
+ "points expiring by": "pisteet vanhenevat viimeistään",
"Previous victories": "Edelliset voitot",
- "points until next level": "pisteitä seuraavalle tasolle",
"Read more": "Lue lisää",
"Read more about the hotel": "Lue lisää hotellista",
"Retype new password": "Kirjoita uusi salasana uudelleen",
@@ -95,6 +100,7 @@
"Street": "Katu",
"special character": "erikoishahmo",
"Total Points": "Kokonaispisteet",
+ "Your points": "Sinun pisteesi",
"Transaction date": "Tapahtuman päivämäärä",
"Transactions": "Tapahtumat",
"Tripadvisor reviews": "{rating} ({count} arvostelua TripAdvisorissa)",
diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json
index 2dfd04ba8..4fdb6f3ad 100644
--- a/i18n/dictionaries/no.json
+++ b/i18n/dictionaries/no.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "Alle rommene har standard fasiliteter",
"Already a friend?": "Allerede en venn?",
"Arrival date": "Ankomstdato",
+ "as of today": "per idag",
"As our": "Som vår",
"As our Close Friend": "Som vår nære venn",
"At the hotel": "På hotellet",
"Book": "Bok",
"Booking number": "Bestillingsnummer",
+ "by": "innen",
"Cancel": "Avbryt",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Sjekk ut kredittkortene som er lagret på profilen din. Betal med et lagret kort når du er pålogget for en jevnere nettopplevelse.",
"Choose room": "Velg rom",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Kunne ikke finne den forespurte ressursen",
"Country": "Land",
"Country code": "Landskode",
- "Current level": "Nåværende nivå",
+ "Your current level": "Ditt nåværende nivå",
"Current password": "Nåværende passord",
"characters": "tegn",
"Date of Birth": "Fødselsdato",
@@ -41,6 +43,7 @@
"From": "Fra",
"Get inspired": "Bli inspirert",
"Go back to overview": "Gå tilbake til oversikten",
+ "Highest level": "Høyeste nivå",
"How it works": "Hvordan det fungerer",
"Join Scandic Friends": "Bli med i Scandic Friends",
"Language": "Språk",
@@ -60,12 +63,13 @@
"My wishes": "Mine ønsker",
"New password": "Nytt passord",
"Next": "Neste",
- "Next level": "Neste nivå",
+ "next level:": "Neste nivå:",
"No content published": "Ingen innhold publisert",
"No transactions available": "Ingen transaksjoner tilgjengelig",
"Not found": "Ikke funnet",
"night": "natt",
"nights": "netter",
+ "Nights needed to level up": "Netter som trengs for å komme opp i nivå",
"number": "antall",
"On your journey": "På reisen din",
"Open": "Åpen",
@@ -77,9 +81,10 @@
"Please enter a valid phone number": "Vennligst oppgi et gyldig telefonnummer",
"Points": "Poeng",
"Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.",
- "Points until next level": "Poeng til neste nivå",
+ "Points needed to level up": "Poeng som trengs for å komme opp i nivå",
+ "Points needed to stay on level": "Poeng som trengs for å holde seg på nivå",
+ "points expiring by": "poeng utløper innen",
"Previous victories": "Tidligere seire",
- "points until next level": "poeng til neste nivå",
"Read more": "Les mer",
"Read more about the hotel": "Les mer om hotellet",
"Retype new password": "Skriv inn nytt passord på nytt",
@@ -95,6 +100,7 @@
"Street": "Gate",
"special character": "spesiell karakter",
"Total Points": "Totale poeng",
+ "Your points": "Dine poeng",
"Transaction date": "Transaksjonsdato",
"Transactions": "Transaksjoner",
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json
index e8e2d2260..88c001d26 100644
--- a/i18n/dictionaries/sv.json
+++ b/i18n/dictionaries/sv.json
@@ -5,11 +5,13 @@
"All rooms comes with standard amenities": "Alla rum har standardbekvämligheter",
"Already a friend?": "Redan en vän?",
"Arrival date": "Ankomstdatum",
+ "as of today": "från och med idag",
"As our": "Som vår",
"As our Close Friend": "Som vår nära vän",
"At the hotel": "På hotellet",
"Book": "Boka",
"Booking number": "Bokningsnummer",
+ "by": "innan",
"Cancel": "Avbryt",
"Check out the credit cards saved to your profile. Pay with a saved card when signed in for a smoother web experience.": "Kolla in kreditkorten som sparats i din profil. Betala med ett sparat kort när du är inloggad för en smidigare webbupplevelse.",
"Choose room": "Välj rum",
@@ -24,7 +26,7 @@
"Could not find requested resource": "Det gick inte att hitta den begärda resursen",
"Country": "Land",
"Country code": "Landskod",
- "Current level": "Nuvarande nivå",
+ "Your current level": "Din nuvarande nivå",
"Current password": "Nuvarande lösenord",
"characters": "tecken",
"Date of Birth": "Födelsedatum",
@@ -41,6 +43,7 @@
"From": "Från",
"Get inspired": "Bli inspirerad",
"Go back to overview": "Gå tillbaka till översikten",
+ "Highest level": "Högsta nivå",
"How it works": "Hur det fungerar",
"hotelPages.rooms.title": "Rum",
"hotelPages.rooms.roomCard.person": "person",
@@ -64,12 +67,13 @@
"My wishes": "Mina önskningar",
"New password": "Nytt lösenord",
"Next": "Nästa",
- "Next level": "Nästa nivå",
+ "next level:": "Nästa nivå:",
"No content published": "Inget innehåll publicerat",
"No transactions available": "Inga transaktioner tillgängliga",
"Not found": "Hittades inte",
"night": "natt",
"nights": "nätter",
+ "Nights needed to level up": "Nätter som behövs för att gå upp i nivå",
"number": "nummer",
"On your journey": "På din resa",
"Open": "Öppna",
@@ -81,9 +85,10 @@
"Please enter a valid phone number": "Var vänlig och ange ett giltigt telefonnummer",
"Points": "Poäng",
"Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.",
- "Points until next level": "Poäng till nästa nivå",
+ "Points needed to level up": "Poäng som behövs för att gå upp i nivå",
+ "Points needed to stay on level": "Poäng som behövs för att hålla sig på nivå",
+ "points expiring by": "poäng förfaller till",
"Previous victories": "Tidigare segrar",
- "points until next level": "poäng till nästa nivå",
"Read more": "Läs mer",
"Read more about the hotel": "Läs mer om hotellet",
"Retype new password": "Upprepa nytt lösenord",
@@ -99,6 +104,7 @@
"Street": "Gata",
"special character": "speciell karaktär",
"Total Points": "Total poäng",
+ "Your points": "Dina poäng",
"Transaction date": "Transaktionsdatum",
"Transactions": "Transaktioner",
"Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)",
diff --git a/server/routers/user/output.ts b/server/routers/user/output.ts
index 5a6638d0b..0ee142386 100644
--- a/server/routers/user/output.ts
+++ b/server/routers/user/output.ts
@@ -25,6 +25,8 @@ export const getUserSchema = z.object({
membershipLevel: z.nativeEnum(MembershipLevelEnum).optional(),
memberSince: z.string(),
membershipType: z.string(),
+ nextLevel: z.string().optional(),
+ pointsRequiredToNextlevel: z.number().optional(),
})
),
phoneNumber: z.string().optional(),
diff --git a/types/components/myPages/membershipLevel.ts b/types/components/myPages/membership.ts
similarity index 67%
rename from types/components/myPages/membershipLevel.ts
rename to types/components/myPages/membership.ts
index ae458ba79..ce352511f 100644
--- a/types/components/myPages/membershipLevel.ts
+++ b/types/components/myPages/membership.ts
@@ -3,3 +3,7 @@ import { membershipLevels } from "@/constants/membershipLevels"
export type MembershipLevelProps = {
level: membershipLevels
}
+
+export type CopyButtonProps = {
+ membershipNumber: string
+}
diff --git a/types/components/myPages/myPage/enums.ts b/types/components/myPages/myPage/enums.ts
index 5385bc1ac..294944620 100644
--- a/types/components/myPages/myPage/enums.ts
+++ b/types/components/myPages/myPage/enums.ts
@@ -1,5 +1,6 @@
export enum DynamicContentComponents {
membership_overview = "membership_overview",
+ points_overview = "points_overview",
soonest_stays = "soonest_stays",
previous_stays = "previous_stays",
upcoming_stays = "upcoming_stays",
diff --git a/types/components/myPages/points.ts b/types/components/myPages/points.ts
new file mode 100644
index 000000000..95d8486e5
--- /dev/null
+++ b/types/components/myPages/points.ts
@@ -0,0 +1,16 @@
+interface PointsOrNightColumn {
+ title?: string
+ subtitle?: string
+ subtitleParam?: string
+}
+
+export interface PointsColumn extends PointsOrNightColumn {
+ points: number | undefined
+ nights?: never
+}
+export interface NightsColumn extends PointsOrNightColumn {
+ points?: never
+ nights: number | undefined
+}
+
+export type PointsColumnProps = PointsColumn | NightsColumn
diff --git a/utils/membershipLevel.ts b/utils/membershipLevel.ts
index aa7d54135..2c1420a7f 100644
--- a/utils/membershipLevel.ts
+++ b/utils/membershipLevel.ts
@@ -8,13 +8,9 @@ import levelsData from "@/components/Loyalty/Blocks/DynamicContent/LoyaltyLevels
export function getMembershipLevelObject(
membershipLevel: MembershipLevelEnum,
- lang: Lang,
- level: "currentLevel" | "nextLevel" = "currentLevel"
+ lang: Lang
) {
- let levelNumber = membershipLevels[membershipLevel]
- if (level === "nextLevel") {
- levelNumber += 1
- }
-
- return levelsData[lang].levels.find((level) => level.level === levelNumber)
+ return levelsData[lang].levels.find(
+ (level) => level.level === membershipLevels[membershipLevel]
+ )
}
diff --git a/utils/user.ts b/utils/user.ts
index 57f4e3e16..25157fc80 100644
--- a/utils/user.ts
+++ b/utils/user.ts
@@ -1,5 +1,6 @@
import { z } from "zod"
+import { MembershipLevelEnum } from "@/constants/membershipLevels"
import { getMembershipCardsSchema } from "@/server/routers/user/output"
import { User } from "@/types/user"
@@ -29,6 +30,12 @@ export function getMembershipCards(
})
}
+export function isHighestMembership(
+ membershipLevel: MembershipLevelEnum | undefined
+) {
+ return membershipLevel == MembershipLevelEnum.L7
+}
+
export function getInitials(
firstName: User["firstName"],
lastName: User["lastName"]