@opexa/portal-components 0.0.654 → 0.0.655

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.
@@ -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,10 @@ 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 = featureFlag.enabled
47
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
48
+ : 0;
44
49
  const createWithdrawalMutationNext = useCreateGCashStandardCashInWithdrawalMutation({
45
50
  onMutate() {
46
51
  setStatus('processing');
@@ -149,7 +154,7 @@ export function GCashWithdrawal() {
149
154
  shouldDirty: true,
150
155
  shouldValidate: true,
151
156
  });
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) => {
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) => {
153
158
  if (!details.open) {
154
159
  setStatus('waiting');
155
160
  }
@@ -8,9 +8,11 @@ import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useAccountQuery } from '../../../../client/hooks/useAccountQuery.js';
10
10
  import { useCreateInstapayWithdrawalMutation } from '../../../../client/hooks/useCreateInstapayWithdrawalMutation.js';
11
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
11
12
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
12
13
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
13
14
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
15
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
14
16
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
15
17
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
16
18
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -51,6 +53,11 @@ export function InstapayWithdrawal() {
51
53
  });
52
54
  const instapayBankListQuery = useInstapayBankListQuery();
53
55
  const accountQuery = useAccountQuery();
56
+ const featureFlag = useFeatureFlag();
57
+ const walletQuery = useWalletQuery();
58
+ const turnoverRequirement = featureFlag.enabled
59
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
60
+ : 0;
54
61
  const instapayBankList = instapayBankListQuery.data;
55
62
  const paymentSettingsQuery = usePaymentSettingsQuery();
56
63
  const paymentSettings = paymentSettingsQuery.data;
@@ -155,7 +162,7 @@ export function InstapayWithdrawal() {
155
162
  shouldDirty: true,
156
163
  shouldValidate: true,
157
164
  });
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) => {
165
+ }, 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
166
  if (!details.open) {
160
167
  setStatus('waiting');
161
168
  }
@@ -6,8 +6,10 @@ import { Controller, useForm } from 'react-hook-form';
6
6
  import { z } from 'zod';
7
7
  import { useShallow } from 'zustand/shallow';
8
8
  import { useCreateMayaAppWithdrawalMutation } from '../../../../client/hooks/useCreateMayaAppWithdrawalMutation.js';
9
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
9
10
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
10
11
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
12
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
11
13
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
12
14
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
13
15
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
@@ -51,6 +53,11 @@ export function MayaAppWithdrawal() {
51
53
  const gatewaySettings = paymentSettings?.mayaAppWithdrawalGatewaySettings;
52
54
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
53
55
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
56
+ const featureFlag = useFeatureFlag();
57
+ const walletQuery = useWalletQuery();
58
+ const turnoverRequirement = featureFlag.enabled
59
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
60
+ : 0;
54
61
  const definition = z.object({
55
62
  amount: z.string().superRefine((val, ctx) => {
56
63
  const n = parseDecimal(val, 0);
@@ -115,7 +122,7 @@ export function MayaAppWithdrawal() {
115
122
  shouldDirty: true,
116
123
  shouldValidate: true,
117
124
  });
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) => {
125
+ }, 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
126
  if (!details.open) {
120
127
  setStatus('waiting');
121
128
  }
@@ -6,10 +6,12 @@ import { Controller, useForm } from 'react-hook-form';
6
6
  import { z } from 'zod';
7
7
  import { useShallow } from 'zustand/shallow';
8
8
  import { useCreateMayaWithdrawalMutation } from '../../../../client/hooks/useCreateMayaWithdrawalMutation.js';
9
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
9
10
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
10
11
  import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
11
12
  import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
12
13
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
14
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
13
15
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
16
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
15
17
  import { ChevronUpIcon } from '../../../../icons/ChevronUpIcon.js';
@@ -55,6 +57,11 @@ export function MayaWithdrawal() {
55
57
  const gatewaySettings = paymentSettings?.mayaWithdrawalGatewaySettings;
56
58
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
57
59
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
60
+ const featureFlag = useFeatureFlag();
61
+ const walletQuery = useWalletQuery();
62
+ const turnoverRequirement = featureFlag.enabled
63
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
64
+ : 0;
58
65
  const definition = z.object({
59
66
  amount: z.string().superRefine((val, ctx) => {
60
67
  const n = parseDecimal(val, 0);
@@ -125,7 +132,7 @@ export function MayaWithdrawal() {
125
132
  shouldDirty: true,
126
133
  shouldValidate: true,
127
134
  });
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) => {
135
+ }, 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
136
  if (!details.open) {
130
137
  setStatus('waiting');
131
138
  }
@@ -7,8 +7,10 @@ import { Controller, useForm } from 'react-hook-form';
7
7
  import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useCreatePisoPayWithdrawalMutation } from '../../../../client/hooks/useCreatePisoPayWithdrawalMutation.js';
10
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
10
11
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
13
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
12
14
  import { PISO_PAY_BANKS } from '../../../../constants/PisoPayBanks.js';
13
15
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
16
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
@@ -55,6 +57,11 @@ export function PisoPayWithdrawal() {
55
57
  const gatewaySettings = paymentSettings?.pisoPayWithdrawalGatewaySettings;
56
58
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
57
59
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
60
+ const featureFlag = useFeatureFlag();
61
+ const walletQuery = useWalletQuery();
62
+ const turnoverRequirement = featureFlag.enabled
63
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
64
+ : 0;
58
65
  const definition = z.object({
59
66
  amount: z.string().superRefine((val, ctx) => {
60
67
  const n = parseDecimal(val, 0);
@@ -149,7 +156,7 @@ export function PisoPayWithdrawal() {
149
156
  shouldDirty: true,
150
157
  shouldValidate: true,
151
158
  });
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) => {
159
+ }, 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
160
  if (!details.open) {
154
161
  setStatus('waiting');
155
162
  }
@@ -7,9 +7,11 @@ import { Controller, useForm } from 'react-hook-form';
7
7
  import { z } from 'zod';
8
8
  import { useShallow } from 'zustand/shallow';
9
9
  import { useCreateVentajaDisbursementWithdrawalMutation } from '../../../../client/hooks/useCreateVentajaWithdrawalMutation.js';
10
+ import { useFeatureFlag } from '../../../../client/hooks/useFeatureFlag.js';
10
11
  import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
11
12
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
12
13
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
14
+ import { useWalletQuery } from '../../../../client/hooks/useWalletQuery.js';
13
15
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
14
16
  import { CheckIcon } from '../../../../icons/CheckIcon.js';
15
17
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -57,6 +59,11 @@ export function VentajaWithdrawal() {
57
59
  const gatewaySettings = paymentSettings?.instapayWithdrawalGatewaySettings;
58
60
  const minimumAmount = parseDecimal(gatewaySettings?.minimumAmount, 0);
59
61
  const maximumAmount = parseDecimal(gatewaySettings?.maximumAmount, 0);
62
+ const featureFlag = useFeatureFlag();
63
+ const walletQuery = useWalletQuery();
64
+ const turnoverRequirement = featureFlag.enabled
65
+ ? parseDecimal(walletQuery.data?.turnoverRequirement, 0)
66
+ : 0;
60
67
  const definition = z.object({
61
68
  amount: z.string().superRefine((val, ctx) => {
62
69
  const n = parseDecimal(val, 0);
@@ -151,7 +158,7 @@ export function VentajaWithdrawal() {
151
158
  shouldDirty: true,
152
159
  shouldValidate: true,
153
160
  });
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) => {
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) => {
155
162
  if (!details.open) {
156
163
  setStatus('waiting');
157
164
  }
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.655",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",