@opexa/portal-components 0.0.1131 → 0.0.1134
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.
|
@@ -113,7 +113,7 @@ function Profile() {
|
|
|
113
113
|
return 'Unverified';
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
-
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?.verification?.status), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: getVerificationStatusLabel(account?.verification?.status) })] }))] })] })] }));
|
|
116
|
+
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?.verification?.status ?? account?.verificationStatus), className: "self-start", children: [_jsx(Badge.Indicator, {}), _jsx(Badge.Label, { children: getVerificationStatusLabel(account?.verification?.status ?? account?.verificationStatus) })] }))] })] })] }));
|
|
117
117
|
}
|
|
118
118
|
function Links({ router, classNames, }) {
|
|
119
119
|
const accountProps = useAccountPropsContext();
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { ark } from '@ark-ui/react/factory';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { useShallow } from 'zustand/shallow';
|
|
6
|
+
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
6
7
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
7
8
|
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
8
9
|
import { useProfileCompletionQuery } from '../../client/hooks/useProfileCompletionQuery.js';
|
|
@@ -19,10 +20,14 @@ export function AccountVerification(props) {
|
|
|
19
20
|
kyc: ctx.kyc,
|
|
20
21
|
})));
|
|
21
22
|
const memberVerificationQuery = useMemberVerificationQuery();
|
|
23
|
+
const accountQuery = useAccountQuery();
|
|
22
24
|
const completed = memberVerificationQuery.data?.status === 'VERIFIED' ||
|
|
23
25
|
memberVerificationQuery.data?.status === 'PENDING' ||
|
|
24
|
-
memberVerificationQuery.data?.status === 'APPROVED'
|
|
25
|
-
|
|
26
|
+
memberVerificationQuery.data?.status === 'APPROVED' ||
|
|
27
|
+
accountQuery.data?.verificationStatus === 'VERIFIED';
|
|
28
|
+
return (_jsxs("div", { className: props.className, children: [_jsx(Header, {}), _jsxs("div", { className: "mt-5 rounded-xl border border-border-secondary bg-bg-primary-alt shadow-xs", children: [_jsx(Requirements, {}), !memberVerificationQuery.isLoading &&
|
|
29
|
+
!accountQuery.isLoading &&
|
|
30
|
+
!completed && (_jsx("div", { className: "flex justify-end border-border-secondary border-t px-4 py-3 lg:py-xl", children: _jsx(Button, { size: "sm", className: "w-full lg:w-fit", onClick: () => globalStore.kyc.setOpen(true), children: "Verify Now" }) }))] }), _jsx(Status, {})] }));
|
|
26
31
|
}
|
|
27
32
|
function Header() {
|
|
28
33
|
const query = useProfileCompletionQuery();
|
|
@@ -35,9 +40,10 @@ function Requirements() {
|
|
|
35
40
|
}
|
|
36
41
|
function Status() {
|
|
37
42
|
const query = useMemberVerificationQuery();
|
|
38
|
-
|
|
43
|
+
const accountQuery = useAccountQuery();
|
|
44
|
+
if (query.isLoading || accountQuery.isLoading)
|
|
39
45
|
return null;
|
|
40
|
-
switch (query.data?.status) {
|
|
46
|
+
switch (query.data?.status ?? accountQuery.data?.verificationStatus) {
|
|
41
47
|
case 'PENDING':
|
|
42
48
|
return _jsx(Status__Pending, {});
|
|
43
49
|
case 'REJECTED':
|
|
@@ -14,14 +14,12 @@ export function KycOpenOnHomeMount(props) {
|
|
|
14
14
|
const isRejected = account?.verification?.status === 'REJECTED';
|
|
15
15
|
const isUnverified = account?.verification === null ||
|
|
16
16
|
account?.verification?.status === 'UNVERIFIED' ||
|
|
17
|
-
account?.verification?.status === 'CREATED'
|
|
18
|
-
|
|
19
|
-
account?.verificationStatus === 'UNVERIFIED';
|
|
17
|
+
account?.verification?.status === 'CREATED' ||
|
|
18
|
+
account?.verificationStatus === 'UNVERIFIED';
|
|
20
19
|
const isKycCompleted = account?.verified ||
|
|
21
20
|
verification?.sumsubVerified ||
|
|
22
21
|
account?.verification?.status === 'APPROVED' ||
|
|
23
22
|
account?.verification?.status === 'VERIFIED' ||
|
|
24
|
-
//fallback values when verification object is not present
|
|
25
23
|
account?.verificationStatus === 'VERIFIED';
|
|
26
24
|
useEffect(() => {
|
|
27
25
|
// If bypass is enabled, do nothing.
|