Files
web/apps/scandic-web/components/Blocks/DynamicContent/Points/PointsToSpendCard/ExpiringPointsSeeAllButton.tsx
Chuma Mcphoy (We Ahead) 6a9d598b97 Merged in feat/LOY-336-Points-to-Spend-Card (pull request #2830)
feat(LOY-336): Add PointsToSpendCard

* feat(LOY-366): Add PointsToSpendCard

* feat(LOY-336): Add Expiring Points Table Sidepeek

* fix(LOY-336): Hide old section

* fix(LOY-336): description mobile styling

* chore(LOY-336): css cleanup


Approved-by: Matilda Landström
2025-09-22 10:16:40 +00:00

54 lines
1.8 KiB
TypeScript

"use client"
import { DialogTrigger } from "react-aria-components"
import { useIntl } from "react-intl"
import { Button } from "@scandic-hotels/design-system/Button"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import SidePeekSelfControlled from "@scandic-hotels/design-system/SidePeekSelfControlled"
import { Typography } from "@scandic-hotels/design-system/Typography"
import ExpiringPointsTable from "../ExpiringPoints/ExpiringPointsTable"
import styles from "./PointsToSpendCard.module.css"
interface ExpiringPointsSeeAllButtonProps {
expiringPoints: number
expiryDate: string
}
export default function ExpiringPointsSeeAllButton({
expiringPoints,
expiryDate,
}: ExpiringPointsSeeAllButtonProps) {
const intl = useIntl()
return (
<DialogTrigger>
<Button variant="Text" size="Medium" typography="Body/Paragraph/mdBold">
{intl.formatMessage({ defaultMessage: "See all" })}
<MaterialIcon icon="chevron_right" color="CurrentColor" />
</Button>
<SidePeekSelfControlled
title={intl.formatMessage({ defaultMessage: "Expiring Points" })}
>
<div className={styles.sidePeekContent}>
<Typography variant="Body/Paragraph/mdRegular">
<p>
{intl.formatMessage({
defaultMessage:
"Points expire three years after they are earned, on the last day of that month. Expiring points do not affect your level.",
})}
</p>
</Typography>
{/* TODO: The table will be rebuilt as part of the My Pages Optimisations 3 Epic. */}
<ExpiringPointsTable
points={expiringPoints}
expirationDate={expiryDate}
/>
</div>
</SidePeekSelfControlled>
</DialogTrigger>
)
}