chore: refactor points

This commit is contained in:
Michael Zetterberg
2025-01-05 16:23:17 +01:00
parent d2ce9c0d7c
commit 0477d2375b
6 changed files with 33 additions and 127 deletions

View File

@@ -5,7 +5,7 @@ import { getIntl } from "@/i18n"
import { getMembership } from "@/utils/user"
import PointsContainer from "./Container"
import { NextLevelPointsColumn, YourPointsColumn } from "./PointsColumn"
import { PointsColumn } from "./PointsColumn"
import type { UserProps } from "@/types/components/myPages/user"
@@ -23,11 +23,19 @@ export default async function Points({ user }: UserProps) {
return (
<PointsContainer>
<YourPointsColumn points={membership?.currentPoints} />
<PointsColumn
value={membership?.currentPoints}
title={intl.formatMessage({ id: "Your points to spend" })}
subtitle={intl.formatMessage({ id: "as of today" })}
/>
{nextLevel && (
<NextLevelPointsColumn
points={membership?.pointsRequiredToNextlevel}
subtitle={`${intl.formatMessage({ id: "next level:" })} ${nextLevel.name}`}
<PointsColumn
value={membership?.pointsRequiredToNextlevel}
title={intl.formatMessage({ id: "Points needed to level up" })}
subtitle={intl.formatMessage(
{ id: "next level: {nextLevel}" },
{ nextLevel: nextLevel.name }
)}
/>
)}
{/* TODO: Show NextLevelNightsColumn when nightsToTopTier data is correct from Antavo */}