From 76994f6e013f85a01a4b4a844c1cf931d2b7a2d0 Mon Sep 17 00:00:00 2001 From: Christian Andolf Date: Wed, 21 May 2025 16:34:56 +0200 Subject: [PATCH] fix: replace temp design system components with design system package in surprises --- .../components/MyPages/Surprises/Card.tsx | 9 ++- .../components/MyPages/Surprises/Client.tsx | 27 ++++--- .../components/MyPages/Surprises/Initial.tsx | 77 ++++++++++--------- .../MyPages/Surprises/Navigation.tsx | 19 +++-- .../components/MyPages/Surprises/Slide.tsx | 9 ++- .../MyPages/Surprises/surprises.module.css | 27 +++++-- .../Rewards/ExpirationDate/index.tsx | 31 ++++---- 7 files changed, 113 insertions(+), 86 deletions(-) diff --git a/apps/scandic-web/components/MyPages/Surprises/Card.tsx b/apps/scandic-web/components/MyPages/Surprises/Card.tsx index 23f39250f..52709406d 100644 --- a/apps/scandic-web/components/MyPages/Surprises/Card.tsx +++ b/apps/scandic-web/components/MyPages/Surprises/Card.tsx @@ -1,7 +1,8 @@ import { useIntl } from "react-intl" +import { Typography } from "@scandic-hotels/design-system/Typography" + import Image from "@/components/Image" -import Title from "@/components/TempDesignSystem/Text/Title" import styles from "./surprises.module.css" @@ -21,9 +22,9 @@ export default function Card({ title, children }: CardProps) { })} />
- - {title} - + +

{title}

+
{children} diff --git a/apps/scandic-web/components/MyPages/Surprises/Client.tsx b/apps/scandic-web/components/MyPages/Surprises/Client.tsx index bfb40dbf6..c4882409e 100644 --- a/apps/scandic-web/components/MyPages/Surprises/Client.tsx +++ b/apps/scandic-web/components/MyPages/Surprises/Client.tsx @@ -6,6 +6,8 @@ import React, { useState } from "react" import { Dialog, Modal, ModalOverlay } from "react-aria-components" import { useIntl } from "react-intl" +import { Typography } from "@scandic-hotels/design-system/Typography" + import { benefits } from "@/constants/routes/myPages" import { benefits as webviewBenefits, @@ -15,7 +17,6 @@ import { customerService } from "@/constants/webHrefs" import { trpc } from "@/lib/trpc/client" import Link from "@/components/TempDesignSystem/Link" -import Caption from "@/components/TempDesignSystem/Text/Caption" import { toast } from "@/components/TempDesignSystem/Toasts" import useLang from "@/hooks/useLang" @@ -186,17 +187,19 @@ export default function SurprisesNotification({ }} > {showSurprises && totalSurprises > 1 && ( - - {intl.formatMessage( - { - defaultMessage: "{amount} out of {total}", - }, - { - amount: selectedSurprise + 1, - total: totalSurprises, - } - )} - + +

+ {intl.formatMessage( + { + defaultMessage: "{amount} out of {total}", + }, + { + amount: selectedSurprise + 1, + total: totalSurprises, + } + )} +

+
)} diff --git a/apps/scandic-web/components/MyPages/Surprises/Initial.tsx b/apps/scandic-web/components/MyPages/Surprises/Initial.tsx index 7827ac8ed..64a3a6cc3 100644 --- a/apps/scandic-web/components/MyPages/Surprises/Initial.tsx +++ b/apps/scandic-web/components/MyPages/Surprises/Initial.tsx @@ -1,11 +1,12 @@ import { useIntl } from "react-intl" -import Button from "@/components/TempDesignSystem/Button" -import Body from "@/components/TempDesignSystem/Text/Body" -import Caption from "@/components/TempDesignSystem/Text/Caption" +import { Button } from "@scandic-hotels/design-system/Button" +import { Typography } from "@scandic-hotels/design-system/Typography" import Card from "./Card" +import styles from "./surprises.module.css" + import type { InitialProps } from "@/types/components/blocks/surprises" export default function Initial({ totalSurprises, onOpen }: InitialProps) { @@ -17,43 +18,47 @@ export default function Initial({ totalSurprises, onOpen }: InitialProps) { defaultMessage: "Surprise!", })} > - - {totalSurprises > 1 ? ( - <> - {intl.formatMessage( - { - defaultMessage: - "You have {amount} gifts waiting for you!", - }, - { - amount: totalSurprises, - b: (str) => {str}, - } - )} -
- {intl.formatMessage({ - defaultMessage: "Hurry up and use them before they expire!", - })} - - ) : ( - intl.formatMessage({ - defaultMessage: "We have a special gift waiting for you!", - }) - )} - - - {intl.formatMessage({ - defaultMessage: "You'll find all your gifts in 'My benefits'", - })} - + +

+ {totalSurprises > 1 ? ( + <> + {intl.formatMessage( + { + defaultMessage: + "You have {amount} gifts waiting for you!", + }, + { + amount: totalSurprises, + b: (str) => {str}, + } + )} +
+ {intl.formatMessage({ + defaultMessage: "Hurry up and use them before they expire!", + })} + + ) : ( + intl.formatMessage({ + defaultMessage: "We have a special gift waiting for you!", + }) + )} +

+
+ +

+ {intl.formatMessage({ + defaultMessage: "You'll find all your gifts in 'My benefits'", + })} +

+