Merged in develop (pull request #398)
Promote to test Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
21
components/BookingWidget/bookingWidget.module.css
Normal file
21
components/BookingWidget/bookingWidget.module.css
Normal file
@@ -0,0 +1,21 @@
|
||||
.container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the styles after mobile UX is ready
|
||||
*/
|
||||
|
||||
@media screen and (min-width: 1367px) {
|
||||
.container {
|
||||
display: grid;
|
||||
padding: 0 var(--Spacing-x5);
|
||||
gap: var(--Spacing-x3);
|
||||
}
|
||||
.form {
|
||||
display: grid;
|
||||
gap: var(--Spacing-x5);
|
||||
grid-template-columns: repeat(6, auto);
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
62
components/BookingWidget/index.tsx
Normal file
62
components/BookingWidget/index.tsx
Normal file
@@ -0,0 +1,62 @@
|
||||
"use client"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import { FormProvider, useForm } from "react-hook-form"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Button from "../TempDesignSystem/Button"
|
||||
import { bookingWidgetSchema } from "./schema"
|
||||
|
||||
import styles from "./bookingWidget.module.css"
|
||||
|
||||
import { type BookingWidgetSchema } from "@/types/components/bookingWidget"
|
||||
|
||||
export function BookingWidget() {
|
||||
const methods = useForm<BookingWidgetSchema>({
|
||||
defaultValues: {
|
||||
search: {
|
||||
stayType: "",
|
||||
stayValue: "",
|
||||
},
|
||||
nights: {
|
||||
// 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: [
|
||||
{
|
||||
adults: 1,
|
||||
childs: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
mode: "all",
|
||||
resolver: zodResolver(bookingWidgetSchema),
|
||||
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 (
|
||||
<div id="booking-widget" className={styles.container}>
|
||||
<form onSubmit={methods.handleSubmit(onSubmit)} className={styles.form}>
|
||||
<FormProvider {...methods}>
|
||||
<div>Search</div>
|
||||
<div>Nights</div>
|
||||
<div>Rooms</div>
|
||||
<div>Bonus code</div>
|
||||
<div>Bonus cheque or reward nights</div>
|
||||
<Button type="submit">Search</Button>
|
||||
</FormProvider>
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
28
components/BookingWidget/schema.ts
Normal file
28
components/BookingWidget/schema.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const bookingWidgetSchema = z.object({
|
||||
search: z.object({
|
||||
stayType: z.string(),
|
||||
stayValue: z.string(),
|
||||
}),
|
||||
nights: z.object({
|
||||
// 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(
|
||||
// This will be updated when working in guests component
|
||||
z.object({
|
||||
adults: z.number().default(1),
|
||||
childs: z.array(
|
||||
z.object({
|
||||
age: z.number(),
|
||||
bed: z.number(),
|
||||
})
|
||||
),
|
||||
})
|
||||
),
|
||||
})
|
||||
@@ -3,6 +3,7 @@ import { env } from "@/env/server"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import { BookingWidget } from "@/components/BookingWidget"
|
||||
|
||||
import { MainMenu } from "./MainMenu"
|
||||
import OfflineBanner from "./OfflineBanner"
|
||||
@@ -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 = true
|
||||
|
||||
if (!data) {
|
||||
return null
|
||||
}
|
||||
@@ -58,6 +64,7 @@ export default async function Header({
|
||||
user={user}
|
||||
lang={lang}
|
||||
/>
|
||||
{hideBookingWidget ? null : <BookingWidget />}
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ export default function ScandicLogoIcon({
|
||||
{...props}
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M16.2989 11.7377C15.5103 11.9344 14.7216 12 13.9329 12C11.1068 12 9.2666 10.6886 9.2666 7.60673C9.2666 4.65601 11.1726 3.41016 13.8672 3.41016C14.6559 3.41016 15.4445 3.47573 16.2332 3.60687V5.04944C15.6417 4.98387 15.1816 4.9183 14.6559 4.9183C12.487 4.9183 11.4354 5.57401 11.4354 7.73787C11.4354 9.77058 12.4213 10.4919 14.6559 10.4919C15.2474 10.4919 15.7074 10.4263 16.2332 10.3607V11.7377H16.2989Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
@@ -29,32 +29,32 @@ export default function ScandicLogoIcon({
|
||||
fill="#CD092F"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M43.7049 11.6061C43.3105 11.6717 41.8646 11.934 40.4187 11.934C37.7241 11.934 35.7524 10.6881 35.7524 7.67186C35.7524 4.78672 37.527 3.34414 40.2216 3.34414C40.6159 3.34414 41.2731 3.40971 41.6018 3.40971V0H43.7049C43.7049 0.393429 43.7049 11.4094 43.7049 11.6061ZM41.6675 10.3603V4.98343C41.4046 4.98343 40.9445 4.91786 40.4845 4.91786C38.5785 4.91786 37.8556 5.83586 37.8556 7.73743C37.8556 9.44229 38.5128 10.4914 40.4187 10.4914C40.8131 10.4914 41.2074 10.4259 41.6675 10.3603Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M34.3727 11.8033H32.3353V6.36087C32.3353 5.44287 31.9409 4.9183 30.6265 4.9183C29.7063 4.9183 28.7205 5.11501 28.7205 5.11501V11.8033H26.6831V3.80359C26.8146 3.80359 29.4435 3.41016 30.9551 3.41016C32.7953 3.41016 34.4384 3.73801 34.4384 6.22973V11.8033H34.3727Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M24.9744 11.8025C23.5285 11.9336 22.4112 11.9992 21.1625 11.9992C19.0594 11.9992 17.3506 11.6713 17.3506 9.31075C17.3506 7.01575 19.4537 6.88461 21.3597 6.81904C21.8197 6.81904 22.3455 6.81904 22.8713 6.81904C22.8713 5.37646 22.8056 4.85189 20.7024 4.85189C19.6509 4.85189 18.5336 5.04861 17.8764 5.17975V3.67161C18.665 3.47489 19.9138 3.40932 20.8339 3.34375C23.1999 3.34375 24.9744 3.60604 24.9744 6.09775V11.8025ZM22.8713 10.5566V8.19604C22.477 8.19604 21.754 8.19604 21.4911 8.19604C20.2424 8.19604 19.4537 8.26161 19.4537 9.44189C19.4537 10.6222 20.4396 10.6877 21.4254 10.6877C22.0169 10.6222 22.3455 10.6222 22.8713 10.5566Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M55.8629 11.7377C55.0742 11.9344 54.2855 12 53.4969 12C50.6708 12 48.8306 10.6886 48.8306 7.60673C48.8306 4.65601 50.7365 3.41016 53.4312 3.41016C54.2198 3.41016 55.0085 3.47573 55.7972 3.60687V5.04944C55.2057 4.98387 54.7456 4.9183 54.2198 4.9183C52.051 4.9183 50.9994 5.57401 50.9994 7.73787C50.9994 9.77058 51.9853 10.4919 54.2198 10.4919C54.8113 10.4919 55.2714 10.4263 55.7972 10.3607V11.7377H55.8629Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M8.21534 8.52287C8.21534 10.949 6.30938 11.9982 3.4833 11.9982C1.64307 11.9982 0.328613 11.6703 0.131445 11.6047V9.89987C0.788672 10.031 2.16885 10.3589 3.35186 10.3589C4.53487 10.3589 6.04649 10.0966 6.04649 8.78515C6.04649 7.93272 5.38926 7.60487 4.20625 7.27701C3.74619 7.14587 3.28613 7.01472 2.82608 6.88358C1.24873 6.42458 0 5.76887 0 3.93287C0 1.31001 2.10313 0.654297 4.53487 0.654297C5.98076 0.654297 7.16377 0.916583 7.36094 0.982154V2.55587C7.09805 2.4903 5.98076 2.22801 4.73203 2.22801C3.54903 2.22801 2.16885 2.35915 2.16885 3.67058C2.16885 4.65415 2.95752 4.91644 4.07481 5.17873C4.60059 5.37544 5.12637 5.44101 5.65215 5.63773C7.03233 6.03115 8.21534 6.68687 8.21534 8.52287Z"
|
||||
fill="#CD092F"
|
||||
/>
|
||||
|
||||
@@ -31,8 +31,8 @@ export default function TripAdvisorIcon({
|
||||
</mask>
|
||||
<g mask="url(#mask0_3856_6685)">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
fillRule="evenodd"
|
||||
clipRule="evenodd"
|
||||
d="M9.05211 12.7618C9.05211 13.6531 8.29824 14.3757 7.3683 14.3757C6.43836 14.3757 5.68449 13.6531 5.68449 12.7618C5.68449 11.8705 6.43836 11.148 7.3683 11.148C8.29809 11.1473 9.05234 11.8692 9.05299 12.7604V12.7618H9.05211ZM16.8618 11.148C15.9318 11.148 15.1779 11.8705 15.1779 12.7618C15.1779 13.6531 15.9318 14.3757 16.8618 14.3757C17.7917 14.3757 18.5456 13.6531 18.5456 12.7618C18.5456 11.8705 17.7917 11.148 16.8618 11.148ZM16.8618 15.8404C15.0878 15.8404 13.6497 14.4621 13.6497 12.7618C13.6497 11.0615 15.0878 9.6832 16.8618 9.6832C18.6357 9.6832 20.0738 11.0615 20.0738 12.7618C20.0738 14.4621 18.6357 15.8404 16.8618 15.8404ZM12.1165 12.673C12.1165 10.6472 10.5782 8.90887 8.55158 8.16488C10.833 7.25401 13.3994 7.25401 15.6808 8.16488C13.6536 8.90915 12.1165 10.6472 12.1165 12.673ZM7.36919 15.8404C5.59524 15.8404 4.15717 14.4621 4.15717 12.7618C4.15717 11.0615 5.59524 9.6832 7.36919 9.6832C9.14313 9.6832 10.5812 11.0615 10.5812 12.7618C10.5812 14.4621 9.14313 15.8404 7.36919 15.8404ZM20.0619 9.39966L21.615 7.78013H18.1719C14.5206 5.39849 9.72128 5.39849 6.06994 7.78013H2.61802L4.17108 9.39966C2.2302 11.0885 2.08519 13.9656 3.84718 15.8258C5.60917 17.6862 8.61095 17.8251 10.5518 16.1363C10.5663 16.1237 10.5805 16.1111 10.5948 16.0984L12.1165 17.6862L13.6373 16.1004C14.5135 16.8807 15.6657 17.3138 16.8618 17.3122C19.483 17.3122 21.61 15.2753 21.61 12.7629C21.6119 11.4828 21.0497 10.2613 20.0619 9.39966Z"
|
||||
fill="#26201E"
|
||||
/>
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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 <CurrentBenefitsBlock {...props} />
|
||||
case DynamicContentComponents.next_benefits:
|
||||
return <NextLevelBenefitsBlock {...props} />
|
||||
case DynamicContentComponents.my_points:
|
||||
return <CurrentPointsBalance {...props} />
|
||||
case DynamicContentComponents.expiring_points:
|
||||
// TODO: Add once available
|
||||
// return <ExpiringPoints />
|
||||
|
||||
@@ -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 <CurrentBenefitsBlock {...props} />
|
||||
case DynamicContentComponents.next_benefits:
|
||||
return <NextLevelBenefitsBlock {...props} />
|
||||
case DynamicContentComponents.my_points:
|
||||
return <CurrentPointsBalance {...props} />
|
||||
case DynamicContentComponents.expiring_points:
|
||||
// TODO: Add once available
|
||||
// return <ExpiringPoints />
|
||||
|
||||
@@ -23,7 +23,8 @@ export default async function ExpiringPoints({ user }: UserProps) {
|
||||
<section>
|
||||
<Body color="white" textTransform="bold" textAlign="center">
|
||||
{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")}
|
||||
</Body>
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -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",
|
||||
})
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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 (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={title} link={link} subtitle={subtitle} />
|
||||
<div className={styles.card}>
|
||||
<h2>{`${formatMessage({ id: "Your points" })}*`}</h2>
|
||||
<p className={styles.points}>
|
||||
{`${formatMessage({ id: "Points" })}: ${membership ? membership.currentPoints : "N/A"}`}
|
||||
</p>
|
||||
<p>
|
||||
{`*${formatMessage({ id: "Points may take up to 10 days to be displayed." })}`}
|
||||
</p>
|
||||
</div>
|
||||
<SectionLink link={link} variant="mobile" />
|
||||
</SectionContainer>
|
||||
)
|
||||
}
|
||||
|
||||
export default CurrentPointsBalance
|
||||
@@ -48,7 +48,7 @@ export default async function MobileTable({ lang, transactions }: TableProps) {
|
||||
) : (
|
||||
<tr>
|
||||
<td className={styles.placeholder} colSpan={2}>
|
||||
{formatMessage({ id: "Empty" })}
|
||||
{formatMessage({ id: "There are no transactions to display" })}
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
|
||||
@@ -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",
|
||||
@@ -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": "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": "Dine pointer",
|
||||
"Your points to spend": "Dine brugbare pointer",
|
||||
"Transaction date": "Overførselsdato",
|
||||
"Transactions": "Transaktioner",
|
||||
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
||||
|
||||
@@ -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",
|
||||
@@ -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": "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",
|
||||
@@ -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)",
|
||||
|
||||
@@ -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",
|
||||
@@ -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)",
|
||||
|
||||
@@ -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",
|
||||
@@ -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": "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": "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)",
|
||||
|
||||
@@ -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",
|
||||
@@ -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": "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": "Dine poeng",
|
||||
"Your points to spend": "Dine brukbare poeng",
|
||||
"Transaction date": "Transaksjonsdato",
|
||||
"Transactions": "Transaksjoner",
|
||||
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
||||
|
||||
@@ -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",
|
||||
@@ -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": "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": "Dina poäng",
|
||||
"Your points to spend": "Dina spenderbara poäng",
|
||||
"Transaction date": "Transaktionsdatum",
|
||||
"Transactions": "Transaktioner",
|
||||
"Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)",
|
||||
|
||||
@@ -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
|
||||
|
||||
5
types/components/bookingWidget/index.ts
Normal file
5
types/components/bookingWidget/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { bookingWidgetSchema } from "@/components/BookingWidget/schema"
|
||||
|
||||
export type BookingWidgetSchema = z.output<typeof bookingWidgetSchema>
|
||||
Reference in New Issue
Block a user