Merged in feat/LOY-263-add-link-missing-points-form (pull request #2392)
Feat/LOY-263 add link missing points form Approved-by: Erik Tiekstra
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
.claim {
|
||||
color: var(--Text-Secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--Space-x2);
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
"use client"
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { missingPoints } from "@/constants/missingPointsHrefs"
|
||||
|
||||
import ButtonLink from "@/components/ButtonLink"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import styles from "./claimPoints.module.css"
|
||||
|
||||
export default function ClaimPoints() {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
|
||||
return (
|
||||
<div className={styles.claim}>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Missing a previous stay?",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<ButtonLink
|
||||
href={missingPoints[lang]}
|
||||
variant="Text"
|
||||
target="_blank"
|
||||
size="Small"
|
||||
typography="Body/Supporting text (caption)/smBold"
|
||||
>
|
||||
{intl.formatMessage({ defaultMessage: "Claim points" })}
|
||||
<MaterialIcon icon="open_in_new" size={20} color="CurrentColor" />
|
||||
</ButtonLink>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
gap: var(--Space-x1);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1367px) {
|
||||
.header {
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
gap: var(--Space-x6);
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,11 @@ import SectionContainer from "@/components/Section/Container"
|
||||
import SectionHeader from "@/components/Section/Header"
|
||||
import SectionLink from "@/components/Section/Link"
|
||||
|
||||
import ClaimPoints from "../ClaimPoints"
|
||||
import JourneyTable from "./JourneyTable"
|
||||
|
||||
import styles from "./earnAndBurn.module.css"
|
||||
|
||||
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
||||
|
||||
export default function EarnAndBurn({
|
||||
@@ -13,7 +16,11 @@ export default function EarnAndBurn({
|
||||
}: AccountPageComponentProps) {
|
||||
return (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={title} link={link} preamble={subtitle} />
|
||||
<div className={styles.header}>
|
||||
<SectionHeader title={title} link={link} preamble={subtitle} />
|
||||
|
||||
<ClaimPoints />
|
||||
</div>
|
||||
<JourneyTable />
|
||||
<SectionLink link={link} variant="mobile" />
|
||||
</SectionContainer>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import ClaimPoints from "@/components/Blocks/DynamicContent/Points/ClaimPoints"
|
||||
import SectionContainer from "@/components/Section/Container"
|
||||
import SectionHeader from "@/components/Section/Header"
|
||||
import SectionLink from "@/components/Section/Link"
|
||||
|
||||
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 caller = await serverClient()
|
||||
@@ -24,7 +26,11 @@ export default async function PreviousStays({
|
||||
|
||||
return (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={title} preamble={subtitle} link={link} />
|
||||
<div className={styles.header}>
|
||||
<SectionHeader title={title} link={link} />
|
||||
|
||||
<ClaimPoints />
|
||||
</div>
|
||||
<ClientPreviousStays initialPreviousStays={initialPreviousStays} />
|
||||
<SectionLink link={link} variant="mobile" />
|
||||
</SectionContainer>
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
gap: var(--Space-x1);
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1367px) {
|
||||
.header {
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
gap: var(--Space-x6);
|
||||
}
|
||||
}
|
||||
@@ -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 (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={title} preamble={subtitle} link={link} />
|
||||
{upcomingStays.data.length ? (
|
||||
<Grids.Stackable>
|
||||
{upcomingStays.data.map((stay) => (
|
||||
<StayCard key={stay.attributes.confirmationNumber} stay={stay} />
|
||||
))}
|
||||
</Grids.Stackable>
|
||||
) : (
|
||||
<EmptyUpcomingStaysBlock />
|
||||
)}
|
||||
<SectionLink link={link} variant="mobile" />
|
||||
</SectionContainer>
|
||||
)
|
||||
}
|
||||
@@ -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 (
|
||||
<SectionContainer className={styles.container}>
|
||||
<SectionHeader title={title} preamble={subtitle} link={link} />
|
||||
<SectionHeader title={title} link={link} />
|
||||
{initialUpcomingStays?.data.length ? (
|
||||
<ClientUpcomingStays initialUpcomingStays={initialUpcomingStays} />
|
||||
) : (
|
||||
|
||||
@@ -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 <SignupFormWrapper dynamic_content={dynamic_content} />
|
||||
case DynamicContentEnum.Blocks.components.soonest_stays:
|
||||
return <SoonestStays {...dynamic_content} />
|
||||
case DynamicContentEnum.Blocks.components.upcoming_stays:
|
||||
return <UpcomingStays {...dynamic_content} />
|
||||
case DynamicContentEnum.Blocks.components.sas_linked_account:
|
||||
|
||||
Reference in New Issue
Block a user