feat(LOY-263): add link to missing points form to earn and burn
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,13 +1,9 @@
|
||||
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 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 { getIntl } from "@/i18n"
|
||||
|
||||
import ClientPreviousStays from "./Client"
|
||||
|
||||
@@ -19,7 +15,6 @@ export default async function PreviousStays({
|
||||
title,
|
||||
link,
|
||||
}: AccountPageComponentProps) {
|
||||
const intl = await getIntl()
|
||||
const caller = await serverClient()
|
||||
const initialPreviousStays = await caller.user.stays.previous({
|
||||
limit: 6,
|
||||
@@ -33,25 +28,8 @@ export default async function PreviousStays({
|
||||
<SectionContainer>
|
||||
<div className={styles.header}>
|
||||
<SectionHeader title={title} link={link} />
|
||||
<div className={styles.claim}>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<p>
|
||||
{intl.formatMessage({
|
||||
defaultMessage: "Missing a previous stay?",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
<ButtonLink
|
||||
href="https://www.scandichotels.com/forms/missing-points"
|
||||
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>
|
||||
|
||||
<ClaimPoints />
|
||||
</div>
|
||||
<ClientPreviousStays initialPreviousStays={initialPreviousStays} />
|
||||
<SectionLink link={link} variant="mobile" />
|
||||
|
||||
@@ -5,14 +5,6 @@
|
||||
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;
|
||||
|
||||
10
apps/scandic-web/constants/missingPointsHrefs.ts
Normal file
10
apps/scandic-web/constants/missingPointsHrefs.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { LangRoute } from "@/types/routes"
|
||||
|
||||
export const missingPoints: LangRoute = {
|
||||
da: "https://www.scandichotels.dk/form/manglende-point",
|
||||
de: "https://www.scandichotels.de/formulare/fehlende-punkte",
|
||||
fi: "https://www.scandichotels.fi/forms/puuttuvat-pisteet",
|
||||
en: "https://www.scandichotels.com/forms/missing-points",
|
||||
no: "https://www.scandichotels.no/form/manglende-poeng",
|
||||
sv: "https://www.scandichotels.se/formular/saknade-poang",
|
||||
}
|
||||
Reference in New Issue
Block a user