@nuskin/react-loyalty-elements
Version:
A React based component library for reusable Nextgen Loyalty component
157 lines (156 loc) • 4.54 kB
TypeScript
export type StoreMonthlySubsOrder = {
accountId?: number;
userId?: number;
nuskinAccountId?: string;
year: number;
month: number;
storeId?: number;
totalAmount: number;
promocode: string | null;
createdTime?: string;
updatedTime?: string;
};
export type MonthlyData = {
approximateMonthlyTotalResponse?: {
currentMonthTotal?: number | string;
nextMonthTotal?: number | string;
};
csmMonthlySubsOrderTotal?: StoreMonthlySubsOrder[];
};
export type OrderRecord = {
year: number;
month: number;
totalAmount: number;
promocode: string | null;
};
export type TranslationConfig = {
header?: string;
voucherTargetAmount: string;
monthsComplete: string;
voucherEarned: string;
learnMore: string;
learn3xMore: string;
callToAction: string;
notQualify: string;
approximateMonthly: string;
approximateTotal: string;
currentlyTrack: string;
loyaltyLogoBlack: string;
estimateDisclaimer?: string;
};
export type LearnMoreConfig = {
tagLine: string;
cardOneDescription: string;
cardOneVoucherAmount: string;
cardTwoDescription: string;
cardTwoVoucherAmount: string;
header: string;
loyaltyLogoWhite: string;
loyaltyBanner: string;
learnMore: string;
};
export type RewardProgressBarProps = {
value?: number;
title?: string;
amountShow?: number;
voucherValue?: number | null;
monthCompletionValue?: number;
minAmount?: number;
maxMonths?: number;
approximateMonthlyTotalResponse?: object;
subscriptionData?: null | MonthlyData;
handleOpenSubscriptionRewardPopup?: () => void;
notQualifyForRewardThisMonth?: boolean;
translationConfig: TranslationConfig;
learnMoreConfig: LearnMoreConfig;
storeConfig: {
tiers?: [
{
consecutive_months: number;
min_spend: number;
max_spend: number;
promo_code: string;
},
{
consecutive_months: number;
min_spend: number;
promo_code: string;
}
];
currencyAbbreviate?: boolean;
};
currencyAbbreviate?: boolean;
currencyFormat?: (price: number, currencyWithoutDecimal: boolean, currencyAbbreviate: boolean) => void;
};
export type RewardSubscriptionMonthDescriptionProps = {
value: number;
amountShow?: number;
voucherValue: number | null;
monthCompletionValue?: number;
minAmount?: number;
maxMonths: number;
approximateMonthlyTotalResponse?: object;
subscriptionData?: MonthlyData;
handleOpenSubscriptionRewardPopup: () => void;
notQualifyForRewardThisMonth: boolean;
translationConfig?: TranslationConfig;
learnMoreConfig?: LearnMoreConfig;
currencyAbbreviate?: boolean;
currencyFormat?: (price: number, currencyWithoutDecimal: boolean, currencyAbbreviate: boolean) => void;
};
export type CalculateMonthCompletionParams = {
data: MonthlyData | null | undefined;
minAmount: number;
tiers: {
consecutive_months: number;
min_spend: number;
max_spend?: number;
promo_code: string;
}[];
initialVoucherValue: number;
initialMonthCompletionValue: number;
maxMonths: number;
today: Date;
};
export type PopupTextParams = {
voucherValue: number | null | undefined;
minVoucher: number;
maxVoucher: number;
notQualifyForRewardThisMonth: boolean;
learn3xMore: string;
learnMoreText: string;
translationLearnMore: string;
};
export type CenterContentParams = {
isComplete: boolean;
notQualifyForRewardThisMonth: boolean;
hasVoucherValue: boolean;
voucherEarned: string;
voucherTargetAmount: string;
};
export type InfoItemParams = {
isComplete: boolean;
amountShow: number | undefined;
minAmount: number;
voucherEarnedText: string;
monthsCompleteText: string;
};
export type TotalSummaryParams = {
isComplete: boolean;
notQualifyForRewardThisMonth: boolean;
hasVoucherValue: boolean;
approximateTotalText: string;
amountShowText: string;
currentlyTrackText: string;
callToActionText: string;
};
export type TotalButtonParams = {
notQualifyForRewardThisMonth: boolean;
approximateMonthlyText: string;
amountShowText: string;
translationNotQualify: string;
estimateDisclaimer: string;
open: boolean;
handleTooltipToggle: () => void;
handleTooltipClose: () => void;
};