@opexa/portal-components 0.0.365 → 0.0.369

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.
@@ -1,5 +1,6 @@
1
1
  import type { ComponentPropsWithRef } from 'react';
2
2
  export interface DepositWithdrawalTriggerProps extends ComponentPropsWithRef<'button'> {
3
3
  asChild?: boolean;
4
+ colorScheme?: 'primary' | 'dark';
4
5
  }
5
- export declare function DepositWithdrawalTrigger({ asChild, children, ...props }: DepositWithdrawalTriggerProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DepositWithdrawalTrigger({ asChild, children, colorScheme, ...props }: DepositWithdrawalTriggerProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ark } from '@ark-ui/react/factory';
4
+ import { twMerge } from 'tailwind-merge';
4
5
  import { useShallow } from 'zustand/shallow';
5
6
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
6
7
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
@@ -8,7 +9,7 @@ import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
8
9
  import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
9
10
  import { formatNumber } from '../../utils/formatNumber.js';
10
11
  import { parseDecimal } from '../../utils/parseDecimal.js';
11
- export function DepositWithdrawalTrigger({ asChild, children, ...props }) {
12
+ export function DepositWithdrawalTrigger({ asChild, children, colorScheme = 'primary', ...props }) {
12
13
  const sessionQuery = useSessionQuery();
13
14
  const globalStore = useGlobalStore(useShallow((ctx) => ({
14
15
  depositWithdrawal: ctx.depositWithdrawal,
@@ -29,7 +30,9 @@ export function DepositWithdrawalTrigger({ asChild, children, ...props }) {
29
30
  props.onClick?.(e);
30
31
  globalStore.depositWithdrawal.setTab('DEPOSIT');
31
32
  globalStore.depositWithdrawal.setOpen(true);
32
- }, asChild: !children ? true : asChild, children: children ?? (_jsxs("button", { type: "button", ...props, className: "flex", children: [_jsx("div", { className: "flex h-10 items-center rounded-l-md border border-border-primary border-r-0 px-3.5", children: formatNumber(totalBalance, {
33
+ }, asChild: !children ? true : asChild, children: children ?? (_jsxs("button", { type: "button", ...props, className: "flex", children: [_jsx("div", { className: twMerge('flex h-10 items-center rounded-l-md border border-border-primary border-r-0 px-3.5', colorScheme === 'primary'
34
+ ? 'border-border-primary'
35
+ : 'border-border-dark bg-bg-dark text-dark-text'), children: formatNumber(totalBalance, {
33
36
  currency: localeInfo.currency.code,
34
37
  minDecimalPlaces: 2,
35
38
  }) }), _jsx("div", { className: "flex h-10 items-center gap-1.5 rounded-r-md bg-button-primary-bg px-3.5 font-semibold text-button-primary-fg text-sm", children: "Deposit" })] })) }));
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { isEmpty, isNil } from 'lodash-es';
2
3
  import { useShallow } from 'zustand/shallow';
3
4
  import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
4
5
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
@@ -17,18 +18,20 @@ export function KYCReminder(props) {
17
18
  const { data: session, isLoading: sessionLoading } = useSessionQuery();
18
19
  const { data: account, isLoading: accountLoading } = useAccountQuery();
19
20
  const { data: verification, isLoading: verificationLoading } = useMemberVerificationQuery();
20
- const isBasicInfoCompleted = account?.realName !== null && account?.birthDay !== null;
21
- const isUploadCompleted = verification &&
22
- verification.idFrontImage !== null &&
23
- verification.selfieImage !== null;
24
- const isVerified = verification?.status === 'VERIFIED' ||
25
- verification?.status === 'PENDING' ||
26
- verification?.status === 'APPROVED';
27
- const hasMissingData = !isBasicInfoCompleted || !isUploadCompleted || !isVerified;
28
- return (_jsx(Dialog.Root, { open: globalStore.kycReminder.open &&
29
- !sessionLoading &&
21
+ const hasMissingData = account?.verified
22
+ ? false
23
+ : isNil(account?.realName) ||
24
+ isEmpty(account?.realName) ||
25
+ isNil(account?.birthDay) ||
26
+ isEmpty(account?.birthDay) ||
27
+ isNil(verification?.selfieImage) ||
28
+ isEmpty(verification?.selfieImage) ||
29
+ isNil(verification?.idFrontImage) ||
30
+ isEmpty(verification?.idFrontImage);
31
+ return (_jsx(Dialog.Root, { open: !sessionLoading &&
30
32
  !accountLoading &&
31
33
  !verificationLoading &&
34
+ globalStore.kycReminder.open &&
32
35
  session?.status === 'authenticated' &&
33
36
  hasMissingData, onOpenChange: (details) => {
34
37
  globalStore.kycReminder.setOpen(details.open);
@@ -40,6 +40,7 @@ export function NameAndPasswordSignIn() {
40
40
  context.setStep(2);
41
41
  }
42
42
  else {
43
+ globalStore.kycReminder.setOpen(true);
43
44
  globalStore.signIn.setOpen(false);
44
45
  authenticateMutation.reset();
45
46
  signInMutation.reset();
@@ -224,6 +224,7 @@
224
224
  --color-bg-overlay: #22262f;
225
225
  --color-bg-error-secondary: #d92d20;
226
226
  --color-bg-warning-secondary: #dc6803;
227
+ --color-bg-dark: #202020;
227
228
 
228
229
  --color-text-brand: #feee95;
229
230
  --color-text-brand-700: #a15c07;
@@ -252,6 +253,7 @@
252
253
  --color-text-featured-icon-light-success: #abefc6;
253
254
  --color-text-featured-icon-light-error: #fecdca;
254
255
  --color-text-featured-icon-light-warning: #fedf89;
256
+ --color-dark-text: #cccccc;
255
257
 
256
258
  --color-border-primary: #373a41;
257
259
  --color-border-secondary: #22262f;
@@ -260,6 +262,7 @@
260
262
  --color-border-brand: #fac515;
261
263
  --color-border-brand-dark: #6b4328;
262
264
  --color-border-brand-solid: #ca8504;
265
+ --color-border-dark: #373A41;
263
266
 
264
267
  --color-border-checkbox-primary: #373a41;
265
268
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.365",
3
+ "version": "0.0.369",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",