@opexa/portal-components 0.0.144 → 0.0.145
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.
|
@@ -6,6 +6,7 @@ import { useShallow } from 'zustand/shallow';
|
|
|
6
6
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
7
|
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
8
8
|
import { useProfileCompletionQuery } from '../../client/hooks/useProfileCompletionQuery.js';
|
|
9
|
+
import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
|
|
9
10
|
import { AlertCircleIcon } from '../../icons/AlertCircleIcon.js';
|
|
10
11
|
import { CheckVerified02Icon } from '../../icons/CheckVerified02Icon.js';
|
|
11
12
|
import { CreditCard02Icon } from '../../icons/CreditCard02Icon.js';
|
|
@@ -20,6 +21,7 @@ export function AccountVerification(props) {
|
|
|
20
21
|
kyc: ctx.kyc,
|
|
21
22
|
})));
|
|
22
23
|
const profileCompletionQuery = useProfileCompletionQuery();
|
|
24
|
+
const session = useSessionQuery();
|
|
23
25
|
const profileCompletion = profileCompletionQuery.data;
|
|
24
26
|
const verificationQuery = useMemberVerificationQuery();
|
|
25
27
|
const verification = verificationQuery.data;
|
|
@@ -30,7 +32,8 @@ export function AccountVerification(props) {
|
|
|
30
32
|
verification?.status === 'UNVERIFIED';
|
|
31
33
|
return (_jsxs("div", { className: props.className, 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
|
|
32
34
|
? 'text-text-success-primary'
|
|
33
|
-
: '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: verification?.status !== 'PENDING'
|
|
35
|
+
: '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: verification?.status !== 'PENDING' ||
|
|
36
|
+
(session.data?.status !== 'unauthenticated' && (_jsx(Button, { size: "sm", className: "w-full lg:w-fit", onClick: () => globalStore.kyc.setOpen(true), children: "Verify Now" }))) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
34
37
|
}
|
|
35
38
|
function VerificationNotSubmitted() {
|
|
36
39
|
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." })] }));
|
|
@@ -14,6 +14,7 @@ export interface GamesListProps {
|
|
|
14
14
|
search?: string;
|
|
15
15
|
/** @default "Games"*/
|
|
16
16
|
heading?: string;
|
|
17
|
+
viewProvidersUrl?: string;
|
|
17
18
|
className?: string | ClassNameEntries;
|
|
18
19
|
}
|
|
19
20
|
export declare function GamesList__client(props: GamesListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { isString, noop } from 'lodash-es';
|
|
4
|
+
import Link from 'next/link';
|
|
4
5
|
import { useGamesQuery } from '../../client/hooks/useGamesQuery.js';
|
|
5
6
|
import { useInfiniteQueryHelper } from '../../client/hooks/useInfiniteQueryHelper.js';
|
|
7
|
+
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
6
8
|
import { GamingPad01Icon } from '../../icons/GamingPad01Icon.js';
|
|
7
9
|
import { SpinnerIcon } from '../../icons/SpinnerIcon.js';
|
|
8
10
|
import { Button } from '../../ui/Button/index.js';
|
|
@@ -20,7 +22,7 @@ export function GamesList__client(props) {
|
|
|
20
22
|
const classNames = isString(props.className)
|
|
21
23
|
? { root: props.className }
|
|
22
24
|
: (props.className ?? {});
|
|
23
|
-
return (_jsxs("div", { className: classNames.root, children: [_jsx("h2", { className: "text-lg font-semibold", children: props.heading ?? 'Games' }), totalRows <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : GamingPad01Icon, title: loading ? 'Just a moment' : 'No games', message: loading
|
|
25
|
+
return (_jsxs("div", { className: classNames.root, children: [_jsxs("div", { className: "flex flex-col lg:flex-row lg:items-center lg:justify-between", children: [_jsx("h2", { className: "order-2 mt-4xl text-lg font-semibold lg:order-none lg:mt-0", children: props.heading ?? 'Games' }), props.viewProvidersUrl && (_jsxs(Link, { href: props.viewProvidersUrl, className: "text-button-tertiary-fg order-1 flex items-center gap-sm text-sm font-semibold lg:order-none", children: [_jsx(ChevronLeftIcon, { className: "size-5" }), "Back to all providers"] }))] }), totalRows <= 0 && (_jsx(Empty, { icon: loading ? SpinnerIcon : GamingPad01Icon, title: loading ? 'Just a moment' : 'No games', message: loading
|
|
24
26
|
? 'Fetching latest games...'
|
|
25
27
|
: 'No game is currently available. Please check back later', className: "mt-lg" })), totalRows >= 1 && (_jsxs(_Fragment, { children: [_jsx("div", { className: "mt-lg grid grid-cols-3 gap-1.5 lg:grid-cols-6 lg:gap-2.5", children: availableRows.map((game) => (_jsx(GameContext, { value: game, children: _jsx(Game, { badge: props.badge, className: {
|
|
26
28
|
root: classNames.thumbnailRoot,
|
|
@@ -9,7 +9,6 @@ import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerifica
|
|
|
9
9
|
import { XIcon } from '../../icons/XIcon.js';
|
|
10
10
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
11
11
|
import { Portal } from '../../ui/Portal/index.js';
|
|
12
|
-
import { BasicInformation } from './BasicInformation.js';
|
|
13
12
|
import { CaptureIdDocument } from './CaptureIdDocument.js';
|
|
14
13
|
import { CaptureSelfie } from './CaptureSelfie.js';
|
|
15
14
|
import { IdentityVerification } from './IdentityVerification.js';
|
|
@@ -41,8 +40,8 @@ export function KYC(props) {
|
|
|
41
40
|
return (_jsx(KYCContext, { value: kyc, children: _jsx(Dialog.Root, { open: globalStore.kyc.open, onOpenChange: (details) => {
|
|
42
41
|
globalStore.kyc.setOpen(details.open);
|
|
43
42
|
}, lazyMount: true, unmountOnExit: true, onExitComplete: () => {
|
|
44
|
-
kyc.setStep(
|
|
43
|
+
kyc.setStep(2);
|
|
45
44
|
kyc.setDone(false);
|
|
46
45
|
kyc.setCapturing(null);
|
|
47
|
-
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt lg:min-h-auto mx-auto min-h-full w-full lg:w-fit", children: [kyc.capturing === 'SELFIE' && _jsx(CaptureSelfie, {}), kyc.capturing === 'ID_DOCUMENT' && _jsx(CaptureIdDocument, {}), !kyc.capturing && (_jsxs("div", { className: "w-full p-3xl lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step ===
|
|
46
|
+
}, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt lg:min-h-auto mx-auto min-h-full w-full lg:w-fit", children: [kyc.capturing === 'SELFIE' && _jsx(CaptureSelfie, {}), kyc.capturing === 'ID_DOCUMENT' && _jsx(CaptureIdDocument, {}), !kyc.capturing && (_jsxs("div", { className: "w-full p-3xl lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }))] }) })] }) }) }));
|
|
48
47
|
}
|