feat(SW-353): dynamic rewards
This commit is contained in:
@@ -1,69 +1,36 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { membershipLevels } from "@/constants/membershipLevels"
|
||||
|
||||
import { MembershipLevel } from "@/utils/user"
|
||||
|
||||
import type { IntlFormatters } from "@formatjs/intl"
|
||||
|
||||
type BenefitTitle = { title: string }
|
||||
import { MembershipLevel } from "@/constants/membershipLevels"
|
||||
import { LoyaltyLevel } from "@/server/routers/contentstack/loyaltyLevel/output"
|
||||
import { Reward } from "@/server/routers/contentstack/reward/output"
|
||||
|
||||
export type OverviewTableClientProps = {
|
||||
activeMembership: MembershipLevel | null
|
||||
}
|
||||
|
||||
export type Level = {
|
||||
level: membershipLevels
|
||||
name: string
|
||||
requiredPoints: number
|
||||
requiredNights?: number
|
||||
benefits: BenefitTitle[]
|
||||
levels: ComparisonLevel[]
|
||||
}
|
||||
|
||||
export type LevelCardProps = {
|
||||
formatMessage: IntlFormatters["formatMessage"]
|
||||
lang: Lang
|
||||
level: Level
|
||||
level: LevelWithRewards
|
||||
}
|
||||
|
||||
export type ComparisonLevel = {
|
||||
level: membershipLevels
|
||||
name: string
|
||||
description: string
|
||||
requirement: string
|
||||
icon: string
|
||||
benefits: Benefit[]
|
||||
}
|
||||
export type LevelWithRewards = LoyaltyLevel & { rewards: Reward[] }
|
||||
|
||||
export type Benefit = {
|
||||
name: string
|
||||
description: string
|
||||
unlocked: boolean
|
||||
value?: string
|
||||
valueDetails?: string
|
||||
}
|
||||
export type ComparisonLevel = LevelWithRewards
|
||||
|
||||
export type LevelSummaryProps = {
|
||||
level: ComparisonLevel
|
||||
showDescription?: boolean
|
||||
}
|
||||
|
||||
export type BenefitCardProps = {
|
||||
comparedValues: BenefitValueInformation[]
|
||||
export type RewardCardProps = {
|
||||
comparedValues: (Reward | undefined)[]
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
||||
type BenefitValueInformation = {
|
||||
unlocked: boolean
|
||||
value?: string
|
||||
valueDetails?: string
|
||||
export type RewardValueProps = {
|
||||
reward?: Reward
|
||||
}
|
||||
|
||||
export type BenefitValueProps = {
|
||||
benefit: BenefitValueInformation
|
||||
}
|
||||
|
||||
export type BenefitListProps = {
|
||||
export type RewardListProps = {
|
||||
levels: ComparisonLevel[]
|
||||
}
|
||||
|
||||
@@ -77,16 +44,16 @@ export type DesktopSelectColumns = {
|
||||
|
||||
export type LargeTableProps = {
|
||||
levels: ComparisonLevel[]
|
||||
activeLevel: membershipLevels | null
|
||||
activeLevel: MembershipLevel | null
|
||||
Select?: (column: DesktopSelectColumns) => JSX.Element | null
|
||||
}
|
||||
|
||||
export type BenefitTableHeaderProps = {
|
||||
export type RewardTableHeaderProps = {
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export enum overviewTableActionsEnum {
|
||||
export enum OverviewTableActionsEnum {
|
||||
SET_SELECTED_LEVEL_A_MOBILE = "SET_SELECTED_LEVEL_A_MOBILE",
|
||||
SET_SELECTED_LEVEL_B_MOBILE = "SET_SELECTED_LEVEL_B_MOBILE",
|
||||
SET_SELECTED_LEVEL_A_DESKTOP = "SET_SELECTED_LEVEL_A_DESKTOP",
|
||||
@@ -95,6 +62,6 @@ export enum overviewTableActionsEnum {
|
||||
}
|
||||
|
||||
export type OverviewTableReducerAction = {
|
||||
type: overviewTableActionsEnum
|
||||
type: OverviewTableActionsEnum
|
||||
payload: ComparisonLevel
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user