Merged in feat/best-friend-hero (pull request #338)

Feat(SW-170): Update overview hero

Approved-by: Christel Westerberg
This commit is contained in:
Matilda Landström
2024-07-12 06:45:44 +00:00
parent c1892ace66
commit 801a041404
48 changed files with 595 additions and 203 deletions

View File

@@ -0,0 +1,24 @@
import Body from "@/components/TempDesignSystem/Text/Body"
import { getIntl } from "@/i18n"
import { getMembership } from "@/utils/user"
import type { UserProps } from "@/types/components/myPages/user"
export default async function ExpiringPoints({ user }: UserProps) {
const { formatMessage } = await getIntl()
const membership = getMembership(user.memberships)
// TODO - add correct points when available from API
if (!membership /* || !membership.expiringPoints*/) {
// TODO: handle this case?
return null
}
return (
<section>
<Body color="white" textTransform="bold" textAlign="center">
{membership.currentPoints} {formatMessage({ id: "points expiring by" })}{" "}
{membership.expirationDate}
</Body>
</section>
)
}