feat(LOY-154): add expiration date to rewards
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
.badge {
|
||||
padding: var(--Spacing-x1) var(--Spacing-x-one-and-half);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--Spacing-x-half);
|
||||
background-color: var(--Base-Surface-Secondary-light-Normal);
|
||||
border-radius: var(--Corner-radius-Small);
|
||||
}
|
||||
36
apps/scandic-web/components/Rewards/ExpirationDate/index.tsx
Normal file
36
apps/scandic-web/components/Rewards/ExpirationDate/index.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
"use client"
|
||||
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
import styles from "./expirationDate.module.css"
|
||||
|
||||
import type { Dayjs } from "dayjs"
|
||||
|
||||
export default function ExpirationDate({
|
||||
expirationDate,
|
||||
}: {
|
||||
expirationDate: Dayjs | string
|
||||
}) {
|
||||
const intl = useIntl()
|
||||
const lang = useLang()
|
||||
|
||||
return (
|
||||
<div className={styles.badge}>
|
||||
<Body textTransform="bold">
|
||||
{intl.formatMessage(
|
||||
{ id: "Valid through {expirationDate}" },
|
||||
{
|
||||
expirationDate: dt(expirationDate)
|
||||
.locale(lang)
|
||||
.format("D MMM YYYY"),
|
||||
}
|
||||
)}
|
||||
</Body>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user