@opexa/portal-components 0.0.665 → 0.0.666
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/Account/Account.lazy.d.ts +2 -0
- package/dist/components/Account/Account.lazy.js +1 -1
- package/dist/components/Account/AccountTrigger.d.ts +3 -1
- package/dist/components/Account/AccountTrigger.js +2 -2
- package/dist/components/AccountInfo/AccountInfo.d.ts +2 -0
- package/dist/components/AccountInfo/AccountInfo.js +5 -5
- package/dist/components/AccountInfo/GoogleDisconnect.d.ts +7 -0
- package/dist/components/AccountInfo/GoogleDisconnect.js +11 -0
- package/dist/components/KYC/KYCVerificationStatus.lazy.js +4 -7
- package/dist/components/PortalProvider/CXDTokenObserver.js +11 -11
- package/dist/handlers/index.d.ts +2 -2
- package/dist/icons/LinkBrokenIcon.d.ts +2 -0
- package/dist/icons/LinkBrokenIcon.js +4 -0
- package/dist/images/placeholder-avatar-2.png +0 -0
- package/dist/ui/AlertDialog/AlertDialog.d.ts +154 -154
- package/dist/ui/AlertDialog/alertDialog.recipe.d.ts +14 -14
- package/dist/ui/Carousel/Carousel.d.ts +45 -45
- package/dist/ui/Carousel/carousel.recipe.d.ts +5 -5
- 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 +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/ui/Dialog/Dialog.d.ts +33 -33
- package/dist/ui/Dialog/dialog.recipe.d.ts +3 -3
- package/dist/ui/Drawer/Drawer.d.ts +33 -33
- package/dist/ui/Drawer/drawer.recipe.d.ts +3 -3
- package/dist/ui/Menu/Menu.d.ts +144 -144
- package/dist/ui/Menu/menu.recipe.d.ts +8 -8
- 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.anatomy.d.ts +1 -1
- 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/dist/ui/Tooltip/Tooltip.d.ts +30 -30
- package/dist/ui/Tooltip/tooltip.recipe.d.ts +5 -5
- package/package.json +1 -1
- package/dist/components/Banner/Banner.client.d.ts +0 -12
- package/dist/components/Banner/Banner.client.js +0 -49
- package/dist/components/PortalProvider/AndroidOnlyComponents.d.ts +0 -1
- package/dist/components/PortalProvider/AndroidOnlyComponents.js +0 -12
- package/dist/components/SignIn/utils.d.ts +0 -8
- package/dist/components/SignIn/utils.js +0 -26
- package/dist/constants/Branches.d.ts +0 -2
- package/dist/constants/Branches.js +0 -42
- package/dist/third-parties/FacebookPixel/FacebookPixel.d.ts +0 -4
- package/dist/third-parties/FacebookPixel/FacebookPixel.js +0 -4
- package/dist/third-parties/FacebookPixel/api.d.ts +0 -0
- package/dist/third-parties/FacebookPixel/api.js +0 -1
- package/dist/third-parties/FacebookPixel/index.d.ts +0 -1
- package/dist/third-parties/FacebookPixel/index.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.d.ts +0 -4
- package/dist/third-parties/GoogleRecaptcha/GoogleRecaptcha.js +0 -4
- package/dist/third-parties/GoogleRecaptcha/api.d.ts +0 -0
- package/dist/third-parties/GoogleRecaptcha/api.js +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.d.ts +0 -1
- package/dist/third-parties/GoogleRecaptcha/index.js +0 -1
- package/dist/third-parties/index.d.ts +0 -2
- package/dist/third-parties/index.js +0 -2
|
@@ -51,5 +51,7 @@ export interface AccountProps {
|
|
|
51
51
|
notificationsEnabled?: boolean;
|
|
52
52
|
/** @default true */
|
|
53
53
|
shouldShowAccountStatus?: boolean;
|
|
54
|
+
/** Avatar image source */
|
|
55
|
+
avatar?: string;
|
|
54
56
|
}
|
|
55
57
|
export declare function Account(props: AccountProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -92,7 +92,7 @@ function Profile() {
|
|
|
92
92
|
return 'danger';
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "font-semibold text-text-secondary-700 leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsxs("p", { className: "grow items-center text-text-tertiary-600 leading-tight", children: ["ID: ", account?.id] }), accountProps.shouldShowAccountStatus && (_jsxs(Badge.Root, { colorScheme: getVerificationColorScheme(account?.verificationStatus), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: capitalize(account?.verificationStatus || '') })] }))] })] })] }));
|
|
95
|
+
return (_jsxs("div", { className: "flex shrink-0 items-center gap-lg", children: [_jsx(Image, { src: accountProps.avatar || avatarPlaceholder, alt: "", width: 48, height: 48, className: "size-12" }), _jsxs("div", { className: "grow", children: [_jsx("p", { className: "font-semibold text-text-secondary-700 leading-tight", children: account?.name }), _jsxs("div", { className: "flex", children: [_jsxs("p", { className: "grow items-center text-text-tertiary-600 leading-tight", children: ["ID: ", account?.id] }), accountProps.shouldShowAccountStatus && (_jsxs(Badge.Root, { colorScheme: getVerificationColorScheme(account?.verificationStatus), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: capitalize(account?.verificationStatus || '') })] }))] })] })] }));
|
|
96
96
|
}
|
|
97
97
|
function Links({ router, classNames, }) {
|
|
98
98
|
const accountProps = useAccountPropsContext();
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef } from 'react';
|
|
2
2
|
export interface AccountTriggerProps extends ComponentPropsWithRef<'button'> {
|
|
3
3
|
asChild?: boolean;
|
|
4
|
+
/** Avatar image source */
|
|
5
|
+
avatar?: string;
|
|
4
6
|
}
|
|
5
|
-
export declare function AccountTrigger({ asChild, children, ...props }: AccountTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function AccountTrigger({ asChild, children, avatar, ...props }: AccountTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,7 +8,7 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
|
8
8
|
import { XIcon } from '../../icons/XIcon.js';
|
|
9
9
|
import avatarPlaceholder from '../../images/placeholder-avatar.png';
|
|
10
10
|
import { IconButton } from '../../ui/IconButton/index.js';
|
|
11
|
-
export function AccountTrigger({ asChild, children, ...props }) {
|
|
11
|
+
export function AccountTrigger({ asChild, children, avatar, ...props }) {
|
|
12
12
|
const desktop = useMediaQuery('(min-width: 1024px)', {
|
|
13
13
|
defaultValue: true,
|
|
14
14
|
});
|
|
@@ -22,5 +22,5 @@ export function AccountTrigger({ asChild, children, ...props }) {
|
|
|
22
22
|
return (_jsx(ark.button, { type: "button", "aria-label": "Toggle account menu", "data-open": disclosure.open ? 'open' : 'closed', ...props, onClick: (e) => {
|
|
23
23
|
disclosure.setOpen(!disclosure.open);
|
|
24
24
|
return props.onClick?.(e);
|
|
25
|
-
}, asChild: !children ? true : asChild, children: children ?? (_jsx(IconButton, { id: "opexa-powerplay:account-trigger", size: "sm", colorScheme: "gray", children: !desktop && disclosure.open ? (_jsx(XIcon, {})) : (_jsx(Image, { src: avatarPlaceholder, alt: "", width: 64, height: 64, className: "size-10" })) })) }));
|
|
25
|
+
}, asChild: !children ? true : asChild, children: children ?? (_jsx(IconButton, { id: "opexa-powerplay:account-trigger", size: "sm", colorScheme: "gray", children: !desktop && disclosure.open ? (_jsx(XIcon, {})) : (_jsx(Image, { src: avatar || avatarPlaceholder, alt: "", width: 64, height: 64, className: "size-10" })) })) }));
|
|
26
26
|
}
|
|
@@ -25,7 +25,7 @@ import { FacebookIcon } from '../../icons/FacebookIcon.js';
|
|
|
25
25
|
import { GoogleIcon } from '../../icons/GoogleIcon.js';
|
|
26
26
|
import { LinkBroken02Icon } from '../../icons/LinkBroken02Icon.js';
|
|
27
27
|
import { XIcon } from '../../icons/XIcon.js';
|
|
28
|
-
import
|
|
28
|
+
import avatarPlaceholder from '../../images/placeholder-avatar.png';
|
|
29
29
|
import { Button } from '../../ui/Button/index.js';
|
|
30
30
|
import { Dialog } from '../../ui/Dialog/index.js';
|
|
31
31
|
import { Field } from '../../ui/Field/index.js';
|
|
@@ -41,9 +41,9 @@ const accountSchema = z.object({
|
|
|
41
41
|
.regex(/^[a-zA-Z0-9]+$/, 'Username can only contain letters and numbers'),
|
|
42
42
|
});
|
|
43
43
|
export function AccountInfo(props) {
|
|
44
|
-
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, {}), _jsx(ContactInfo, {}), _jsx(PersonalInfo, { shouldShowBranchCode: props.shouldShowBranchCode, branchCodes: props.branchCodes }), _jsx(SSO, { google: props.googleSso, facebook: props.facebookSso })] }));
|
|
44
|
+
return (_jsxs("div", { className: twMerge('space-y-3xl', props.className), children: [_jsx(ProfileInfo, { avatar: props.avatar }), _jsx(ContactInfo, {}), _jsx(PersonalInfo, { shouldShowBranchCode: props.shouldShowBranchCode, branchCodes: props.branchCodes }), _jsx(SSO, { google: props.googleSso, facebook: props.facebookSso })] }));
|
|
45
45
|
}
|
|
46
|
-
function ProfileInfo() {
|
|
46
|
+
function ProfileInfo({ avatar }) {
|
|
47
47
|
const [edit, setEdit] = useState(false);
|
|
48
48
|
const accountQuery = useAccountQuery();
|
|
49
49
|
const account = accountQuery.data;
|
|
@@ -74,7 +74,7 @@ function ProfileInfo() {
|
|
|
74
74
|
},
|
|
75
75
|
resolver: zodResolver(accountSchema),
|
|
76
76
|
});
|
|
77
|
-
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Profile Info" }), _jsx("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt", children: _jsx("div", { className: "border-border-secondary px-4 py-5", children: _jsxs("div", { className: "flex items-start gap-xl", children: [_jsx(Image, { src: avatar, alt: "", width: 80, height: 80, className: "mt-2 size-14 shrink-0 rounded-md object-cover" }), edit ? (_jsxs("form", { onSubmit: form.handleSubmit((data) => {
|
|
77
|
+
return (_jsxs("div", { children: [_jsx("h2", { className: "font-semibold text-sm text-text-secondary-700", children: "Profile Info" }), _jsx("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt", children: _jsx("div", { className: "border-border-secondary px-4 py-5", children: _jsxs("div", { className: "flex items-start gap-xl", children: [_jsx(Image, { src: avatar || avatarPlaceholder, alt: "", width: 80, height: 80, className: "mt-2 size-14 shrink-0 rounded-md object-cover" }), edit ? (_jsxs("form", { onSubmit: form.handleSubmit((data) => {
|
|
78
78
|
mutate({
|
|
79
79
|
name: data.name,
|
|
80
80
|
});
|
|
@@ -147,7 +147,7 @@ function PersonalInfo(props) {
|
|
|
147
147
|
? data.birthDay
|
|
148
148
|
: undefined,
|
|
149
149
|
});
|
|
150
|
-
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), props.shouldShowBranchCode && (_jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Branch Code" }), _jsx(Field.Input, { type: "text", disabled: true, value: displayBranchName ?? account?.branchCode ?? '' })] }))] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
150
|
+
}), children: [_jsxs("div", { className: "px-4 py-5 lg:px-3xl lg:py-5", children: [_jsxs(Field.Root, { invalid: !!form.formState.errors.realName, readOnly: !!account?.realName, children: [_jsx(Field.Label, { children: "Full name" }), _jsx(Field.Input, { ...form.register('realName') }), _jsx(Field.ErrorText, { children: form.formState.errors.realName?.message })] }), _jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Date of birth" }), _jsx(Field.Input, { type: "date", ...form.register('birthDay'), className: twMerge('h-full py-2.5', account?.birthDay && 'pointer-events-none') }), _jsx(Field.ErrorText, { children: form.formState.errors.birthDay?.message })] }), props.shouldShowBranchCode && (_jsxs(Field.Root, { className: "mt-6", invalid: !!form.formState.errors.birthDay, readOnly: !!account?.birthDay, children: [_jsx(Field.Label, { children: "Branch Code" }), _jsx(Field.Input, { type: "text", disabled: true, value: displayBranchName ?? account?.branchCode ?? '' })] }))] }), form.formState.isDirty && (_jsxs("div", { className: "flex justify-end gap-lg border-border-secondary border-t px-xl py-lg lg:px-3xl lg:py-xl", children: [_jsx(Button, { size: "sm", variant: "outline", fullWidth: false, disabled: updateAccountMutation.isPending, onClick: () => form.reset(), children: "Cancel" }), _jsx(Button, { type: "submit", size: "sm", fullWidth: false, disabled: !form.formState.isValid || updateAccountMutation.isPending, children: "Save Changes" })] }))] })] }));
|
|
151
151
|
}
|
|
152
152
|
function ContactInfo() {
|
|
153
153
|
const localeInfo = useLocaleInfo();
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type UseDisclosureReturn } from '../../client/hooks/useDisclosure';
|
|
2
|
+
interface GoogleDisconnectProps {
|
|
3
|
+
onConfirmAction?: (ctx: UseDisclosureReturn) => React.ReactNode;
|
|
4
|
+
children?: (ctx: UseDisclosureReturn) => React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function GoogleDisconnect(props: GoogleDisconnectProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useDisclosure, } from '../../client/hooks/useDisclosure.js';
|
|
4
|
+
import { LinkBrokenIcon } from '../../icons/LinkBrokenIcon.js';
|
|
5
|
+
import { XIcon } from '../../icons/XIcon.js';
|
|
6
|
+
import { Dialog } from '../../ui/Dialog/index.js';
|
|
7
|
+
import { Portal } from '../../ui/Portal/index.js';
|
|
8
|
+
export function GoogleDisconnect(props) {
|
|
9
|
+
const disclosure = useDisclosure();
|
|
10
|
+
return (_jsxs(_Fragment, { children: [props.children?.(disclosure), _jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: disclosure.open, onOpenChange: (details) => disclosure.setOpen(details.open), closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, { className: "!z-[calc(var(--z-dialog)+1)]" }), _jsx(Dialog.Positioner, { className: "!z-[calc(var(--z-dialog)+2)] flex items-center justify-center", children: _jsxs(Dialog.Content, { className: "mx-auto min-h-auto max-w-[25rem] overflow-y-auto rounded-xl p-6", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsxs("div", { className: "flex flex-col ", children: [_jsx("div", { className: "mx-auto flex size-12 items-center justify-center rounded-full bg-bg-brand-secondary text-text-brand", children: _jsx(LinkBrokenIcon, {}) }), _jsx("h2", { className: "mb-1 text-center font-semibold text-lg xl:mt-xl", children: "Disconnect Google Account" }), _jsx("p", { className: "text-center text-sm text-text-tertiary-600 leading-2xl", children: "Are you sure you want to disconnect your Google account? This may affect your ability to log in or sync data." })] }), _jsx("div", { className: "pt-6", children: props.onConfirmAction?.(disclosure) })] }) })] }) })] }));
|
|
11
|
+
}
|
|
@@ -19,18 +19,15 @@ export function KYCVerificationStatus() {
|
|
|
19
19
|
const icons = status === 'PENDING' ? bellIcon : alertIcon;
|
|
20
20
|
return (_jsx(Dialog.Root, { open: globalStore.kycVerificationStatus.open, onOpenChange: (details) => {
|
|
21
21
|
globalStore.kycVerificationStatus.setOpen(details.open);
|
|
22
|
-
}, 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: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED'
|
|
23
|
-
(status === 'CREATED' && 'Verification Required')] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
22
|
+
}, 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: _jsx(Dialog.Content, { className: "mx-auto h-fit w-[450px] overflow-y-auto rounded-lg bg-bg-primary", children: _jsxs("div", { className: "p-3xl text-center", children: [_jsx("div", { className: "mb-3xl grid h-[200px] w-full place-items-center rounded-xl bg-radial from-40% from-button-primary-bg to-bg-brand-solid", children: _jsx(Image, { src: icons, alt: "icon", className: "w-60 object-contain", draggable: false, width: 120, height: 120 }) }), _jsxs("h1", { className: "font-semibold text-lg text-white", children: [status === 'PENDING' && 'Verification in Progress', status === 'REJECTED' && 'Verification Rejected', status === 'UNVERIFIED' && 'Verification Required'] }), _jsxs("p", { className: "mb-4xl text-[#94969C] text-base", children: [status === 'PENDING' &&
|
|
24
23
|
`Your account verification is still under review. Please wait
|
|
25
24
|
until it's approved before you can continue playing or
|
|
26
25
|
depositing.`, status === 'REJECTED' &&
|
|
27
|
-
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED'
|
|
28
|
-
(status === '
|
|
29
|
-
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.')] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
26
|
+
'Your account verification was not approved. Please resubmit your verification to regain full access.', status === 'UNVERIFIED' &&
|
|
27
|
+
'Your account is not yet verified. Please complete the verification process to continue playing or depositing.'] }), _jsxs(Button, { variant: "solid", className: twMerge('mb-2 w-full', status === 'PENDING' && 'hidden'), onClick: () => {
|
|
30
28
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
31
29
|
globalStore.kyc.setOpen(true);
|
|
32
|
-
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED'
|
|
33
|
-
(status === 'CREATED' && 'Verify Now')] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
30
|
+
}, children: [status === 'REJECTED' && 'Resubmit Verification', status === 'UNVERIFIED' && 'Verify Now'] }), _jsx(Button, { type: "button", variant: "outline", onClick: () => {
|
|
34
31
|
globalStore.kycVerificationStatus.setOpen(false);
|
|
35
32
|
}, children: "Close" })] }) }) })] }) }));
|
|
36
33
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { addHours } from 'date-fns';
|
|
3
3
|
import { clamp } from 'lodash-es';
|
|
4
|
+
import { useSearchParams } from 'next/navigation';
|
|
4
5
|
import { useLocalStorage, useTimeout } from 'usehooks-ts';
|
|
5
6
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
7
|
export function CXDTokenObserver() {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const [cxd, setCxd, removeCxd] = useLocalStorage('
|
|
8
|
+
const searchParams = useSearchParams();
|
|
9
|
+
const cxdToken = searchParams.get('cxd');
|
|
10
|
+
const accountQuery = useAccountQuery();
|
|
11
|
+
const account = accountQuery.data;
|
|
12
|
+
const [cxd, setCxd, removeCxd] = useLocalStorage('WebPortalCellxpertCxd', null);
|
|
12
13
|
const now = new Date();
|
|
14
|
+
const shouldTimeoutRun = cxdToken && account;
|
|
13
15
|
const removeCxdUntilInMs = cxd?.timestamp
|
|
14
16
|
? clamp(cxd.timestamp - now.getTime(), 0, Infinity)
|
|
15
17
|
: 0;
|
|
16
18
|
useTimeout(() => {
|
|
17
|
-
const isSame = cxd?.cxd ===
|
|
19
|
+
const isSame = cxd?.cxd === cxdToken;
|
|
18
20
|
if (!isSame) {
|
|
19
21
|
const extendedTimestamp = addHours(new Date(), 6).getTime();
|
|
20
22
|
setCxd({
|
|
21
|
-
cxd:
|
|
23
|
+
cxd: cxdToken,
|
|
22
24
|
timestamp: extendedTimestamp,
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
|
-
},
|
|
26
|
-
useTimeout(() =>
|
|
27
|
-
removeCxd();
|
|
28
|
-
}, account ? removeCxdUntilInMs : null);
|
|
27
|
+
}, shouldTimeoutRun ? 100 : null);
|
|
28
|
+
useTimeout(() => removeCxd(), shouldTimeoutRun ? removeCxdUntilInMs : null);
|
|
29
29
|
return null;
|
|
30
30
|
}
|
package/dist/handlers/index.d.ts
CHANGED
|
@@ -18,14 +18,14 @@ export declare const GET: (req: NextRequest, { params }: Context) => Promise<Nex
|
|
|
18
18
|
__error?: unknown;
|
|
19
19
|
} | {
|
|
20
20
|
ok: true;
|
|
21
|
-
data:
|
|
21
|
+
data: import("../types").Session;
|
|
22
22
|
}> | NextResponse<{
|
|
23
23
|
ok: false;
|
|
24
24
|
message: string;
|
|
25
25
|
__error?: unknown;
|
|
26
26
|
} | {
|
|
27
27
|
ok: true;
|
|
28
|
-
data:
|
|
28
|
+
data: Record<string, unknown>;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const DELETE: (req: NextRequest, { params }: Context) => Promise<NextResponse<{
|
|
31
31
|
ok: true;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function LinkBrokenIcon(props) {
|
|
3
|
+
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", ...props, children: _jsx("path", { d: "M8.5 15.5L15.5 8.49998M9 4V2M15 20V22M4 9H2M20 15H22M4.91421 4.91421L3.5 3.5M19.0858 19.0857L20.5 20.4999M12 17.6568L9.87871 19.7781C8.31662 21.3402 5.78396 21.3402 4.22186 19.7781C2.65976 18.216 2.65976 15.6833 4.22186 14.1212L6.34318 11.9999M17.6569 11.9999L19.7782 9.87859C21.3403 8.31649 21.3403 5.78383 19.7782 4.22174C18.2161 2.65964 15.6835 2.65964 14.1214 4.22174L12 6.34306", stroke: "#FEDF89", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
|
|
4
|
+
}
|
|
Binary file
|