@opexa/portal-components 0.0.55 → 0.0.56
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/AccountPaymentMethods/AccountPaymentMethods.d.ts +1 -0
- package/dist/components/AccountPaymentMethods/AccountPaymentMethods.js +3 -0
- package/dist/components/AccountPaymentMethods/index.d.ts +1 -0
- package/dist/components/AccountPaymentMethods/index.js +1 -0
- package/dist/components/AccountVerification/AccountVerificationContext.d.ts +14 -0
- package/dist/components/AccountVerification/AccountVerificationContext.js +27 -0
- package/dist/components/AccountVerification/VerificationCapture.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationCapture.js +28 -0
- package/dist/components/AccountVerification/VerificationComplete.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationComplete.js +9 -0
- package/dist/components/AccountVerification/VerificationDetails.d.ts +1 -0
- package/dist/components/AccountVerification/VerificationDetails.js +38 -0
- package/dist/components/GamesSearch/GamesSearchTrigger.d.ts +5 -0
- package/dist/components/GamesSearch/GamesSearchTrigger.js +14 -0
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +184 -184
- package/dist/components/KYC/AccountVerificationContext.d.ts +14 -0
- package/dist/components/KYC/AccountVerificationContext.js +27 -0
- package/dist/components/KYC/VerificationCapture.d.ts +1 -0
- package/dist/components/KYC/VerificationCapture.js +28 -0
- package/dist/components/KYC/VerificationComplete.d.ts +1 -0
- package/dist/components/KYC/VerificationComplete.js +9 -0
- package/dist/components/KYC/VerificationDetails.d.ts +1 -0
- package/dist/components/KYC/VerificationDetails.js +38 -0
- package/dist/components/Promo/Promo.client.d.ts +2 -0
- package/dist/components/Promo/Promo.client.js +9 -0
- package/dist/components/Promo/Promo.js +2 -2
- package/dist/components/Promos/PromoCarousel.js +3 -3
- package/dist/components/Promos/PromoGrid.js +3 -4
- package/dist/components/Promos/PromoItem.d.ts +1 -1
- package/dist/components/Promos/PromoItem.js +5 -4
- package/dist/components/Promos/Promos.d.ts +1 -3
- package/dist/components/Promos/Promos.js +3 -1
- package/dist/styles/theme.css +696 -696
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Badge/Badge.d.ts +12 -12
- package/dist/ui/Badge/badge.recipe.d.ts +3 -3
- package/dist/ui/Checkbox/Checkbox.d.ts +23 -23
- package/dist/ui/Checkbox/checkbox.recipe.d.ts +3 -3
- package/dist/ui/Clipboard/Clipboard.d.ts +18 -18
- package/dist/ui/Clipboard/clipboard.recipe.d.ts +3 -3
- package/dist/ui/Collapsible/Collapsible.d.ts +20 -20
- package/dist/ui/Collapsible/collapsible.recipe.d.ts +5 -5
- package/dist/ui/Combobox/Combobox.d.ts +42 -42
- package/dist/ui/Combobox/combobox.recipe.d.ts +3 -3
- package/dist/ui/DatePicker/DatePicker.d.ts +192 -192
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +8 -8
- package/dist/ui/Dialog/Dialog.d.ts +154 -154
- package/dist/ui/Dialog/dialog.recipe.d.ts +14 -14
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/PasswordInput/PasswordInput.d.ts +18 -18
- package/dist/ui/PasswordInput/passwordInput.recipe.d.ts +3 -3
- package/dist/ui/Popover/Popover.d.ts +88 -88
- package/dist/ui/Popover/popover.recipe.d.ts +8 -8
- package/dist/ui/Select/Select.d.ts +45 -45
- package/dist/ui/Select/select.recipe.d.ts +3 -3
- package/dist/ui/Table/Table.d.ts +21 -21
- package/dist/ui/Table/table.recipe.d.ts +3 -3
- package/dist/ui/Tabs/Tabs.d.ts +15 -15
- package/dist/ui/Tabs/tabs.recipe.d.ts +3 -3
- package/package.json +156 -156
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Portal } from '@ark-ui/react';
|
|
3
|
+
import { CheckCircleIcon } from '../../icons/index.js';
|
|
4
|
+
import { AlertDialog, Button } from '../../ui/index.js';
|
|
5
|
+
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
6
|
+
export function VerificationComplete() {
|
|
7
|
+
const context = useAccountVerificationContext();
|
|
8
|
+
return (_jsx(AlertDialog.Root, { open: context.completed, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Button, { className: "mt-3xl", onClick: () => context.reset(), children: "Ok" })] }) })] }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function VerificationDetails(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ark } from '@ark-ui/react';
|
|
3
|
+
import { twMerge } from 'tailwind-merge';
|
|
4
|
+
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
5
|
+
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
6
|
+
import { Button } from '../../ui/index.js';
|
|
7
|
+
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
8
|
+
export function VerificationDetails() {
|
|
9
|
+
const context = useAccountVerificationContext();
|
|
10
|
+
const profileCompletionQuery = useProfileCompletionQuery();
|
|
11
|
+
const profileCompletion = profileCompletionQuery.data;
|
|
12
|
+
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
+
const verification = verificationQuery.data;
|
|
14
|
+
const empty = verification == null;
|
|
15
|
+
const pending = verification?.status === 'PENDING';
|
|
16
|
+
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
+
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
+
verification?.status === 'UNVERIFIED';
|
|
19
|
+
if (context.started)
|
|
20
|
+
return null;
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
|
|
22
|
+
? 'text-text-success-primary'
|
|
23
|
+
: 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary flex justify-end border-t px-4 py-3 lg:py-xl", children: _jsx(Button, { size: "sm", onClick: () => {
|
|
24
|
+
context.setStarted(true);
|
|
25
|
+
}, className: "w-full lg:w-fit", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
26
|
+
}
|
|
27
|
+
function VerificationNotSubmitted() {
|
|
28
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 max-w-[800px] text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
|
|
29
|
+
}
|
|
30
|
+
function VerificationInProgress() {
|
|
31
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] })] }));
|
|
32
|
+
}
|
|
33
|
+
function VerificationSuccess() {
|
|
34
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] })] }));
|
|
35
|
+
}
|
|
36
|
+
function VerificationFailed() {
|
|
37
|
+
return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] })] }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import Link from 'next/link';
|
|
5
|
+
import { ChevronLeftIcon } from '../../icons/index.js';
|
|
6
|
+
import { Button, Prose } from '../../ui/index.js';
|
|
7
|
+
export function Promo__client(props) {
|
|
8
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: "https://s3.ap-east-1.amazonaws.com/opexa-assets.opexasystem.com/assets/BSxIXEsa59_zzMAR27-ALLDAYREBATE06-STATIC-WEB-HB-1920x1080.png", alt: "", width: 1024, height: 600, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx(Button, { className: "mt-xl lg:mt-6", children: "Deposit Now" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: "Welcome Bonus 100% up to $500 + 10 Free Spins" }), _jsx("p", { className: "text-text-secondary-700 mt-xl lg:mt-6", children: "Ends 5/26/2025, 1:59:59 AM" }), _jsxs(Prose, { className: "mt-2xl lg:mt-6", children: [_jsx("p", { children: "Mi tincidunt elit, id quisque ligula ac diam, amet. Vel etiam suspendisse morbi eleifend faucibus eget vestibulum felis. Dictum quis montes, sit sit. Tellus aliquam enim urna, etiam. Mauris posuere vulputate arcu amet, vitae nisi, tellus tincidunt. At feugiat sapien varius id." }), _jsx("p", { children: "Eget quis mi enim, leo lacinia pharetra, semper. Eget in volutpat mollis at volutpat lectus velit, sed auctor. Porttitor fames arcu quis fusce augue enim. Quis at habitant diam at. Suscipit tristique risus, at donec. In turpis vel et quam imperdiet. Ipsum molestie aliquet sodales id est ac volutpat." }), _jsx("p", { children: "Ipsum sit mattis nulla quam nulla. Gravida id gravida ac enim mauris id. Non pellentesque congue eget consectetur turpis. Sapien, dictum molestie sem tempor. Diam elit, orci, tincidunt aenean tempus. Quis velit eget ut tortor tellus. Sed vel, congue felis elit erat nam nibh orci." }), _jsx("p", { children: "Dolor enim eu tortor urna sed duis nulla. Aliquam vestibulum, nulla odio nisl vitae. In aliquet pellentesque aenean hac vestibulum turpis mi bibendum diam. Tempor integer aliquam in vitae malesuada fringilla." }), _jsx("p", { children: "Elit nisi in eleifend sed nisi. Pulvinar at orci, proin imperdiet commodo consectetur convallis risus. Sed condimentum enim dignissim adipiscing faucibus consequat, urna. Viverra purus et erat auctor aliquam. Risus, volutpat vulputate posuere purus sit congue convallis aliquet. Arcu id augue ut feugiat donec porttitor neque. Mauris, neque ultricies eu vestibulum, bibendum quam lorem id. Dolor lacus, eget nunc lectus in tellus, pharetra, porttitor." }), _jsx("p", { children: "Ipsum sit mattis nulla quam nulla. Gravida id gravida ac enim mauris id. Non pellentesque congue eget consectetur turpis. Sapien, dictum molestie sem tempor. Diam elit, orci, tincidunt aenean tempus. Quis velit eget ut tortor tellus. Sed vel, congue felis elit erat nam nibh orci." }), _jsx("h5", { children: "General Conditions:" }), _jsx("p", { children: "Mi tincidunt elit, id quisque ligula ac diam, amet. Vel etiam suspendisse morbi eleifend faucibus eget vestibulum felis. Dictum quis montes, sit sit. Tellus aliquam enim urna, etiam. Mauris posuere vulputate arcu amet, vitae nisi, tellus tincidunt. At feugiat sapien varius id." }), _jsx("p", { children: "Eget quis mi enim, leo lacinia pharetra, semper. Eget in volutpat mollis at volutpat lectus velit, sed auctor. Porttitor fames arcu quis fusce augue enim. Quis at habitant diam at. Suscipit tristique risus, at donec. In turpis vel et quam imperdiet. Ipsum molestie aliquet sodales id est ac volutpat." })] }), _jsxs(Prose, { className: "bg-bg-secondary mt-xl rounded-2xl p-2xl lg:mt-16 lg:p-4xl", children: [_jsx("h2", { children: "Conclusion" }), _jsx("p", { children: "Morbi sed imperdiet in ipsum, adipiscing elit dui lectus. Tellus id scelerisque est ultricies ultricies. Duis est sit sed leo nisl, blandit elit sagittis. Quisque tristique consequat quam sed. Nisl at scelerisque amet nulla purus habitasse." }), _jsx("p", { children: "Nunc sed faucibus bibendum feugiat sed interdum. Ipsum egestas condimentum mi massa. In tincidunt pharetra consectetur sed duis facilisis metus. Etiam egestas in nec sed et. Quis lobortis at sit dictum eget nibh tortor commodo cursus." }), _jsx("p", { children: "Odio felis sagittis, morbi feugiat tortor vitae feugiat fusce aliquet. Nam elementum urna nisi aliquet erat dolor enim. Ornare id morbi eget ipsum. Aliquam senectus neque ut id eget consectetur dictum. Donec posuere pharetra odio consequat scelerisque et, nunc tortor." })] })] }));
|
|
9
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Promo__client } from './Promo.client.js';
|
|
3
3
|
export async function Promo(props) {
|
|
4
4
|
/**
|
|
5
5
|
* await prefetchPromoQuery(props.id);
|
|
6
6
|
*/
|
|
7
|
-
return _jsx(
|
|
7
|
+
return _jsx(Promo__client, { ...props });
|
|
8
8
|
}
|
|
@@ -10,8 +10,8 @@ import { Button } from '../../ui/index.js';
|
|
|
10
10
|
import { Empty } from '../Empty.js';
|
|
11
11
|
import { PromosItem } from './PromoItem.js';
|
|
12
12
|
export function PromoCarousel(props) {
|
|
13
|
-
const promosQuery = usePromosQuery(
|
|
14
|
-
const promos = promosQuery.data
|
|
13
|
+
const promosQuery = usePromosQuery();
|
|
14
|
+
const promos = promosQuery.data ?? [];
|
|
15
15
|
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
16
16
|
align: 'start',
|
|
17
17
|
slidesToScroll: 1,
|
|
@@ -37,5 +37,5 @@ export function PromoCarousel(props) {
|
|
|
37
37
|
onSelect(emblaApi);
|
|
38
38
|
emblaApi.on('reInit', onSelect).on('select', onSelect);
|
|
39
39
|
}, [emblaApi, onSelect]);
|
|
40
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", 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: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", 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" }) })] })] })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), promos.length >= 1 && (_jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: twMerge('grid auto-cols-[
|
|
40
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", 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: "text-button-tertiary-fg flex gap-sm text-sm font-semibold", 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" }) })] })] })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-8" })), promos.length >= 1 && (_jsx("div", { ref: emblaRef, className: "relative mt-lg lg:overflow-hidden", children: _jsx("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(PromosItem, { promo: promo, redirectUrl: props.viewAllUrl }, promo.id))) }) }))] }));
|
|
41
41
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
3
|
import { usePromosQuery } from '../../client/hooks/index.js';
|
|
5
4
|
import { Gift01Icon } from '../../icons/index.js';
|
|
6
5
|
import { Empty } from '../Empty.js';
|
|
7
6
|
import { PromosItem } from './PromoItem.js';
|
|
8
7
|
export function PromoGrid(props) {
|
|
9
|
-
const promosQuery = usePromosQuery(
|
|
10
|
-
const promos = promosQuery.data
|
|
11
|
-
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-lg" })), promos.length >= 1 && (_jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className:
|
|
8
|
+
const promosQuery = usePromosQuery();
|
|
9
|
+
const promos = promosQuery.data ?? [];
|
|
10
|
+
return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-center", children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Promos' }), _jsx("div", { className: "grow" })] }), promos.length <= 0 && (_jsx(Empty, { icon: Gift01Icon, title: "No Promos", message: "No promo is currently available.", className: "mt-lg" })), promos.length >= 1 && (_jsx("div", { className: "relative mt-lg lg:overflow-hidden", children: _jsx("div", { className: "grid gap-3xl lg:grid-cols-3 lg:gap-2xl", children: promos.map((promo) => (_jsx(PromosItem, { promo: promo, redirectUrl: props.viewAllUrl }, promo.id))) }) }))] }));
|
|
12
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Promo } from '@opexa/portal-sdk-core';
|
|
2
2
|
interface PromosItemProps {
|
|
3
3
|
promo: Promo;
|
|
4
|
-
|
|
4
|
+
redirectUrl?: string;
|
|
5
5
|
}
|
|
6
6
|
export declare function PromosItem(props: PromosItemProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import Image from 'next/image';
|
|
3
|
-
import
|
|
4
|
-
import { twJoin } from 'tailwind-merge';
|
|
3
|
+
import Link from 'next/link';
|
|
5
4
|
import { Button } from '../../ui/index.js';
|
|
6
5
|
export function PromosItem(props) {
|
|
7
6
|
const { promo } = props;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
return (_jsxs(Link, { href: `${props.redirectUrl ?? '/promos'}/${promo.id}`, className: "border-border-secondary bg-accent-50 bg-bg-primary-alt relative flex h-full flex-col overflow-hidden rounded-2xl border", children: [promo.banner.url && (_jsx(Image, { src: promo.banner.url, alt: promo.name, width: 1200, height: 500, priority: true, className: "block aspect-[365/180] w-full object-cover" })), _jsxs("div", { className: "flex flex-grow flex-col px-4 pb-3xl pt-2xl", children: [_jsx("div", { className: "w-full grow text-center text-xl font-semibold", children: promo.name }), _jsx("div", { className: "mt-auto pt-4", children: _jsx(Button, { size: "sm", asChild: true, children: _jsx("div", { role: "button", onClick: (e) => {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
e.stopPropagation();
|
|
10
|
+
}, children: "Get bonus" }) }) })] })] }));
|
|
10
11
|
}
|
|
@@ -3,11 +3,9 @@ export interface PromosProps {
|
|
|
3
3
|
heading?: string;
|
|
4
4
|
/** @default "/promos" */
|
|
5
5
|
viewAllUrl?: string;
|
|
6
|
-
/** @default true */
|
|
7
|
-
shouldShowDescription?: boolean;
|
|
8
6
|
/** @default 1 */
|
|
9
7
|
className?: string;
|
|
10
8
|
/** @default 'carousel' */
|
|
11
9
|
layout?: 'carousel' | 'grid';
|
|
12
10
|
}
|
|
13
|
-
export declare function Promos(props: PromosProps): import("react/jsx-runtime").JSX.Element
|
|
11
|
+
export declare function Promos(props: PromosProps): Promise<import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { prefetchPromosQuery } from '../../server/utils/index.js';
|
|
2
3
|
import { PromoCarousel } from './PromoCarousel.js';
|
|
3
4
|
import { PromoGrid } from './PromoGrid.js';
|
|
4
|
-
export function Promos(props) {
|
|
5
|
+
export async function Promos(props) {
|
|
6
|
+
await prefetchPromosQuery();
|
|
5
7
|
if (props.layout === 'grid') {
|
|
6
8
|
return _jsx(PromoGrid, { ...props });
|
|
7
9
|
}
|