From acc77625c837674d9b7a93d6a1d89684f50ffe4a Mon Sep 17 00:00:00 2001 From: Christian Andolf Date: Wed, 18 Jun 2025 13:57:37 +0200 Subject: [PATCH] feat(LOY-263): added new link to missing points form removed soonest stays for redundancy --- .../DynamicContent/Stays/Previous/index.tsx | 32 ++++++++++++++- .../Stays/Previous/previous.module.css | 22 +++++++++++ .../DynamicContent/Stays/Soonest/index.tsx | 39 ------------------- .../DynamicContent/Stays/Upcoming/index.tsx | 3 +- .../Blocks/DynamicContent/index.tsx | 2 - .../ButtonLink/buttonLink.module.css | 1 + 6 files changed, 54 insertions(+), 45 deletions(-) create mode 100644 apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/previous.module.css delete mode 100644 apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/index.tsx diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx index 3c5efd087..788bc2082 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx @@ -1,18 +1,25 @@ +import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import { Typography } from "@scandic-hotels/design-system/Typography" + import { serverClient } from "@/lib/trpc/server" +import ButtonLink from "@/components/ButtonLink" import SectionContainer from "@/components/Section/Container" import SectionHeader from "@/components/Section/Header" import SectionLink from "@/components/Section/Link" +import { getIntl } from "@/i18n" import ClientPreviousStays from "./Client" +import styles from "./previous.module.css" + import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" export default async function PreviousStays({ title, - subtitle, link, }: AccountPageComponentProps) { + const intl = await getIntl() const caller = await serverClient() const initialPreviousStays = await caller.user.stays.previous({ limit: 6, @@ -24,7 +31,28 @@ export default async function PreviousStays({ return ( - +
+ +
+ +

+ {intl.formatMessage({ + defaultMessage: "Missing a previous stay?", + })} +

+
+ + {intl.formatMessage({ defaultMessage: "Claim points" })} + + +
+
diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/previous.module.css b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/previous.module.css new file mode 100644 index 000000000..c3f0dfc1f --- /dev/null +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/previous.module.css @@ -0,0 +1,22 @@ +.header { + display: flex; + flex-direction: column; + justify-content: space-between; + gap: var(--Space-x1); +} + +.claim { + color: var(--Text-Secondary); + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--Space-x2); +} + +@media screen and (min-width: 1367px) { + .header { + align-items: center; + flex-direction: row; + gap: var(--Space-x6); + } +} diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/index.tsx deleted file mode 100644 index b72e0aea7..000000000 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Soonest/index.tsx +++ /dev/null @@ -1,39 +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 Grids from "@/components/TempDesignSystem/Grids" - -import EmptyUpcomingStaysBlock from "../EmptyUpcomingStays" -import StayCard from "../StayCard" - -import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage" - -export default async function SoonestStays({ - title, - subtitle, - link, -}: AccountPageComponentProps) { - const caller = await serverClient() - const upcomingStays = await caller.user.stays.upcoming({ limit: 3 }) - if (!upcomingStays?.data) { - return null - } - - return ( - - - {upcomingStays.data.length ? ( - - {upcomingStays.data.map((stay) => ( - - ))} - - ) : ( - - )} - - - ) -} diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx index 77f4df7dd..3186b07af 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/Upcoming/index.tsx @@ -13,7 +13,6 @@ import type { AccountPageComponentProps } from "@/types/components/myPages/myPag export default async function UpcomingStays({ title, - subtitle, link, }: AccountPageComponentProps) { const caller = await serverClient() @@ -23,7 +22,7 @@ export default async function UpcomingStays({ return ( - + {initialUpcomingStays?.data.length ? ( ) : ( diff --git a/apps/scandic-web/components/Blocks/DynamicContent/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/index.tsx index 6c4331e31..fa873cb94 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/index.tsx @@ -16,7 +16,6 @@ import SASTransferPoints from "@/components/Blocks/DynamicContent/SAS/TransferPo import SASTierComparisonBlock from "@/components/Blocks/DynamicContent/SASTierComparison" import SignupFormWrapper from "@/components/Blocks/DynamicContent/SignupFormWrapper" import PreviousStays from "@/components/Blocks/DynamicContent/Stays/Previous" -import SoonestStays from "@/components/Blocks/DynamicContent/Stays/Soonest" import UpcomingStays from "@/components/Blocks/DynamicContent/Stays/Upcoming" import LoadingSpinner from "@/components/LoadingSpinner" @@ -63,7 +62,6 @@ function DynamicContentBlocks(props: DynamicContentProps) { case DynamicContentEnum.Blocks.components.sign_up_form: return case DynamicContentEnum.Blocks.components.soonest_stays: - return case DynamicContentEnum.Blocks.components.upcoming_stays: return case DynamicContentEnum.Blocks.components.sas_linked_account: diff --git a/apps/scandic-web/components/ButtonLink/buttonLink.module.css b/apps/scandic-web/components/ButtonLink/buttonLink.module.css index d5726026c..2b3a1eb25 100644 --- a/apps/scandic-web/components/ButtonLink/buttonLink.module.css +++ b/apps/scandic-web/components/ButtonLink/buttonLink.module.css @@ -6,4 +6,5 @@ display: flex; align-items: center; justify-content: center; + gap: var(--Space-x05); }