Merged in fix/spendable-points (pull request #395)
Fix/spendable points SW-248 Approved-by: Michael Zetterberg Approved-by: Fredrik Thorsson
This commit is contained in:
@@ -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 />
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ export default async function ExpiringPoints({ user }: UserProps) {
|
|||||||
<section>
|
<section>
|
||||||
<Body color="white" textTransform="bold" textAlign="center">
|
<Body color="white" textTransform="bold" textAlign="center">
|
||||||
{formatter.format(membership.pointsToExpire)}{" "}
|
{formatter.format(membership.pointsToExpire)}{" "}
|
||||||
{formatMessage({ id: "points expiring by" })} {d.format("YYYY-MM-DD")}
|
{formatMessage({ id: "spendable points expiring by" })}{" "}
|
||||||
|
{d.format("YYYY-MM-DD")}
|
||||||
</Body>
|
</Body>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import type {
|
|||||||
export const YourPointsColumn = ({ points }: PointsColumn) =>
|
export const YourPointsColumn = ({ points }: PointsColumn) =>
|
||||||
PointsColumn({
|
PointsColumn({
|
||||||
points,
|
points,
|
||||||
title: "Your points",
|
title: "Your points to spend",
|
||||||
subtitle: "as of today",
|
subtitle: "as of today",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.",
|
"Points may take up to 10 days to be displayed.": "Det kan tage op til 10 dage at få vist point.",
|
||||||
"Points needed to level up": "Point nødvendige for at komme i niveau",
|
"Points needed to level up": "Point nødvendige for at komme i niveau",
|
||||||
"Points needed to stay on level": "Point nødvendige for at holde sig på niveau",
|
"Points needed to stay on level": "Point nødvendige for at holde sig på niveau",
|
||||||
"points expiring by": "point udløber den",
|
"spendable points expiring by": "Brugbare point udløber den",
|
||||||
"Previous victories": "Tidligere sejre",
|
"Previous victories": "Tidligere sejre",
|
||||||
"Read more": "Læs mere",
|
"Read more": "Læs mere",
|
||||||
"Read more about the hotel": "Læs mere om hotellet",
|
"Read more about the hotel": "Læs mere om hotellet",
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"Street": "Gade",
|
"Street": "Gade",
|
||||||
"special character": "speciel karakter",
|
"special character": "speciel karakter",
|
||||||
"Total Points": "Samlet antal point",
|
"Total Points": "Samlet antal point",
|
||||||
"Your points": "Dine pointer",
|
"Your points to spend": "Dine brugbare pointer",
|
||||||
"Transaction date": "Overførselsdato",
|
"Transaction date": "Overførselsdato",
|
||||||
"Transactions": "Transaktioner",
|
"Transactions": "Transaktioner",
|
||||||
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.",
|
"Points may take up to 10 days to be displayed.": "Es kann bis zu 10 Tage dauern, bis Punkte angezeigt werden.",
|
||||||
"Points needed to level up": "Punkte, die zum Levelaufstieg benötigt werden",
|
"Points needed to level up": "Punkte, die zum Levelaufstieg benötigt werden",
|
||||||
"Points needed to stay on level": "Erforderliche Punkte, um auf diesem Niveau zu bleiben",
|
"Points needed to stay on level": "Erforderliche Punkte, um auf diesem Niveau zu bleiben",
|
||||||
"points expiring by": "punkte verfallen bis zum",
|
"spendable points expiring by": "Einlösbare punkte verfallen bis zum",
|
||||||
"Previous victories": "Bisherige Siege",
|
"Previous victories": "Bisherige Siege",
|
||||||
"Read more": "Mehr lesen",
|
"Read more": "Mehr lesen",
|
||||||
"Read more about the hotel": "Lesen Sie mehr über das Hotel",
|
"Read more about the hotel": "Lesen Sie mehr über das Hotel",
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"Street": "Straße",
|
"Street": "Straße",
|
||||||
"special character": "sonderzeichen",
|
"special character": "sonderzeichen",
|
||||||
"Total Points": "Gesamtpunktzahl",
|
"Total Points": "Gesamtpunktzahl",
|
||||||
"Your points": "Deine Punkte",
|
"Your points to spend": "Deine Punkte",
|
||||||
"Transaction date": "Transaktionsdatum",
|
"Transaction date": "Transaktionsdatum",
|
||||||
"Transactions": "Transaktionen",
|
"Transactions": "Transaktionen",
|
||||||
"Tripadvisor reviews": "{rating} ({count} Bewertungen auf Tripadvisor)",
|
"Tripadvisor reviews": "{rating} ({count} Bewertungen auf Tripadvisor)",
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Points may take up to 10 days to be displayed.",
|
"Points may take up to 10 days to be displayed.": "Points may take up to 10 days to be displayed.",
|
||||||
"Points needed to level up": "Points needed to level up",
|
"Points needed to level up": "Points needed to level up",
|
||||||
"Points needed to stay on level": "Points needed to stay on level",
|
"Points needed to stay on level": "Points needed to stay on level",
|
||||||
"points expiring by": "points expiring by",
|
"spendable points expiring by": "spendable points expiring by",
|
||||||
"Previous victories": "Previous victories",
|
"Previous victories": "Previous victories",
|
||||||
"Read more": "Read more",
|
"Read more": "Read more",
|
||||||
"Read more about the hotel": "Read more about the hotel",
|
"Read more about the hotel": "Read more about the hotel",
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
"Street": "Street",
|
"Street": "Street",
|
||||||
"special character": "special character",
|
"special character": "special character",
|
||||||
"Total Points": "Total Points",
|
"Total Points": "Total Points",
|
||||||
"Your points": "Your points",
|
"Your points to spend": "Your points to spend",
|
||||||
"Transaction date": "Transaction date",
|
"Transaction date": "Transaction date",
|
||||||
"Transactions": "Transactions",
|
"Transactions": "Transactions",
|
||||||
"Tripadvisor reviews": "{rating} ({count} reviews on Tripadvisor)",
|
"Tripadvisor reviews": "{rating} ({count} reviews on Tripadvisor)",
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Pisteiden näyttäminen voi kestää jopa 10 päivää.",
|
"Points may take up to 10 days to be displayed.": "Pisteiden näyttäminen voi kestää jopa 10 päivää.",
|
||||||
"Points needed to level up": "Pisteitä tarvitaan tasolle pääsemiseksi",
|
"Points needed to level up": "Pisteitä tarvitaan tasolle pääsemiseksi",
|
||||||
"Points needed to stay on level": "Tällä tasolla pysymiseen tarvittavat pisteet",
|
"Points needed to stay on level": "Tällä tasolla pysymiseen tarvittavat pisteet",
|
||||||
"points expiring by": "pisteet vanhenevat viimeistään",
|
"spendable points expiring by": "Käytettävät pisteet vanhenevat viimeistään",
|
||||||
"Previous victories": "Edelliset voitot",
|
"Previous victories": "Edelliset voitot",
|
||||||
"Read more": "Lue lisää",
|
"Read more": "Lue lisää",
|
||||||
"Read more about the hotel": "Lue lisää hotellista",
|
"Read more about the hotel": "Lue lisää hotellista",
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"Street": "Katu",
|
"Street": "Katu",
|
||||||
"special character": "erikoishahmo",
|
"special character": "erikoishahmo",
|
||||||
"Total Points": "Kokonaispisteet",
|
"Total Points": "Kokonaispisteet",
|
||||||
"Your points": "Sinun pisteesi",
|
"Your points to spend": "Sinun pisteesi käytettäväksi",
|
||||||
"Transaction date": "Tapahtuman päivämäärä",
|
"Transaction date": "Tapahtuman päivämäärä",
|
||||||
"Transactions": "Tapahtumat",
|
"Transactions": "Tapahtumat",
|
||||||
"Tripadvisor reviews": "{rating} ({count} arvostelua TripAdvisorissa)",
|
"Tripadvisor reviews": "{rating} ({count} arvostelua TripAdvisorissa)",
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.",
|
"Points may take up to 10 days to be displayed.": "Det kan ta opptil 10 dager før poeng vises.",
|
||||||
"Points needed to level up": "Poeng som trengs for å komme opp i nivå",
|
"Points needed to level up": "Poeng som trengs for å komme opp i nivå",
|
||||||
"Points needed to stay on level": "Poeng som trengs for å holde seg på nivå",
|
"Points needed to stay on level": "Poeng som trengs for å holde seg på nivå",
|
||||||
"points expiring by": "poeng utløper innen",
|
"spendable points expiring by": "Brukbare poeng utløper innen",
|
||||||
"Previous victories": "Tidligere seire",
|
"Previous victories": "Tidligere seire",
|
||||||
"Read more": "Les mer",
|
"Read more": "Les mer",
|
||||||
"Read more about the hotel": "Les mer om hotellet",
|
"Read more about the hotel": "Les mer om hotellet",
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
"Street": "Gate",
|
"Street": "Gate",
|
||||||
"special character": "spesiell karakter",
|
"special character": "spesiell karakter",
|
||||||
"Total Points": "Totale poeng",
|
"Total Points": "Totale poeng",
|
||||||
"Your points": "Dine poeng",
|
"Your points to spend": "Dine brukbare poeng",
|
||||||
"Transaction date": "Transaksjonsdato",
|
"Transaction date": "Transaksjonsdato",
|
||||||
"Transactions": "Transaksjoner",
|
"Transactions": "Transaksjoner",
|
||||||
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
"Tripadvisor reviews": "{rating} ({count} anmeldelser på Tripadvisor)",
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
"Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.",
|
"Points may take up to 10 days to be displayed.": "Det kan ta upp till 10 dagar innan poäng visas.",
|
||||||
"Points needed to level up": "Poäng som behövs för att gå upp i nivå",
|
"Points needed to level up": "Poäng som behövs för att gå upp i nivå",
|
||||||
"Points needed to stay on level": "Poäng som behövs för att hålla sig på nivå",
|
"Points needed to stay on level": "Poäng som behövs för att hålla sig på nivå",
|
||||||
"points expiring by": "poäng förfaller till",
|
"spendable points expiring by": "Spenderbara poäng förfaller till",
|
||||||
"Previous victories": "Tidigare segrar",
|
"Previous victories": "Tidigare segrar",
|
||||||
"Read more": "Läs mer",
|
"Read more": "Läs mer",
|
||||||
"Read more about the hotel": "Läs mer om hotellet",
|
"Read more about the hotel": "Läs mer om hotellet",
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
"Street": "Gata",
|
"Street": "Gata",
|
||||||
"special character": "speciell karaktär",
|
"special character": "speciell karaktär",
|
||||||
"Total Points": "Total poäng",
|
"Total Points": "Total poäng",
|
||||||
"Your points": "Dina poäng",
|
"Your points to spend": "Dina spenderbara poäng",
|
||||||
"Transaction date": "Transaktionsdatum",
|
"Transaction date": "Transaktionsdatum",
|
||||||
"Transactions": "Transaktioner",
|
"Transactions": "Transaktioner",
|
||||||
"Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)",
|
"Tripadvisor reviews": "{rating} ({count} recensioner på Tripadvisor)",
|
||||||
|
|||||||
Reference in New Issue
Block a user