From 2afab6a33d1df1405d407c8eb988561161594b4b Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 25 Jul 2024 16:04:35 +0200 Subject: [PATCH 01/13] feat: SW-65 Working on booking widget wrapper component --- actions/updateBookingWidget.ts | 56 +++++++++++++++++ .../BookingWidget/bookingWidget.module.css | 20 ++++++ components/BookingWidget/index.tsx | 62 +++++++++++++++++++ components/BookingWidget/schema.ts | 25 ++++++++ components/Current/Header/index.tsx | 7 +++ types/components/bookingWidget/index.ts | 5 ++ 6 files changed, 175 insertions(+) create mode 100644 actions/updateBookingWidget.ts create mode 100644 components/BookingWidget/bookingWidget.module.css create mode 100644 components/BookingWidget/index.tsx create mode 100644 components/BookingWidget/schema.ts create mode 100644 types/components/bookingWidget/index.ts diff --git a/actions/updateBookingWidget.ts b/actions/updateBookingWidget.ts new file mode 100644 index 000000000..f69df22d6 --- /dev/null +++ b/actions/updateBookingWidget.ts @@ -0,0 +1,56 @@ +"use server" +import { ZodError } from "zod" + +import { bookingWidgetSchema } from "@/components/BookingWidget/schema" + +import { type State, Status } from "@/types/components/myPages/myProfile/edit" + +export async function updateBookingWidget(_prevState: State, values: FormData) { + try { + const data: Record = Object.fromEntries(values.entries()) + + /** + * ToDo: Update the data parsing + */ + console.info(`Raw Data BW`) + console.log(data) + const parsedData = bookingWidgetSchema.safeParse(data) + if (parsedData.success) { + console.info(`Success`) + console.log(parsedData.data) + return { + message: "All good!", + status: Status.success, + } + } else { + console.error("Error parsing BW data") + console.error(parsedData.error) + return { + message: "Invalid data, parse failed!", + status: Status.error, + } + } + } catch (error) { + if (error instanceof ZodError) { + console.error(`ZodError handling profile edit`) + console.error(error) + + return { + errors: error.issues.map((issue) => ({ + message: `Server validation: ${issue.message}`, + path: issue.path.join("."), + })), + message: "Invalid form data", + status: Status.error, + } + } + + console.error(`EditProfile Server Action Error`) + console.error(error) + + return { + message: "Something went wrong. Please try again.", + status: Status.error, + } + } +} diff --git a/components/BookingWidget/bookingWidget.module.css b/components/BookingWidget/bookingWidget.module.css new file mode 100644 index 000000000..91c266932 --- /dev/null +++ b/components/BookingWidget/bookingWidget.module.css @@ -0,0 +1,20 @@ +.container { + display: none; + gap: var(--Spacing-x3); +} + +.form { + display: grid; + gap: var(--Spacing-x5); +} + +@media screen and (min-width: 1367px) { + .container { + display: grid; + padding: 0 var(--Spacing-x5); + } + .form { + grid-template-columns: auto auto auto auto auto auto; + align-items: center; + } +} diff --git a/components/BookingWidget/index.tsx b/components/BookingWidget/index.tsx new file mode 100644 index 000000000..6f1654f69 --- /dev/null +++ b/components/BookingWidget/index.tsx @@ -0,0 +1,62 @@ +"use client" +import { zodResolver } from "@hookform/resolvers/zod" +import { useFormState as useReactFormState } from "react-dom" +import { FormProvider, useForm } from "react-hook-form" + +import { updateBookingWidget } from "@/actions/updateBookingWidget" + +import { SearchWidget } from "../SearchWidget" +import Button from "../TempDesignSystem/Button" +import { type BookingWidgetSchema, bookingWidgetSchema } from "./schema" + +import styles from "./bookingWidget.module.css" + +import { State } from "@/types/components/myPages/myProfile/edit" + +export function BookingWidget() { + const [state, formAction] = useReactFormState( + updateBookingWidget, + null + ) + const methods = useForm({ + defaultValues: { + search: { + stayType: "", + stayValue: "", + }, + nights: { + fromDate: new Date(), + toDate: new Date(new Date().setDate(+1)), + }, + bookingCode: { + value: "", + }, + redemption: false, + voucher: false, + rooms: [ + { + Adults: 1, + Child: 0, + }, + ], + }, + mode: "all", + resolver: zodResolver(bookingWidgetSchema), + reValidateMode: "onChange", + }) + + return ( +
+
+ +
Search
+
Nights
+
Rooms
+
Bonus code
+
Bonus cheque or reward nights
+ +
+
+
+ ) +} diff --git a/components/BookingWidget/schema.ts b/components/BookingWidget/schema.ts new file mode 100644 index 000000000..5ce7f2d2a --- /dev/null +++ b/components/BookingWidget/schema.ts @@ -0,0 +1,25 @@ +import { z } from "zod" + +export const bookingWidgetSchema = z.object({ + search: z.object({ + stayType: z.string(), + stayValue: z.string(), + }), + nights: z.object({ + fromDate: z.date().default(new Date()), + toDate: z.date().default(new Date(new Date().setDate(+1))), + }), + bookingCode: z.object({ + value: z.string(), + }), + redemption: z.boolean().default(false), + voucher: z.boolean().default(false), + rooms: z.array( + z.object({ + Adults: z.number().default(1), + Child: z.number().default(0), + }) + ), +}) + +export type BookingWidgetSchema = z.infer diff --git a/components/Current/Header/index.tsx b/components/Current/Header/index.tsx index dd74dd4cb..0681d8354 100644 --- a/components/Current/Header/index.tsx +++ b/components/Current/Header/index.tsx @@ -4,6 +4,7 @@ import { serverClient } from "@/lib/trpc/server" import { auth } from "@/auth" +import { BookingWidget } from "../../BookingWidget" import { MainMenu } from "./MainMenu" import OfflineBanner from "./OfflineBanner" import TopMenu from "./TopMenu" @@ -25,6 +26,11 @@ export default async function Header({ const user = await serverClient().user.name() + /** + * ToDo: Create logic to get this info from ContentStack based on page + * */ + const hideBookingWidget = false + if (!data) { return null } @@ -58,6 +64,7 @@ export default async function Header({ user={user} lang={lang} /> + {hideBookingWidget ? null : } ) } diff --git a/types/components/bookingWidget/index.ts b/types/components/bookingWidget/index.ts new file mode 100644 index 000000000..457a9a1af --- /dev/null +++ b/types/components/bookingWidget/index.ts @@ -0,0 +1,5 @@ +import { BookingWidgetSchema } from "@/components/BookingWidget/schema" + +export type bwFormProps = { + data: BookingWidgetSchema +} From 6a26949faa5e61b53be6453b87b45738c7343c13 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Mon, 29 Jul 2024 15:13:29 +0200 Subject: [PATCH 02/13] SW-65 Hide booking widget for development --- actions/updateBookingWidget.ts | 2 +- components/BookingWidget/index.tsx | 1 - components/Current/Header/index.tsx | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/actions/updateBookingWidget.ts b/actions/updateBookingWidget.ts index f69df22d6..5370678d3 100644 --- a/actions/updateBookingWidget.ts +++ b/actions/updateBookingWidget.ts @@ -10,7 +10,7 @@ export async function updateBookingWidget(_prevState: State, values: FormData) { const data: Record = Object.fromEntries(values.entries()) /** - * ToDo: Update the data parsing + * ToDo: Update the data parsing and redirect User to respective booking flow page */ console.info(`Raw Data BW`) console.log(data) diff --git a/components/BookingWidget/index.tsx b/components/BookingWidget/index.tsx index 6f1654f69..fddb7b5c6 100644 --- a/components/BookingWidget/index.tsx +++ b/components/BookingWidget/index.tsx @@ -5,7 +5,6 @@ import { FormProvider, useForm } from "react-hook-form" import { updateBookingWidget } from "@/actions/updateBookingWidget" -import { SearchWidget } from "../SearchWidget" import Button from "../TempDesignSystem/Button" import { type BookingWidgetSchema, bookingWidgetSchema } from "./schema" diff --git a/components/Current/Header/index.tsx b/components/Current/Header/index.tsx index 0681d8354..b37111596 100644 --- a/components/Current/Header/index.tsx +++ b/components/Current/Header/index.tsx @@ -29,7 +29,7 @@ export default async function Header({ /** * ToDo: Create logic to get this info from ContentStack based on page * */ - const hideBookingWidget = false + const hideBookingWidget = true if (!data) { return null From fb5ba552e93f983514937c87852d498478b339a9 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 1 Aug 2024 13:40:18 +0200 Subject: [PATCH 03/13] SW-65 Removed action used onSubmit and dt lib --- actions/updateBookingWidget.ts | 56 ------------------------- components/BookingWidget/index.tsx | 27 ++++++------ components/BookingWidget/schema.ts | 9 ++-- lib/dt.ts | 2 + types/components/bookingWidget/index.ts | 5 --- 5 files changed, 19 insertions(+), 80 deletions(-) delete mode 100644 actions/updateBookingWidget.ts delete mode 100644 types/components/bookingWidget/index.ts diff --git a/actions/updateBookingWidget.ts b/actions/updateBookingWidget.ts deleted file mode 100644 index 5370678d3..000000000 --- a/actions/updateBookingWidget.ts +++ /dev/null @@ -1,56 +0,0 @@ -"use server" -import { ZodError } from "zod" - -import { bookingWidgetSchema } from "@/components/BookingWidget/schema" - -import { type State, Status } from "@/types/components/myPages/myProfile/edit" - -export async function updateBookingWidget(_prevState: State, values: FormData) { - try { - const data: Record = Object.fromEntries(values.entries()) - - /** - * ToDo: Update the data parsing and redirect User to respective booking flow page - */ - console.info(`Raw Data BW`) - console.log(data) - const parsedData = bookingWidgetSchema.safeParse(data) - if (parsedData.success) { - console.info(`Success`) - console.log(parsedData.data) - return { - message: "All good!", - status: Status.success, - } - } else { - console.error("Error parsing BW data") - console.error(parsedData.error) - return { - message: "Invalid data, parse failed!", - status: Status.error, - } - } - } catch (error) { - if (error instanceof ZodError) { - console.error(`ZodError handling profile edit`) - console.error(error) - - return { - errors: error.issues.map((issue) => ({ - message: `Server validation: ${issue.message}`, - path: issue.path.join("."), - })), - message: "Invalid form data", - status: Status.error, - } - } - - console.error(`EditProfile Server Action Error`) - console.error(error) - - return { - message: "Something went wrong. Please try again.", - status: Status.error, - } - } -} diff --git a/components/BookingWidget/index.tsx b/components/BookingWidget/index.tsx index fddb7b5c6..f4eebe601 100644 --- a/components/BookingWidget/index.tsx +++ b/components/BookingWidget/index.tsx @@ -1,22 +1,15 @@ "use client" import { zodResolver } from "@hookform/resolvers/zod" -import { useFormState as useReactFormState } from "react-dom" import { FormProvider, useForm } from "react-hook-form" -import { updateBookingWidget } from "@/actions/updateBookingWidget" +import { dt } from "@/lib/dt" import Button from "../TempDesignSystem/Button" import { type BookingWidgetSchema, bookingWidgetSchema } from "./schema" import styles from "./bookingWidget.module.css" -import { State } from "@/types/components/myPages/myProfile/edit" - export function BookingWidget() { - const [state, formAction] = useReactFormState( - updateBookingWidget, - null - ) const methods = useForm({ defaultValues: { search: { @@ -24,12 +17,12 @@ export function BookingWidget() { stayValue: "", }, nights: { - fromDate: new Date(), - toDate: new Date(new Date().setDate(+1)), - }, - bookingCode: { - value: "", + // UTC is required to handle requests from far away timezones https://scandichotels.atlassian.net/browse/SWAP-6375 & PET-507 + // This is specifically to handle timezones falling in different dates. + fromDate: dt().utc().format("DD/MM/YYYY"), + toDate: dt().utc().add(1, "day").format("DD/MM/YYYY"), }, + bookingCode: "", redemption: false, voucher: false, rooms: [ @@ -44,9 +37,15 @@ export function BookingWidget() { reValidateMode: "onChange", }) + function onSubmit(data: BookingWidgetSchema) { + console.log(data) + // Parse data and route accordignly to Select hotel or select room-rate page + console.log("to be routing") + } + return (
-
+
Search
Nights
diff --git a/components/BookingWidget/schema.ts b/components/BookingWidget/schema.ts index 5ce7f2d2a..39a06c78e 100644 --- a/components/BookingWidget/schema.ts +++ b/components/BookingWidget/schema.ts @@ -6,12 +6,11 @@ export const bookingWidgetSchema = z.object({ stayValue: z.string(), }), nights: z.object({ - fromDate: z.date().default(new Date()), - toDate: z.date().default(new Date(new Date().setDate(+1))), - }), - bookingCode: z.object({ - value: z.string(), + // Update this as required once started working with Date picker in Nights component + fromDate: z.string(), + toDate: z.string(), }), + bookingCode: z.string(), // Update this as required when working with booking codes component redemption: z.boolean().default(false), voucher: z.boolean().default(false), rooms: z.array( diff --git a/lib/dt.ts b/lib/dt.ts index f6e8faf0b..083032505 100644 --- a/lib/dt.ts +++ b/lib/dt.ts @@ -6,6 +6,7 @@ import "dayjs/locale/sv" import d from "dayjs" import isToday from "dayjs/plugin/isToday" import relativeTime from "dayjs/plugin/relativeTime" +import utc from "dayjs/plugin/utc" /** * dayjs export Norwegian as nb [Norwegian Bokmål] so here we create the same @@ -56,5 +57,6 @@ d.locale("no", { */ d.extend(isToday) d.extend(relativeTime) +d.extend(utc) export const dt = d diff --git a/types/components/bookingWidget/index.ts b/types/components/bookingWidget/index.ts deleted file mode 100644 index 457a9a1af..000000000 --- a/types/components/bookingWidget/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { BookingWidgetSchema } from "@/components/BookingWidget/schema" - -export type bwFormProps = { - data: BookingWidgetSchema -} From 23c97db9871d703e6e9e4370a32852dd479b0e5d Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 1 Aug 2024 13:51:37 +0200 Subject: [PATCH 04/13] SW-65 Optimized styles --- components/BookingWidget/bookingWidget.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/BookingWidget/bookingWidget.module.css b/components/BookingWidget/bookingWidget.module.css index 91c266932..712173d19 100644 --- a/components/BookingWidget/bookingWidget.module.css +++ b/components/BookingWidget/bookingWidget.module.css @@ -1,6 +1,5 @@ .container { display: none; - gap: var(--Spacing-x3); } .form { @@ -12,9 +11,10 @@ .container { display: grid; padding: 0 var(--Spacing-x5); + gap: var(--Spacing-x3); } .form { - grid-template-columns: auto auto auto auto auto auto; + grid-template-columns: repeat(6, auto); align-items: center; } } From 1dfcd144fb72f7d618d4df32a497af449c0dc784 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Thu, 1 Aug 2024 16:11:05 +0200 Subject: [PATCH 05/13] SW-65 Moved type to /types --- components/BookingWidget/index.tsx | 8 +++++--- components/BookingWidget/schema.ts | 12 ++++++++---- components/Current/Header/index.tsx | 2 +- types/components/bookingWidget/index.ts | 5 +++++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 types/components/bookingWidget/index.ts diff --git a/components/BookingWidget/index.tsx b/components/BookingWidget/index.tsx index f4eebe601..c3c32437b 100644 --- a/components/BookingWidget/index.tsx +++ b/components/BookingWidget/index.tsx @@ -5,10 +5,12 @@ import { FormProvider, useForm } from "react-hook-form" import { dt } from "@/lib/dt" import Button from "../TempDesignSystem/Button" -import { type BookingWidgetSchema, bookingWidgetSchema } from "./schema" +import { bookingWidgetSchema } from "./schema" import styles from "./bookingWidget.module.css" +import { type BookingWidgetSchema } from "@/types/components/bookingWidget" + export function BookingWidget() { const methods = useForm({ defaultValues: { @@ -27,8 +29,8 @@ export function BookingWidget() { voucher: false, rooms: [ { - Adults: 1, - Child: 0, + adults: 1, + childs: [], }, ], }, diff --git a/components/BookingWidget/schema.ts b/components/BookingWidget/schema.ts index 39a06c78e..057b5496e 100644 --- a/components/BookingWidget/schema.ts +++ b/components/BookingWidget/schema.ts @@ -14,11 +14,15 @@ export const bookingWidgetSchema = z.object({ redemption: z.boolean().default(false), voucher: z.boolean().default(false), rooms: z.array( + // This will be updated when working in guests component z.object({ - Adults: z.number().default(1), - Child: z.number().default(0), + adults: z.number().default(1), + childs: z.array( + z.object({ + age: z.number(), + bed: z.number(), + }) + ), }) ), }) - -export type BookingWidgetSchema = z.infer diff --git a/components/Current/Header/index.tsx b/components/Current/Header/index.tsx index b37111596..34e4db5ea 100644 --- a/components/Current/Header/index.tsx +++ b/components/Current/Header/index.tsx @@ -3,8 +3,8 @@ import { env } from "@/env/server" import { serverClient } from "@/lib/trpc/server" import { auth } from "@/auth" +import { BookingWidget } from "@/components/BookingWidget" -import { BookingWidget } from "../../BookingWidget" import { MainMenu } from "./MainMenu" import OfflineBanner from "./OfflineBanner" import TopMenu from "./TopMenu" diff --git a/types/components/bookingWidget/index.ts b/types/components/bookingWidget/index.ts new file mode 100644 index 000000000..94ef089d6 --- /dev/null +++ b/types/components/bookingWidget/index.ts @@ -0,0 +1,5 @@ +import { z } from "zod" + +import { bookingWidgetSchema } from "@/components/BookingWidget/schema" + +export type BookingWidgetSchema = z.infer From 937e625170451c91c9b3e9d1d6e30429ae365c3d Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Mon, 5 Aug 2024 12:42:06 +0200 Subject: [PATCH 06/13] feat: SW-65 Updated styles --- components/BookingWidget/bookingWidget.module.css | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/BookingWidget/bookingWidget.module.css b/components/BookingWidget/bookingWidget.module.css index 712173d19..0437c2c48 100644 --- a/components/BookingWidget/bookingWidget.module.css +++ b/components/BookingWidget/bookingWidget.module.css @@ -2,10 +2,9 @@ display: none; } -.form { - display: grid; - gap: var(--Spacing-x5); -} +/** +* Update the styles after mobile UX is ready +*/ @media screen and (min-width: 1367px) { .container { @@ -14,6 +13,8 @@ gap: var(--Spacing-x3); } .form { + display: grid; + gap: var(--Spacing-x5); grid-template-columns: repeat(6, auto); align-items: center; } From f35edcd6cbdf82dd858ece8f213076b3bc3aead3 Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Wed, 7 Aug 2024 14:46:00 +0200 Subject: [PATCH 07/13] feat(SW-65): Updated zod infer to output --- types/components/bookingWidget/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/components/bookingWidget/index.ts b/types/components/bookingWidget/index.ts index 94ef089d6..d6032dc3b 100644 --- a/types/components/bookingWidget/index.ts +++ b/types/components/bookingWidget/index.ts @@ -2,4 +2,4 @@ import { z } from "zod" import { bookingWidgetSchema } from "@/components/BookingWidget/schema" -export type BookingWidgetSchema = z.infer +export type BookingWidgetSchema = z.output From d0227cb5f52cf3e8b47ce5aff92b7475145b7597 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Wed, 7 Aug 2024 10:44:46 +0200 Subject: [PATCH 08/13] fix: correct the faulty values in Overview Table data --- .../Blocks/DynamicContent/OverviewTable/data/DA.json | 6 +++--- .../Blocks/DynamicContent/OverviewTable/data/DE.json | 6 +++--- .../Blocks/DynamicContent/OverviewTable/data/EN.json | 6 +++--- .../Blocks/DynamicContent/OverviewTable/data/FI.json | 6 +++--- .../Blocks/DynamicContent/OverviewTable/data/NO.json | 6 +++--- .../Blocks/DynamicContent/OverviewTable/data/SV.json | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DA.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DA.json index 26702c99d..36eb387e3 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DA.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DA.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "Du har været hos os på mange ophold, så derfor vil vi gerne give dig nogle af vores bedste bonusser.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "Vi er glade for, at du besøger os, uanset om det er høj- eller lavsæson. Derfor får du endnu flere skræddersyede fordele.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 nætter", "description": "Det bliver simpelthen ikke bedre end det her, når det kommer til de helt eksklusive oplevelser!", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DE.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DE.json index 749b7e1af..54711c163 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DE.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/DE.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "Sie haben uns während zahlreicher Aufenthalte, Happy Hours und Workouts im Fitnessstudio die Treue gehalten – deshalb wollen wir uns mit einigen unserer großartigsten Belohnungen bei Ihnen revanchieren.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "Es spielt keine Rolle, ob Haupt- oder Nebensaison: Sie sind immer für uns da. Genießen Sie noch mehr individuelle Vorteile – genau nach Ihrem Geschmack.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 nächte", "description": "Für eine Freundschaft wie diese gibt es im Grunde keine passenden Worte, aber wir versuchen es trotzdem: Denn es könnte gar nichts Besseres geben, wenn es um sehr, sehr exklusive Erlebnisse geht!", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/EN.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/EN.json index f852048db..ff27f8a62 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/EN.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/EN.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "You've stuck with us through stays, after works and gym sessions - so we'll stick with you through some of our very best rewards.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "It doesn't matter if it's peak or off season, you're always there for us. Enjoy even more tailored perks - just the way you like them.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 nights", "description": "There are no words for a bond like this, but here's a few anyway: It simply doesn't get any better when it comes to very, very exclusive experiences!", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/FI.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/FI.json index af8422628..0d37dac92 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/FI.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/FI.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "Kiva, että olemme saaneet jakaa paljon yhteisiä hetkiä. Olet tosiaan nimesi arvoinen Loyal Friend! Haluamme panostaa ystävyyteemme myös jatkossa ja annammekin sinulle kasan uusia, ihania etuja.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "Onpa ollut ihana nähdä sinua näin paljon viime aikoina. Tosiystävän tapaan haluamme palkita sinua entistä yksilöllisemmillä eduilla.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 yötä", "description": "Ystävyytemme on vailla vertaa. Koska sanat eivät riitä kiittämään ystävyydestämme, pääset nyt käsiksi kaikkein eksklusiivisimpiin elämyksiin.", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/NO.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/NO.json index 8b744a7da..8b5738d14 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/NO.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/NO.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "Du har vært lojal mot oss gjennom opphold, happy hours og treningsøkter – så vi er der for deg med noen av de aller beste fordelene våre.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "Det spiller ingen rolle om det er høysesong eller lavsesong, du er alltid der for oss. Nyt enda flere skreddersydde fordeler – akkurat slik du liker dem.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 netter", "description": "Det finnes ikke ord for et bånd som dette, men vi gjør et forsøk allikevel: Det blir bare ikke bedre når det gjelder svært eksklusive opplevelser!", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ diff --git a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/SV.json b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/SV.json index 31dd52f5d..df7e6eedf 100644 --- a/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/SV.json +++ b/components/Loyalty/Blocks/DynamicContent/OverviewTable/data/SV.json @@ -306,7 +306,7 @@ { "level": 5, "name": "Loyal Friend", - "requirement": "50 000p", + "requirement": "100 000p", "description": "Du har bott hos oss under otaliga resor, hängt med oss under sena timmar och genom ur och skur. Det är dags att du får några av våra allra bästa förmåner.", "icon": "/_static/icons/loyaltylevels/loyal-friend.svg", "benefits": [ @@ -383,7 +383,7 @@ { "level": 6, "name": "True Friend", - "requirement": "100 000p", + "requirement": "250 000p", "description": "Dig kan man lita på, oavsett tid på året finns du där för oss. Därför vill vi att du ska få njuta av fler förmåner anpassade efter dig, precis som du vill ha dem.", "icon": "/_static/icons/loyaltylevels/true-friend.svg", "benefits": [ @@ -460,7 +460,7 @@ { "level": 7, "name": "Best Friend", - "requirement": "400 000p", + "requirement": "400 000p / 100 nätter", "description": "Det finns inga ord för en vänskap som vår, men vi vill ändå säga: Bättre upplevelser än så här går inte att få, nu vi talar om riktigt exklusiva upplevelser!", "icon": "/_static/icons/loyaltylevels/best-friend.svg", "benefits": [ From 49ec390599db511da695ccb4da5c0fd5f951dfdd Mon Sep 17 00:00:00 2001 From: Michael Zetterberg Date: Fri, 9 Aug 2024 12:40:18 +0200 Subject: [PATCH 09/13] fix(SW-234): better empty state message for no transactions --- components/MyPages/Blocks/Points/EarnAndBurn/Mobile/index.tsx | 2 +- i18n/dictionaries/da.json | 2 +- i18n/dictionaries/de.json | 2 +- i18n/dictionaries/en.json | 2 +- i18n/dictionaries/fi.json | 2 +- i18n/dictionaries/no.json | 2 +- i18n/dictionaries/sv.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/MyPages/Blocks/Points/EarnAndBurn/Mobile/index.tsx b/components/MyPages/Blocks/Points/EarnAndBurn/Mobile/index.tsx index ad4e896e4..9dc880c78 100644 --- a/components/MyPages/Blocks/Points/EarnAndBurn/Mobile/index.tsx +++ b/components/MyPages/Blocks/Points/EarnAndBurn/Mobile/index.tsx @@ -48,7 +48,7 @@ export default async function MobileTable({ lang, transactions }: TableProps) { ) : ( - {formatMessage({ id: "Empty" })} + {formatMessage({ id: "There are no transactions to display" })} )} diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 5d81d6fb6..81a935b4a 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -41,7 +41,7 @@ "Edit": "Redigere", "Edit profile": "Rediger profil", "Email": "E-mail", - "Empty": "Empty", + "There are no transactions to display": "Der er ingen transaktioner at vise", "Explore all levels and benefits": "Udforsk alle niveauer og fordele", "Find booking": "Find booking", "Flexibility": "Fleksibilitet", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 1db259912..e83fbf21b 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -41,7 +41,7 @@ "Edit": "Bearbeiten", "Edit profile": "Profil bearbeiten", "Email": "Email", - "Empty": "Empty", + "There are no transactions to display": "Es sind keine Transaktionen zum Anzeigen vorhanden", "Explore all levels and benefits": "Entdecken Sie alle Levels und Vorteile", "Find booking": "Buchung finden", "Flexibility": "Flexibilität", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 6a3263509..d297a47d7 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -42,7 +42,7 @@ "Edit": "Edit", "Edit profile": "Edit profile", "Email": "Email", - "Empty": "Empty", + "There are no transactions to display": "There are no transactions to display", "Explore all levels and benefits": "Explore all levels and benefits", "Find booking": "Find booking", "Flexibility": "Flexibility", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index acec115ae..6ee8720ad 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -41,7 +41,7 @@ "Edit": "Muokata", "Edit profile": "Muokkaa profiilia", "Email": "Sähköposti", - "Empty": "Empty", + "There are no transactions to display": "Näytettäviä tapahtumia ei ole", "Explore all levels and benefits": "Tutustu kaikkiin tasoihin ja etuihin", "Find booking": "Etsi varaus", "Flexibility": "Joustavuus", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index 87ec73ab7..bd50e995b 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -41,7 +41,7 @@ "Edit": "Redigere", "Edit profile": "Rediger profil", "Email": "E-post", - "Empty": "Empty", + "There are no transactions to display": "Det er ingen transaksjoner å vise", "Explore all levels and benefits": "Utforsk alle nivåer og fordeler", "Find booking": "Finn booking", "Flexibility": "Fleksibilitet", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index be44e4402..446dd5c4d 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -41,7 +41,7 @@ "Edit": "Redigera", "Edit profile": "Redigera profil", "Email": "E-post", - "Empty": "Tom", + "There are no transactions to display": "Det finns inga transaktioner att visa", "Explore all levels and benefits": "Utforska alla nivåer och fördelar", "Find booking": "Hitta bokning", "Flexibility": "Flexibilitet", From c0bf09bf3f2e5387300221d60a3ac25c20d61755 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 9 Aug 2024 14:58:28 +0200 Subject: [PATCH 10/13] fix: change casing of some svg attributes to get rid of warnings --- components/Icons/ScandicLogo.tsx | 24 ++++++++++++------------ components/Icons/TripAdvisor.tsx | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/Icons/ScandicLogo.tsx b/components/Icons/ScandicLogo.tsx index 896eb367e..d3710f666 100644 --- a/components/Icons/ScandicLogo.tsx +++ b/components/Icons/ScandicLogo.tsx @@ -19,8 +19,8 @@ export default function ScandicLogoIcon({ {...props} > @@ -29,32 +29,32 @@ export default function ScandicLogoIcon({ fill="#CD092F" /> diff --git a/components/Icons/TripAdvisor.tsx b/components/Icons/TripAdvisor.tsx index 95a8e843c..a1fc6d416 100644 --- a/components/Icons/TripAdvisor.tsx +++ b/components/Icons/TripAdvisor.tsx @@ -31,8 +31,8 @@ export default function TripAdvisorIcon({ From 8592d7004bdf1c54de9fa96a80709cf5ce35e4a1 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 9 Aug 2024 09:58:01 +0200 Subject: [PATCH 11/13] 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 12/13] 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 13/13] 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)",