Switches out all the old icons to new ones, and moves them to the design system. The new icons are of three different types: Materialise Symbol, Nucleo, and Customized. Also adds further mapping between facilities/amenities and icons. Approved-by: Michael Zetterberg Approved-by: Erik Tiekstra
76 lines
2.4 KiB
TypeScript
76 lines
2.4 KiB
TypeScript
import { MaterialIcon } from "@scandic-hotels/design-system/Icons"
|
|
|
|
import { getMembershipCards } from "@/lib/trpc/memoizedRequests"
|
|
|
|
import Link from "@/components/TempDesignSystem/Link"
|
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
|
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
|
import { getIntl } from "@/i18n"
|
|
|
|
import styles from "./membershipcards.module.css"
|
|
|
|
export default async function MembershipCardSlot() {
|
|
const intl = await getIntl()
|
|
const membershipCards = await getMembershipCards()
|
|
|
|
return (
|
|
<section className={styles.container}>
|
|
<article className={styles.content}>
|
|
<Subtitle color="black">
|
|
{intl.formatMessage({ id: "My membership cards" })}
|
|
</Subtitle>
|
|
</article>
|
|
{membershipCards &&
|
|
membershipCards.length > 0 &&
|
|
membershipCards.map((card, idx) => (
|
|
<div className={styles.card} key={idx}>
|
|
<Subtitle className={styles.subTitle}>
|
|
{intl.formatMessage(
|
|
{ id: "Name: {cardMembershipType}" },
|
|
{
|
|
cardMembershipType: card.membershipType,
|
|
}
|
|
)}
|
|
</Subtitle>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{ id: "Current Points: {points, number}" },
|
|
{ points: card.currentPoints }
|
|
)}
|
|
</span>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{ id: "Member Since: {value}" },
|
|
{
|
|
value: card.memberSince,
|
|
}
|
|
)}
|
|
</span>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{ id: "Number: {membershipNumber}" },
|
|
{
|
|
membershipNumber: card.membershipNumber,
|
|
}
|
|
)}
|
|
</span>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{ id: "Expiration Date: {expirationDate}" },
|
|
{
|
|
expirationDate: card.expirationDate.split("T")[0],
|
|
}
|
|
)}
|
|
</span>
|
|
</div>
|
|
))}
|
|
<Link href="#" variant="icon">
|
|
<MaterialIcon icon="add_circle" color="CurrentColor" />
|
|
<Body color="burgundy" textTransform="underlined">
|
|
{intl.formatMessage({ id: "Add new card" })}
|
|
</Body>
|
|
</Link>
|
|
</section>
|
|
)
|
|
}
|