Fix/hotjar suppress * fix(hotjar): suppress personal info on my pages * fix(hotjar): suppress more data Approved-by: Linus Flood
99 lines
3.0 KiB
TypeScript
99 lines
3.0 KiB
TypeScript
import Body from "@scandic-hotels/design-system/Body"
|
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
|
import Link from "@scandic-hotels/design-system/OldDSLink"
|
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
|
|
|
import { getMembershipCards } from "@/lib/trpc/memoizedRequests"
|
|
|
|
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}>
|
|
<div className={styles.content}>
|
|
<Typography variant="Title/Subtitle/md">
|
|
<h3>
|
|
{intl.formatMessage({
|
|
id: "myPages.myMembershipCards",
|
|
defaultMessage: "My membership cards",
|
|
})}
|
|
</h3>
|
|
</Typography>
|
|
</div>
|
|
{(membershipCards || []).map((card, idx) => (
|
|
<div className={styles.card} key={idx}>
|
|
<Typography variant="Title/Subtitle/md">
|
|
<h4 className={styles.subTitle}>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "myPages.nameWithCardMembershipType",
|
|
defaultMessage: "Name: {cardMembershipType}",
|
|
},
|
|
{
|
|
cardMembershipType: card.membershipType,
|
|
}
|
|
)}
|
|
</h4>
|
|
</Typography>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "myPages.currentPointsWithPoints",
|
|
defaultMessage: "Current Points: {points, number}",
|
|
},
|
|
{ points: card.currentPoints }
|
|
)}
|
|
</span>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "myPages.memberSinceWithValue",
|
|
defaultMessage: "Member Since: {value}",
|
|
},
|
|
{
|
|
value: card.memberSince,
|
|
}
|
|
)}
|
|
</span>
|
|
<span data-hj-suppress>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "myPages.numberWithValue",
|
|
defaultMessage: "Number: {membershipNumber}",
|
|
},
|
|
{
|
|
membershipNumber: card.membershipNumber,
|
|
}
|
|
)}
|
|
</span>
|
|
<span>
|
|
{intl.formatMessage(
|
|
{
|
|
id: "myPages.expirationDateWithDate",
|
|
defaultMessage: "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: "myPages.addNewCard",
|
|
defaultMessage: "Add new card",
|
|
})}
|
|
</Body>
|
|
</Link>
|
|
</section>
|
|
)
|
|
}
|