@opexa/portal-components 0.0.507 → 0.0.509
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarousel.js +1 -1
- package/dist/components/KYC/KYCDefault/IdentityVerification.js +5 -1
- package/dist/components/KYC/KYCDefault/Indicator.js +0 -1
- package/dist/components/KYC/KYCDefault/PersonalInformation.js +3 -1
- package/dist/components/KYC/KYCReminder.lazy.d.ts +1 -0
- package/dist/components/KYC/KYCReminder.lazy.js +13 -12
- package/dist/components/KYC/KycOpenOnHomeMount.js +5 -0
- package/dist/components/Promos/PromosCarousel.js +1 -1
- package/package.json +1 -1
|
@@ -61,5 +61,5 @@ export function JackpotsCarousel({ style, className, ...props }) {
|
|
|
61
61
|
const classNames = isString(className)
|
|
62
62
|
? { root: className }
|
|
63
63
|
: (className ?? {});
|
|
64
|
-
return (_jsxs("div", { style: styles.root, className: classNames.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/jackpots', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg
|
|
64
|
+
return (_jsxs("div", { style: styles.root, className: classNames.root, children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("div", { className: "font-semibold text-lg", children: props.heading ?? 'Jackpots' }), _jsxs("div", { className: "flex items-center md:gap-3xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/jackpots', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { disabled: !canScrollPrev, onClick: scrollPrev, variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsxs(Button, { disabled: !canScrollNext, onClick: scrollNext, variant: "outline", colorScheme: "gray", className: "rounded-l-none", "aria-label": "Next", children: [_jsx("span", { className: "sr-only", children: "Next" }), _jsx(ArrowRightIcon, { className: "size-5" })] })] })] })] }), _jsx("div", { className: "relative mt-lg overflow-hidden", ref: emblaRef, children: _jsx("div", { className: "flex gap-2.5", children: jackpots.map((jackpot) => (_jsx(JackpotsCarouselItemContext, { value: jackpot, children: _jsx(JackpotsCarouselItem, { style: styles.itemRoot, className: classNames, viewAllUrl: props.viewAllUrl, animate: props.animate, customJackpotChestImage: props.customJackpotChestImage, jackpotProfileShape: props.jackpotProfileShape }) }, jackpot.id))) }) })] }));
|
|
65
65
|
}
|
|
@@ -68,6 +68,7 @@ export function IdentityVerification() {
|
|
|
68
68
|
const memberId = memberVerification.data?.id;
|
|
69
69
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
70
70
|
kyc: ctx.kyc,
|
|
71
|
+
kycReminder: ctx.kycReminder,
|
|
71
72
|
})));
|
|
72
73
|
const form = useForm({
|
|
73
74
|
resolver: zodResolver(formSchema),
|
|
@@ -119,5 +120,8 @@ export function IdentityVerification() {
|
|
|
119
120
|
type: 'validate',
|
|
120
121
|
message: error.message,
|
|
121
122
|
});
|
|
122
|
-
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" })
|
|
123
|
+
} }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-6", disabled: createPending || updatePending, children: "Continue" }), featureFlag.enabled && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
|
|
124
|
+
globalStore.kyc.setOpen(false);
|
|
125
|
+
globalStore.kycReminder.setOpen(true);
|
|
126
|
+
}, children: "Skip for now" }))] })] }));
|
|
123
127
|
}
|
|
@@ -4,6 +4,5 @@ import { Progress } from '../../../ui/Progress/index.js';
|
|
|
4
4
|
import { useKYCDefaultContext } from './KYCDefaultContext.js';
|
|
5
5
|
export function Indicator() {
|
|
6
6
|
const kyc = useKYCDefaultContext();
|
|
7
|
-
console.log(kyc.step);
|
|
8
7
|
return (_jsxs("div", { className: "flex items-center justify-center gap-1.5 py-3", children: [_jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step >= 1 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step >= 2 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { className: "w-10 shrink-0", value: kyc.step === 3 ? 100 : 0, onValueChange: noop, children: _jsx(Progress.Track, { className: "bg-bg-primary-hover", children: _jsx(Progress.Range, {}) }) })] }));
|
|
9
8
|
}
|
|
@@ -32,6 +32,7 @@ export function PersonalInformation() {
|
|
|
32
32
|
const featureFlag = useFeatureFlag();
|
|
33
33
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
34
34
|
kyc: ctx.kyc,
|
|
35
|
+
kycReminder: ctx.kycReminder,
|
|
35
36
|
})));
|
|
36
37
|
const memberVerificationQuery = useMemberVerificationQuery();
|
|
37
38
|
const memberVerificationId = memberVerificationQuery.data?.id;
|
|
@@ -126,8 +127,9 @@ export function PersonalInformation() {
|
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
}, disabled: !permanentAddress, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Use permanent address as current address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.sourceOfIncome, children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, { placeholder: "Enter your source of income", ...form.register('sourceOfIncome') }), _jsx(Field.ErrorText, { children: form.formState.errors.sourceOfIncome?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.natureOfWork, children: [_jsx(Field.Label, { children: "Work Description" }), _jsx(Field.Input, { placeholder: "Enter your work description", ...form.register('natureOfWork') }), _jsx(Field.ErrorText, { children: form.formState.errors.natureOfWork?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.placeOfBirth, children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, { placeholder: "Enter your place of birth", ...form.register('placeOfBirth') }), _jsx(Field.ErrorText, { children: form.formState.errors.placeOfBirth?.message })] }), _jsxs(Field.Root, { className: "mt-2xl", invalid: !!form.formState.errors.nationality, children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, { placeholder: "Enter your nationality", ...form.register('nationality') }), _jsx(Field.ErrorText, { children: form.formState.errors.nationality?.message })] }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: updateMemberVerificationMutation.isPending ||
|
|
129
|
-
createMemberVerificationMutation.isPending, children: "Continue" }), featureFlag.enabled &&
|
|
130
|
+
createMemberVerificationMutation.isPending, children: "Continue" }), featureFlag.enabled && (_jsx(Button, { variant: "outline", colorScheme: "gray", className: "mt-lg", onClick: () => {
|
|
130
131
|
globalStore.kyc.setOpen(false);
|
|
132
|
+
globalStore.kycReminder.setOpen(true);
|
|
131
133
|
}, disabled: updateMemberVerificationMutation.isPending ||
|
|
132
134
|
createMemberVerificationMutation.isPending, children: "Skip for now" }))] })] }));
|
|
133
135
|
}
|
|
@@ -3,6 +3,7 @@ export interface KYCReminderProps {
|
|
|
3
3
|
siteName: string;
|
|
4
4
|
logo: ImageProps['src'];
|
|
5
5
|
titleBgColor?: string;
|
|
6
|
+
descriptionBgColor?: string;
|
|
6
7
|
responsibleGamingLogo?: ImageProps['src'];
|
|
7
8
|
}
|
|
8
9
|
export declare function KYCReminder(props: KYCReminderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,6 +23,8 @@ export function KYCReminder(props) {
|
|
|
23
23
|
const { data: session, isLoading: sessionLoading } = useSessionQuery();
|
|
24
24
|
const { data: account, isLoading: accountLoading } = useAccountQuery();
|
|
25
25
|
const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
|
|
26
|
+
const isPending = account?.verificationStatus === 'PENDING';
|
|
27
|
+
const isNotVerified = account?.verificationStatus === 'UNVERIFIED';
|
|
26
28
|
const daysFromCreationToNow = useMemo(() => {
|
|
27
29
|
if (!account?.dateTimeCreated)
|
|
28
30
|
return 0;
|
|
@@ -34,19 +36,18 @@ export function KYCReminder(props) {
|
|
|
34
36
|
!accountLoading &&
|
|
35
37
|
globalStore.kycReminder.open &&
|
|
36
38
|
!globalStore.kyc.open &&
|
|
37
|
-
(
|
|
38
|
-
session?.status === 'authenticated'
|
|
39
|
+
(!isPending || isVerificationLocked) &&
|
|
40
|
+
session?.status === 'authenticated' &&
|
|
41
|
+
featureFlag.enabled, onOpenChange: (details) => {
|
|
39
42
|
globalStore.kycReminder.setOpen(details.open);
|
|
40
|
-
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
daysFromCreationToNow <= 3 &&
|
|
45
|
-
daysFromCreationToNow >= 1 ? (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "JUST A FRIENDLY REMINDER" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["Please complete your KYC information within", ' ', _jsx("span", { className: "font-semibold text-[#FF0000]", children: "3 days" }), ' ', "to avoid temporary lock on your account."] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
|
|
46
|
-
api.setOpen(false);
|
|
47
|
-
globalStore.kyc.setOpen(true);
|
|
48
|
-
}, children: "Complete KYC" }) })) })] })] })) : (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Personal Verification" }), _jsxs("p", { className: "mt-xs text-sm text-text-tertiary-600", children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
43
|
+
}, closeOnEscape: false, closeOnInteractOutside: false, lazyMount: true, unmountOnExit: true, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+3)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+4)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto h-fit max-w-[calc(100dvw-1rem)] overflow-y-auto rounded-lg bg-bg-primary lg:max-w-[400px]", children: [isVerificationLocked && !isPending && (_jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Temporarily Locked" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account has been locked due to incomplete verification. Please complete your verification to restore full access." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
|
|
44
|
+
api.setOpen(false);
|
|
45
|
+
globalStore.kyc.setOpen(true);
|
|
46
|
+
}, children: "Complete KYC" }) })) })] })), isNotVerified && daysFromCreationToNow <= 3 && daysFromCreationToNow >= 1 && !isVerificationLocked && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "JUST A FRIENDLY REMINDER" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["Please complete your KYC information within", ' ', _jsx("span", { className: "font-semibold text-[#FF0000]", children: "3 days" }), ' ', "to avoid temporary lock on your account."] }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] }), _jsx(Dialog.Context, { children: (api) => (_jsx("div", { className: "mt-6 space-y-lg", children: _jsx(Button, { onClick: () => {
|
|
49
47
|
api.setOpen(false);
|
|
50
48
|
globalStore.kyc.setOpen(true);
|
|
51
|
-
}, children: "
|
|
49
|
+
}, children: "Complete KYC" }) })) })] })] })), isNotVerified && !(daysFromCreationToNow <= 3 && daysFromCreationToNow >= 1) && !isVerificationLocked && (_jsxs(_Fragment, { children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(FileCheck02Icon, { className: "text-[#FEDF89]" }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "Personal Verification" }), _jsxs("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: ["All new users are required to complete identity verification to access the full range of ", props.siteName, " services, including withdrawals."] }), _jsx(Dialog.Context, { children: (api) => (_jsxs("div", { className: "mt-3xl space-y-lg", children: [_jsx(Button, { onClick: () => {
|
|
50
|
+
api.setOpen(false);
|
|
51
|
+
globalStore.kyc.setOpen(true);
|
|
52
|
+
}, children: "Verify Now" }), _jsx(Button, { type: "button", variant: "outline", fullWidth: true, onClick: () => api.setOpen(false), children: "Do it later" })] })) })] })] })), isPending && (_jsx(_Fragment, { children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mx-auto mb-4 w-fit rounded-full bg-bg-warning-secondary p-2", children: _jsx(Image, { src: props.logo, alt: `${props.siteName} logo`, width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }) }), _jsx("div", { className: "mx-auto w-fit rounded-full border border-[#932F19] bg-[#511C10] px-2.5 py-0.5", children: _jsx("p", { className: "text-sm font-medium text-[#F7B27A]", children: "Pending..." }) }), _jsx("h2", { className: `mt-4 font-semibold text-lg ${props.titleBgColor}`, children: "VERIFICATION IN PROGRESS" }), _jsx("p", { className: `mt-xs text-sm text-text-tertiary-600 ${props.descriptionBgColor}`, children: "Your account is verification-locked. Please wait for approval to regain full access to this platform." }), _jsxs("div", { className: "mt-6 flex w-full items-center justify-center gap-3xl", children: [_jsx(Image, { src: pagcorLogo, alt: "PAGCOR logo", height: 43, width: 88, className: "h-[43px] w-auto shrink-0", draggable: false, unoptimized: true }), _jsx(Image, { src: props.responsibleGamingLogo ?? responsibleGamingLogo, alt: "Responsible Gaming logo", height: 50, width: 186, className: "h-[50px] w-auto shrink-0", draggable: false, unoptimized: true })] })] }) }))] }) })] }) }));
|
|
52
53
|
}
|
|
@@ -11,6 +11,7 @@ export function KycOpenOnHomeMount() {
|
|
|
11
11
|
const { data: verification, isLoading: verificationLoading } = useMemberVerificationQuery();
|
|
12
12
|
const { data: account, isLoading: accountLoading } = useAccountQuery();
|
|
13
13
|
const isVerificationLocked = account?.status === 'VERIFICATION_LOCKED';
|
|
14
|
+
const isPending = account?.verificationStatus === 'PENDING';
|
|
14
15
|
const hasntSubmittedCompliantDocs = account?.verified ||
|
|
15
16
|
verification?.sumsubVerified ||
|
|
16
17
|
verification?.status === 'PENDING'
|
|
@@ -31,6 +32,10 @@ export function KycOpenOnHomeMount() {
|
|
|
31
32
|
!!verification?.address;
|
|
32
33
|
useEffect(() => {
|
|
33
34
|
if (pathname === '/' && !verificationLoading && !accountLoading) {
|
|
35
|
+
if (isPending) {
|
|
36
|
+
setkycOpen(false);
|
|
37
|
+
setkycReminderOpen(true);
|
|
38
|
+
}
|
|
34
39
|
if (hasntSubmittedCompliantDocs) {
|
|
35
40
|
setkycOpen(true);
|
|
36
41
|
}
|
|
@@ -48,5 +48,5 @@ export function PromosCarousel(props) {
|
|
|
48
48
|
onSelect(emblaApi);
|
|
49
49
|
emblaApi.on('reInit', onSelect).on('select', onSelect);
|
|
50
50
|
}, [emblaApi, onSelect]);
|
|
51
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Promotions' }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/promos', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), empty && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), !empty && (_jsx("div", { ref: emblaRef, className: "relative mt-lg
|
|
51
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "font-semibold text-lg", children: props.heading ?? 'Promotions' }), _jsx("div", { className: "grow" }), _jsxs("div", { className: "flex items-center justify-center gap-xl", children: [_jsxs(Link, { href: props.viewAllUrl ?? '/promos', className: "flex gap-sm font-semibold text-button-tertiary-fg text-sm", children: ["See All", _jsx(ChevronRightIcon, { className: "size-5 lg:hidden" })] }), _jsxs("div", { className: "hidden lg:flex", children: [_jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-r-none border-r-0", onClick: onPrevButtonClick, disabled: prevBtnDisabled, "aria-label": "Previous", children: _jsx(ArrowLeftIcon, { className: "size-5" }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", className: "rounded-l-none", onClick: onNextButtonClick, disabled: nextBtnDisabled, "aria-label": "Next", children: _jsx(ArrowRightIcon, { className: "size-5" }) })] })] })] }), empty && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), !empty && (_jsx("div", { ref: emblaRef, className: "relative mt-lg overflow-hidden", children: _jsxs("div", { className: twMerge('grid auto-cols-[100%] grid-flow-col gap-1.5 lg:auto-cols-[calc((100%-(1.25rem*2))/3)] lg:gap-2xl'), children: [promos.map((promo) => (_jsx(Promo, { data: promo, viewDetailsUrl: props.viewPromoDetailsUrl ?? '/promos' }, promo.id))), cashbacks.map((cashback) => (_jsx(Cashback, { data: cashback, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/cashback' }, cashback.id))), customPromos.map((customPromo) => (_jsx(CustomPromo, { data: customPromo, viewDetailsUrl: props.viewCashbackDetailsUrl ?? '/promos/custom' }, customPromo.id)))] }) }))] }));
|
|
52
52
|
}
|