fix(SW-288): usage of intl

This commit is contained in:
Matilda Landström
2024-08-28 11:51:08 +02:00
parent 8257a6fc2d
commit f3a20e9a27
2 changed files with 9 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ export default async function NextLevelBenefitsBlock({
subtitle,
link,
}: AccountPageComponentProps) {
const { formatMessage } = await getIntl()
const intl = await getIntl()
const user = await serverClient().user.get()
if (!user || "error" in user) {
return null
@@ -45,11 +45,15 @@ export default async function NextLevelBenefitsBlock({
<article key={benefit.title} className={styles.card}>
<Chip>
<Lock height={16} />
{formatMessage({ id: "Level up to unlock" })}
{intl.formatMessage({ id: "Level up to unlock" })}
</Chip>
ntl.formatMessage
<div className={styles.textContainer}>
<Body color="peach50" textAlign="center">
{formatMessage({ id: "As our" }, { level: nextLevel.name })}
{intl.formatMessage(
{ id: "As our" },
{ level: nextLevel.name }
)}
</Body>{" "}
<Title
level="h4"

View File

@@ -9,7 +9,7 @@ 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 intl = await getIntl()
const membership = getMembership(user.memberships)
if (!membership || !membership.pointsToExpire) {
@@ -26,7 +26,7 @@ export default async function ExpiringPoints({ user }: UserProps) {
return (
<section>
<Body color="white" textTransform="bold" textAlign="center">
{formatMessage(
{intl.formatMessage(
{ id: "spendable points expiring by" },
{
points: formatter.format(membership.pointsToExpire),