@opexa/portal-components 0.0.654 → 0.0.656

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.
@@ -3,7 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  import { isNil } from 'lodash-es';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import { useShallow } from 'zustand/shallow';
6
- import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
7
6
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
8
7
  import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
9
8
  import { useWalletQuery } from '../../client/hooks/useWalletQuery.js';
@@ -11,7 +10,6 @@ import { Button } from '../../ui/Button/index.js';
11
10
  import { formatNumber } from '../../utils/formatNumber.js';
12
11
  import { parseDecimal } from '../../utils/parseDecimal.js';
13
12
  export function Wallet({ classNames = {} }) {
14
- const featureFlag = useFeatureFlag();
15
13
  const localeInfo = useLocaleInfo();
16
14
  const walletQuery = useWalletQuery({
17
15
  refetchInterval: 1000,
@@ -34,9 +32,7 @@ export function Wallet({ classNames = {} }) {
34
32
  }) })] }), _jsxs("div", { children: [_jsx("p", { className: twMerge('text-2xs text-text-secondary-700', classNames.bonusBalanceLabel), children: "Bonus Balance" }), _jsx("p", { className: twMerge('text-medium text-text-primary-brand', classNames.bonusBalanceAmount), children: formatNumber(bonusBalance, {
35
33
  currency: localeInfo?.currency.code,
36
34
  minDecimalPlaces: 2,
37
- }) })] })] })] }), featureFlag.enabled &&
38
- !isNil(turnoverRequirement) &&
39
- turnoverRequirement > 0 && (_jsxs("div", { className: "border-border-primary border-t bg-bg-quaternary px-xl py-2", children: [_jsx("p", { className: "text-2xs leading-tight", children: "Deposit Turnover Requirement" }), _jsx("p", { className: "mt-1 font-medium text-xs leading-tight", children: formatNumber(turnoverRequirement, {
35
+ }) })] })] })] }), !isNil(turnoverRequirement) && turnoverRequirement > 0 && (_jsxs("div", { className: "border-border-primary border-t bg-bg-quaternary px-xl py-2", children: [_jsx("p", { className: "text-2xs leading-tight", children: "Deposit Turnover Requirement" }), _jsx("p", { className: "mt-1 font-medium text-xs leading-tight", children: formatNumber(turnoverRequirement, {
40
36
  currency: localeInfo?.currency.code,
41
37
  minDecimalPlaces: 1,
42
38
  maxDecimalPlaces: 2,
@@ -1,19 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isNil } from 'lodash-es';
3
- import { useFeatureFlag } from '../../../client/hooks/useFeatureFlag.js';
4
2
  import { useLocaleInfo } from '../../../client/hooks/useLocaleInfo.js';
5
3
  import { useWalletQuery } from '../../../client/hooks/useWalletQuery.js';
6
4
  import { BankNote01Icon } from '../../../icons/BankNote01Icon.js';
7
5
  import { formatNumber } from '../../../utils/formatNumber.js';
8
6
  import { parseDecimal } from '../../../utils/parseDecimal.js';
9
7
  export function ActiveTurnoverRequirement() {
10
- const featureFlag = useFeatureFlag();
11
8
  const walletQuery = useWalletQuery();
12
9
  const localeInfo = useLocaleInfo();
13
- const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement);
14
- if (!featureFlag.enabled ||
15
- isNil(turnoverRequirement) ||
16
- turnoverRequirement <= 0)
10
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
11
+ if (turnoverRequirement <= 0)
17
12
  return null;
18
13
  return (_jsxs("div", { className: "mt-lg overflow-hidden rounded-xl border border-border-primary", children: [_jsxs("div", { className: "bg-bg-primary-alt p-xl", children: [_jsx("div", { className: "flex size-8.5 items-center justify-center rounded-full border-[1.667px] border-text-warning-primary/10", children: _jsx("div", { className: "flex size-6.5 items-center justify-center rounded-full border-[1.667px] border-text-warning-primary/30", children: _jsx(BankNote01Icon, { className: "size-5 text-text-warning-primary" }) }) }), _jsx("p", { className: "mt-lg text-sm text-text-tertiary-600", children: "It looks like you still need to complete your turnover requirement before you can withdraw funds." })] }), _jsxs("div", { className: "border-border-primary border-t bg-bg-quaternary px-xl py-2", children: [_jsx("p", { className: "text-2xs leading-tight", children: "Deposit Turnover Requirement" }), _jsx("p", { className: "mt-1 font-medium text-xs leading-tight", children: formatNumber(turnoverRequirement, {
19
14
  currency: localeInfo?.currency.code,
@@ -12,6 +12,7 @@ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
12
12
  import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
13
13
  import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
14
14
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
15
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
15
16
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
16
17
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
17
18
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
@@ -41,6 +42,8 @@ export function GCashWithdrawal() {
41
42
  const [status, setStatus] = useState('waiting');
42
43
  const localeInfo = useLocaleInfo();
43
44
  const mobileNumberParser = useMobileNumberParser();
45
+ const walletQuery = useWalletQuery();
46
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
44
47
  const createWithdrawalMutationNext = useCreateGCashStandardCashInWithdrawalMutation({
45
48
  onMutate() {
46
49
  setStatus('processing');
@@ -149,7 +152,7 @@ export function GCashWithdrawal() {
149
152
  shouldDirty: true,
150
153
  shouldValidate: true,
151
154
  });
152
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
155
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
153
156
  if (!details.open) {
154
157
  setStatus('waiting');
155
158
  }
@@ -11,6 +11,7 @@ import { useCreateInstapayWithdrawalMutation } from '../../../../client/hooks/us
11
11
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
12
12
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
13
13
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
14
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
14
15
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
15
16
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
16
17
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -51,6 +52,8 @@ export function InstapayWithdrawal() {
51
52
  });
52
53
  const instapayBankListQuery = useInstapayBankListQuery();
53
54
  const accountQuery = useAccountQuery();
55
+ const walletQuery = useWalletQuery();
56
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
54
57
  const instapayBankList = instapayBankListQuery.data;
55
58
  const paymentSettingsQuery = usePaymentSettingsQuery();
56
59
  const paymentSettings = paymentSettingsQuery.data;
@@ -155,7 +158,7 @@ export function InstapayWithdrawal() {
155
158
  shouldDirty: true,
156
159
  shouldValidate: true,
157
160
  });
158
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
161
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
159
162
  if (!details.open) {
160
163
  setStatus('waiting');
161
164
  }
@@ -8,6 +8,7 @@ import { useShallow } from 'zustand/shallow';
8
8
  import { useCreateMayaAppWithdrawalMutation } from '../../../../client/hooks/useCreateMayaAppWithdrawalMutation.js';
9
9
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
10
10
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
11
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
11
12
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
12
13
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
13
14
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
@@ -51,6 +52,8 @@ export function MayaAppWithdrawal() {
51
52
  const gatewaySettings = paymentSettings?.mayaAppWithdrawalGatewaySettings;
52
53
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
53
54
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
55
+ const walletQuery = useWalletQuery();
56
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
54
57
  const definition = z.object({
55
58
  amount: z.string().superRefine((val, ctx) => {
56
59
  const n = parseDecimal(val, 0);
@@ -115,7 +118,7 @@ export function MayaAppWithdrawal() {
115
118
  shouldDirty: true,
116
119
  shouldValidate: true,
117
120
  });
118
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
121
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
119
122
  if (!details.open) {
120
123
  setStatus('waiting');
121
124
  }
@@ -10,6 +10,7 @@ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
10
10
  import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
11
11
  import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
12
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
13
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
13
14
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
15
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
15
16
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
@@ -55,6 +56,8 @@ export function MayaWithdrawal() {
55
56
  const gatewaySettings = paymentSettings?.mayaWithdrawalGatewaySettings;
56
57
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
57
58
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
59
+ const walletQuery = useWalletQuery();
60
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
58
61
  const definition = z.object({
59
62
  amount: z.string().superRefine((val, ctx) => {
60
63
  const n = parseDecimal(val, 0);
@@ -125,7 +128,7 @@ export function MayaWithdrawal() {
125
128
  shouldDirty: true,
126
129
  shouldValidate: true,
127
130
  });
128
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
131
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
129
132
  if (!details.open) {
130
133
  setStatus('waiting');
131
134
  }
@@ -9,6 +9,7 @@ import { useShallow } from 'zustand/shallow';
9
9
  import { useCreatePisoPayWithdrawalMutation } from '../../../../client/hooks/useCreatePisoPayWithdrawalMutation.js';
10
10
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
11
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
12
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
12
13
  import { PISO_PAY_BANKS } from '../../../../constants/PisoPayBanks.js';
13
14
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
15
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
@@ -55,6 +56,8 @@ export function PisoPayWithdrawal() {
55
56
  const gatewaySettings = paymentSettings?.pisoPayWithdrawalGatewaySettings;
56
57
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
57
58
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
59
+ const walletQuery = useWalletQuery();
60
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
58
61
  const definition = z.object({
59
62
  amount: z.string().superRefine((val, ctx) => {
60
63
  const n = parseDecimal(val, 0);
@@ -149,7 +152,7 @@ export function PisoPayWithdrawal() {
149
152
  shouldDirty: true,
150
153
  shouldValidate: true,
151
154
  });
152
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
155
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
153
156
  if (!details.open) {
154
157
  setStatus('waiting');
155
158
  }
@@ -10,6 +10,7 @@ import { useCreateVentajaDisbursementWithdrawalMutation } from '../../../../clie
10
10
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
11
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
12
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
13
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
13
14
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
15
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
15
16
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -57,6 +58,8 @@ export function VentajaWithdrawal() {
57
58
  const gatewaySettings = paymentSettings?.instapayWithdrawalGatewaySettings;
58
59
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
59
60
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
61
+ const walletQuery = useWalletQuery();
62
+ const turnoverRequirement = parseDecimal(walletQuery.data?.turnoverRequirement, 0);
60
63
  const definition = z.object({
61
64
  amount: z.string().superRefine((val, ctx) => {
62
65
  const n = parseDecimal(val, 0);
@@ -151,7 +154,7 @@ export function VentajaWithdrawal() {
151
154
  shouldDirty: true,
152
155
  shouldValidate: true,
153
156
  });
154
- }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
157
+ }, min: minimumAmount, max: maximumAmount, className: "mt-xl" }), _jsxs(Field.Root, { className: "mt-3xl", invalid: !!form.formState.errors.password, children: [_jsxs(PasswordInput.Root, { children: [_jsx(PasswordInput.Label, { children: "Transaction Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { placeholder: "Enter password", ...form.register('password') }), _jsx(PasswordInput.VisibilityTrigger, { children: _jsx(PasswordInput.Indicator, { fallback: _jsx(EyeOffIcon, {}), asChild: true, children: _jsx(EyeIcon, {}) }) })] })] }), _jsx(Field.ErrorText, { children: form.formState.errors.password?.message })] }), _jsx(TransactionPasswordNotSet, {}), _jsx(ActiveTurnoverRequirement, {}), _jsx(Button, { type: "submit", className: "mt-6", disabled: createWithdrawalMutation.isPending || turnoverRequirement > 0, children: "Withdraw" }), _jsxs("p", { className: "mt-lg text-text-tertiary-600 text-xs", children: ["Upon withdrawing, you agree to our", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.privacyPolicyUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "text-text-warning-primary-600 underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
155
158
  if (!details.open) {
156
159
  setStatus('waiting');
157
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.654",
3
+ "version": "0.0.656",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",