chore: remove obsolete CurrentPointsBalance component since unused
This commit is contained in:
committed by
Michael Zetterberg
parent
8592d7004b
commit
1230df86d0
@@ -2,7 +2,6 @@ import JsonToHtml from "@/components/JsonToHtml"
|
|||||||
import CurrentBenefitsBlock from "@/components/MyPages/Blocks/Benefits/CurrentLevel"
|
import CurrentBenefitsBlock from "@/components/MyPages/Blocks/Benefits/CurrentLevel"
|
||||||
import NextLevelBenefitsBlock from "@/components/MyPages/Blocks/Benefits/NextLevel"
|
import NextLevelBenefitsBlock from "@/components/MyPages/Blocks/Benefits/NextLevel"
|
||||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||||
import CurrentPointsBalance from "@/components/MyPages/Blocks/Points/CurrentPointsBalance"
|
|
||||||
import EarnAndBurn from "@/components/MyPages/Blocks/Points/EarnAndBurn"
|
import EarnAndBurn from "@/components/MyPages/Blocks/Points/EarnAndBurn"
|
||||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||||
import PreviousStays from "@/components/MyPages/Blocks/Stays/Previous"
|
import PreviousStays from "@/components/MyPages/Blocks/Stays/Previous"
|
||||||
@@ -37,8 +36,6 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
|||||||
return <CurrentBenefitsBlock {...props} />
|
return <CurrentBenefitsBlock {...props} />
|
||||||
case DynamicContentComponents.next_benefits:
|
case DynamicContentComponents.next_benefits:
|
||||||
return <NextLevelBenefitsBlock {...props} />
|
return <NextLevelBenefitsBlock {...props} />
|
||||||
case DynamicContentComponents.my_points:
|
|
||||||
return <CurrentPointsBalance {...props} />
|
|
||||||
case DynamicContentComponents.expiring_points:
|
case DynamicContentComponents.expiring_points:
|
||||||
// TODO: Add once available
|
// TODO: Add once available
|
||||||
// return <ExpiringPoints />
|
// return <ExpiringPoints />
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { modWebviewLink } from "@/utils/webviews"
|
|||||||
|
|
||||||
import CurrentBenefitsBlock from "../../Blocks/Benefits/CurrentLevel"
|
import CurrentBenefitsBlock from "../../Blocks/Benefits/CurrentLevel"
|
||||||
import NextLevelBenefitsBlock from "../../Blocks/Benefits/NextLevel"
|
import NextLevelBenefitsBlock from "../../Blocks/Benefits/NextLevel"
|
||||||
import CurrentPointsBalance from "../../Blocks/Points/CurrentPointsBalance"
|
|
||||||
import EarnAndBurn from "../../Blocks/Points/EarnAndBurn"
|
import EarnAndBurn from "../../Blocks/Points/EarnAndBurn"
|
||||||
import PointsOverview from "../../Blocks/Points/Overview"
|
import PointsOverview from "../../Blocks/Points/Overview"
|
||||||
|
|
||||||
@@ -29,8 +28,6 @@ function DynamicComponent({ component, props }: AccountPageContentProps) {
|
|||||||
return <CurrentBenefitsBlock {...props} />
|
return <CurrentBenefitsBlock {...props} />
|
||||||
case DynamicContentComponents.next_benefits:
|
case DynamicContentComponents.next_benefits:
|
||||||
return <NextLevelBenefitsBlock {...props} />
|
return <NextLevelBenefitsBlock {...props} />
|
||||||
case DynamicContentComponents.my_points:
|
|
||||||
return <CurrentPointsBalance {...props} />
|
|
||||||
case DynamicContentComponents.expiring_points:
|
case DynamicContentComponents.expiring_points:
|
||||||
// TODO: Add once available
|
// TODO: Add once available
|
||||||
// return <ExpiringPoints />
|
// return <ExpiringPoints />
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
.card {
|
|
||||||
background-color: var(--Scandic-Brand-Pale-Peach);
|
|
||||||
border-radius: var(--Corner-radius-xLarge);
|
|
||||||
color: var(--Main-Brand-Burgundy);
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
gap: var(--Spacing-x2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.points {
|
|
||||||
font-size: var(--typography-Title-2-Mobile-fontSize);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
|
||||||
.points {
|
|
||||||
font-size: var(--typography-Title-2-Desktop-fontSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
import { serverClient } from "@/lib/trpc/server"
|
|
||||||
|
|
||||||
import SectionContainer from "@/components/Section/Container"
|
|
||||||
import SectionHeader from "@/components/Section/Header"
|
|
||||||
import SectionLink from "@/components/Section/Link"
|
|
||||||
import { getIntl } from "@/i18n"
|
|
||||||
import { getMembership } from "@/utils/user"
|
|
||||||
|
|
||||||
import styles from "./currentPointsBalance.module.css"
|
|
||||||
|
|
||||||
import { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
|
||||||
|
|
||||||
async function CurrentPointsBalance({
|
|
||||||
title,
|
|
||||||
subtitle,
|
|
||||||
link,
|
|
||||||
}: AccountPageComponentProps) {
|
|
||||||
const user = await serverClient().user.get()
|
|
||||||
const { formatMessage } = await getIntl()
|
|
||||||
if (!user) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
const membership = getMembership(user.memberships)
|
|
||||||
return (
|
|
||||||
<SectionContainer>
|
|
||||||
<SectionHeader title={title} link={link} subtitle={subtitle} />
|
|
||||||
<div className={styles.card}>
|
|
||||||
<h2>{`${formatMessage({ id: "Your points" })}*`}</h2>
|
|
||||||
<p className={styles.points}>
|
|
||||||
{`${formatMessage({ id: "Points" })}: ${membership ? membership.currentPoints : "N/A"}`}
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
{`*${formatMessage({ id: "Points may take up to 10 days to be displayed." })}`}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<SectionLink link={link} variant="mobile" />
|
|
||||||
</SectionContainer>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default CurrentPointsBalance
|
|
||||||
Reference in New Issue
Block a user