fix: refactor away subtitleParam
This commit is contained in:
@@ -17,34 +17,24 @@ export const YourPointsColumn = ({ points }: PointsColumn) =>
|
||||
subtitle: "as of today",
|
||||
})
|
||||
|
||||
export const NextLevelPointsColumn = ({
|
||||
points,
|
||||
subtitleParam,
|
||||
}: PointsColumn) =>
|
||||
export const NextLevelPointsColumn = ({ points, subtitle }: PointsColumn) =>
|
||||
PointsColumn({
|
||||
points,
|
||||
title: "Points needed to level up",
|
||||
subtitleParam,
|
||||
subtitle: "next level:",
|
||||
subtitle,
|
||||
})
|
||||
|
||||
export const StayOnLevelColumn = ({ points, subtitleParam }: PointsColumn) =>
|
||||
export const StayOnLevelColumn = ({ points, subtitle }: PointsColumn) =>
|
||||
PointsColumn({
|
||||
points,
|
||||
title: "Points needed to stay on level",
|
||||
subtitleParam,
|
||||
subtitle: "by",
|
||||
subtitle,
|
||||
})
|
||||
|
||||
export const NextLevelNightsColumn = ({
|
||||
nights,
|
||||
subtitleParam,
|
||||
subtitle = "by",
|
||||
}: NightsColumn) =>
|
||||
export const NextLevelNightsColumn = ({ nights, subtitle }: NightsColumn) =>
|
||||
PointsColumn({
|
||||
nights,
|
||||
title: "Nights needed to level up",
|
||||
subtitleParam,
|
||||
subtitle,
|
||||
})
|
||||
|
||||
@@ -53,7 +43,6 @@ async function PointsColumn({
|
||||
nights,
|
||||
title,
|
||||
subtitle,
|
||||
subtitleParam,
|
||||
}: PointsColumnProps) {
|
||||
const { formatMessage } = await getIntl()
|
||||
|
||||
@@ -72,9 +61,11 @@ async function PointsColumn({
|
||||
<Title color="white" level="h2" textAlign="center">
|
||||
{points ?? nights ?? "N/A"}
|
||||
</Title>
|
||||
<Body color="white" textAlign="center">
|
||||
{subtitle ? formatMessage({ id: subtitle }) : ""} {subtitleParam}
|
||||
</Body>
|
||||
{subtitle ? (
|
||||
<Body color="white" textAlign="center">
|
||||
{subtitle}
|
||||
</Body>
|
||||
) : null}
|
||||
</article>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user