From 8592d7004bdf1c54de9fa96a80709cf5ce35e4a1 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 9 Aug 2024 09:58:01 +0200 Subject: [PATCH 1/3] fix(SW-248): update spendable points texts --- .../MyPages/Blocks/Overview/Stats/ExpiringPoints/index.tsx | 3 ++- .../Blocks/Overview/Stats/Points/PointsColumn/index.tsx | 2 +- i18n/dictionaries/da.json | 4 ++-- i18n/dictionaries/de.json | 4 ++-- i18n/dictionaries/en.json | 4 ++-- i18n/dictionaries/fi.json | 4 ++-- i18n/dictionaries/no.json | 4 ++-- i18n/dictionaries/sv.json | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/components/MyPages/Blocks/Overview/Stats/ExpiringPoints/index.tsx b/components/MyPages/Blocks/Overview/Stats/ExpiringPoints/index.tsx index 69cbc835c..179d01fbb 100644 --- a/components/MyPages/Blocks/Overview/Stats/ExpiringPoints/index.tsx +++ b/components/MyPages/Blocks/Overview/Stats/ExpiringPoints/index.tsx @@ -23,7 +23,8 @@ export default async function ExpiringPoints({ user }: UserProps) {
{formatter.format(membership.pointsToExpire)}{" "} - {formatMessage({ id: "points expiring by" })} {d.format("YYYY-MM-DD")} + {formatMessage({ id: "spendable points expiring by" })}{" "} + {d.format("YYYY-MM-DD")}
) diff --git a/components/MyPages/Blocks/Overview/Stats/Points/PointsColumn/index.tsx b/components/MyPages/Blocks/Overview/Stats/Points/PointsColumn/index.tsx index 09764eeed..6ae2d39cd 100644 --- a/components/MyPages/Blocks/Overview/Stats/Points/PointsColumn/index.tsx +++ b/components/MyPages/Blocks/Overview/Stats/Points/PointsColumn/index.tsx @@ -13,7 +13,7 @@ import type { export const YourPointsColumn = ({ points }: PointsColumn) => PointsColumn({ points, - title: "Your points", + title: "Your points to spend", subtitle: "as of today", }) diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 81a935b4a..e8ba46ac2 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.", "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", + "spendable points expiring by": "point udløber den", "Previous victories": "Tidligere sejre", "Read more": "Læs mere", "Read more about the hotel": "Læs mere om hotellet", @@ -106,7 +106,7 @@ "Street": "Gade", "special character": "speciel karakter", "Total Points": "Samlet antal point", - "Your points": "Dine pointer", + "Your points to spend": "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 e83fbf21b..9ed778220 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.", "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", + "spendable points expiring by": "punkte verfallen bis zum", "Previous victories": "Bisherige Siege", "Read more": "Mehr lesen", "Read more about the hotel": "Lesen Sie mehr über das Hotel", @@ -106,7 +106,7 @@ "Street": "Straße", "special character": "sonderzeichen", "Total Points": "Gesamtpunktzahl", - "Your points": "Deine Punkte", + "Your points to spend": "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 d297a47d7..b2f0d47eb 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -94,7 +94,7 @@ "Points may take up to 10 days to be displayed.": "Points may take up to 10 days to be displayed.", "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", + "spendable points expiring by": "spendable points expiring by", "Previous victories": "Previous victories", "Read more": "Read more", "Read more about the hotel": "Read more about the hotel", @@ -111,7 +111,7 @@ "Street": "Street", "special character": "special character", "Total Points": "Total Points", - "Your points": "Your points", + "Your points to spend": "Your points to spend", "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 6ee8720ad..dba1accef 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Pisteiden näyttäminen voi kestää jopa 10 päivää.", "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", + "spendable points expiring by": "pisteet vanhenevat viimeistään", "Previous victories": "Edelliset voitot", "Read more": "Lue lisää", "Read more about the hotel": "Lue lisää hotellista", @@ -106,7 +106,7 @@ "Street": "Katu", "special character": "erikoishahmo", "Total Points": "Kokonaispisteet", - "Your points": "Sinun pisteesi", + "Your points to spend": "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 bd50e995b..6e677b231 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.", "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", + "spendable points expiring by": "poeng utløper innen", "Previous victories": "Tidligere seire", "Read more": "Les mer", "Read more about the hotel": "Les mer om hotellet", @@ -106,7 +106,7 @@ "Street": "Gate", "special character": "spesiell karakter", "Total Points": "Totale poeng", - "Your points": "Dine poeng", + "Your points to spend": "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 446dd5c4d..c88850507 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -93,7 +93,7 @@ "Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.", "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", + "spendable points expiring by": "poäng förfaller till", "Previous victories": "Tidigare segrar", "Read more": "Läs mer", "Read more about the hotel": "Läs mer om hotellet", @@ -110,7 +110,7 @@ "Street": "Gata", "special character": "speciell karaktär", "Total Points": "Total poäng", - "Your points": "Dina poäng", + "Your points to spend": "Dina poäng", "Transaction date": "Transaktionsdatum", "Transactions": "Transaktioner", "Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)", From 1230df86d0271f8face0386e8d375286c827e308 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 9 Aug 2024 10:05:57 +0200 Subject: [PATCH 2/3] chore: remove obsolete CurrentPointsBalance component since unused --- components/MyPages/AccountPage/Content.tsx | 3 -- .../MyPages/AccountPage/Webview/Content.tsx | 3 -- .../currentPointsBalance.module.css | 20 --------- .../Points/CurrentPointsBalance/index.tsx | 41 ------------------- 4 files changed, 67 deletions(-) delete mode 100644 components/MyPages/Blocks/Points/CurrentPointsBalance/currentPointsBalance.module.css delete mode 100644 components/MyPages/Blocks/Points/CurrentPointsBalance/index.tsx diff --git a/components/MyPages/AccountPage/Content.tsx b/components/MyPages/AccountPage/Content.tsx index aa73adceb..2074e79b9 100644 --- a/components/MyPages/AccountPage/Content.tsx +++ b/components/MyPages/AccountPage/Content.tsx @@ -2,7 +2,6 @@ import JsonToHtml from "@/components/JsonToHtml" import CurrentBenefitsBlock from "@/components/MyPages/Blocks/Benefits/CurrentLevel" import NextLevelBenefitsBlock from "@/components/MyPages/Blocks/Benefits/NextLevel" import Overview from "@/components/MyPages/Blocks/Overview" -import CurrentPointsBalance from "@/components/MyPages/Blocks/Points/CurrentPointsBalance" import EarnAndBurn from "@/components/MyPages/Blocks/Points/EarnAndBurn" import Shortcuts from "@/components/MyPages/Blocks/Shortcuts" import PreviousStays from "@/components/MyPages/Blocks/Stays/Previous" @@ -37,8 +36,6 @@ function DynamicComponent({ component, props }: AccountPageContentProps) { return case DynamicContentComponents.next_benefits: return - case DynamicContentComponents.my_points: - return case DynamicContentComponents.expiring_points: // TODO: Add once available // return diff --git a/components/MyPages/AccountPage/Webview/Content.tsx b/components/MyPages/AccountPage/Webview/Content.tsx index 45899a42f..cae5312f3 100644 --- a/components/MyPages/AccountPage/Webview/Content.tsx +++ b/components/MyPages/AccountPage/Webview/Content.tsx @@ -6,7 +6,6 @@ import { modWebviewLink } from "@/utils/webviews" import CurrentBenefitsBlock from "../../Blocks/Benefits/CurrentLevel" import NextLevelBenefitsBlock from "../../Blocks/Benefits/NextLevel" -import CurrentPointsBalance from "../../Blocks/Points/CurrentPointsBalance" import EarnAndBurn from "../../Blocks/Points/EarnAndBurn" import PointsOverview from "../../Blocks/Points/Overview" @@ -29,8 +28,6 @@ function DynamicComponent({ component, props }: AccountPageContentProps) { return case DynamicContentComponents.next_benefits: return - case DynamicContentComponents.my_points: - return case DynamicContentComponents.expiring_points: // TODO: Add once available // return diff --git a/components/MyPages/Blocks/Points/CurrentPointsBalance/currentPointsBalance.module.css b/components/MyPages/Blocks/Points/CurrentPointsBalance/currentPointsBalance.module.css deleted file mode 100644 index 45d8eaab7..000000000 --- a/components/MyPages/Blocks/Points/CurrentPointsBalance/currentPointsBalance.module.css +++ /dev/null @@ -1,20 +0,0 @@ -.card { - background-color: var(--Scandic-Brand-Pale-Peach); - border-radius: var(--Corner-radius-xLarge); - color: var(--Main-Brand-Burgundy); - display: flex; - flex-direction: column; - align-items: center; - gap: var(--Spacing-x2); -} - -.points { - font-size: var(--typography-Title-2-Mobile-fontSize); - margin: 0; -} - -@media screen and (min-width: 768px) { - .points { - font-size: var(--typography-Title-2-Desktop-fontSize); - } -} diff --git a/components/MyPages/Blocks/Points/CurrentPointsBalance/index.tsx b/components/MyPages/Blocks/Points/CurrentPointsBalance/index.tsx deleted file mode 100644 index d92caceef..000000000 --- a/components/MyPages/Blocks/Points/CurrentPointsBalance/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -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 { getIntl } from "@/i18n" -import { getMembership } from "@/utils/user" - -import styles from "./currentPointsBalance.module.css" - -import { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" - -async function CurrentPointsBalance({ - title, - subtitle, - link, -}: AccountPageComponentProps) { - const user = await serverClient().user.get() - const { formatMessage } = await getIntl() - if (!user) { - return null - } - const membership = getMembership(user.memberships) - return ( - - -
-

{`${formatMessage({ id: "Your points" })}*`}

-

- {`${formatMessage({ id: "Points" })}: ${membership ? membership.currentPoints : "N/A"}`} -

-

- {`*${formatMessage({ id: "Points may take up to 10 days to be displayed." })}`} -

-
- -
- ) -} - -export default CurrentPointsBalance From 0aa97ba613d52306bf5c694b7568c38a4c2c6053 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 9 Aug 2024 15:36:14 +0200 Subject: [PATCH 3/3] chore: add translations --- i18n/dictionaries/da.json | 4 ++-- i18n/dictionaries/de.json | 2 +- i18n/dictionaries/fi.json | 4 ++-- i18n/dictionaries/no.json | 4 ++-- i18n/dictionaries/sv.json | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index e8ba46ac2..77f96b5de 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.", "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", - "spendable points expiring by": "point udløber den", + "spendable points expiring by": "Brugbare point udløber den", "Previous victories": "Tidligere sejre", "Read more": "Læs mere", "Read more about the hotel": "Læs mere om hotellet", @@ -106,7 +106,7 @@ "Street": "Gade", "special character": "speciel karakter", "Total Points": "Samlet antal point", - "Your points to spend": "Dine pointer", + "Your points to spend": "Dine brugbare 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 9ed778220..5f9c4e996 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.", "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", - "spendable points expiring by": "punkte verfallen bis zum", + "spendable points expiring by": "Einlösbare punkte verfallen bis zum", "Previous victories": "Bisherige Siege", "Read more": "Mehr lesen", "Read more about the hotel": "Lesen Sie mehr über das Hotel", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index dba1accef..d991b7630 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Pisteiden näyttäminen voi kestää jopa 10 päivää.", "Points needed to level up": "Pisteitä tarvitaan tasolle pääsemiseksi", "Points needed to stay on level": "Tällä tasolla pysymiseen tarvittavat pisteet", - "spendable points expiring by": "pisteet vanhenevat viimeistään", + "spendable points expiring by": "Käytettävät pisteet vanhenevat viimeistään", "Previous victories": "Edelliset voitot", "Read more": "Lue lisää", "Read more about the hotel": "Lue lisää hotellista", @@ -106,7 +106,7 @@ "Street": "Katu", "special character": "erikoishahmo", "Total Points": "Kokonaispisteet", - "Your points to spend": "Sinun pisteesi", + "Your points to spend": "Sinun pisteesi käytettäväksi", "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 6e677b231..2f0cb8e3e 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -89,7 +89,7 @@ "Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.", "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å", - "spendable points expiring by": "poeng utløper innen", + "spendable points expiring by": "Brukbare poeng utløper innen", "Previous victories": "Tidligere seire", "Read more": "Les mer", "Read more about the hotel": "Les mer om hotellet", @@ -106,7 +106,7 @@ "Street": "Gate", "special character": "spesiell karakter", "Total Points": "Totale poeng", - "Your points to spend": "Dine poeng", + "Your points to spend": "Dine brukbare 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 c88850507..a5bb53782 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -93,7 +93,7 @@ "Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.", "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å", - "spendable points expiring by": "poäng förfaller till", + "spendable points expiring by": "Spenderbara poäng förfaller till", "Previous victories": "Tidigare segrar", "Read more": "Läs mer", "Read more about the hotel": "Läs mer om hotellet", @@ -110,7 +110,7 @@ "Street": "Gata", "special character": "speciell karaktär", "Total Points": "Total poäng", - "Your points to spend": "Dina poäng", + "Your points to spend": "Dina spenderbara poäng", "Transaction date": "Transaktionsdatum", "Transactions": "Transaktioner", "Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)",