@opexa/portal-components 0.0.128 → 0.0.129

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.
Files changed (41) hide show
  1. package/dist/client/utils/createContext.d.ts +12 -1
  2. package/dist/client/utils/createContext.js +5 -1
  3. package/dist/components/Account/AccountContext.d.ts +5 -1
  4. package/dist/components/DepositWithdrawal/Deposit/GCashDeposit/GCashDeposit.js +4 -1
  5. package/dist/components/DepositWithdrawal/Deposit/MayaAppDeposit/MayaAppDeposit.js +4 -1
  6. package/dist/components/DepositWithdrawal/Deposit/MayaDeposit/MayaDeposit.js +4 -1
  7. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +16 -12
  8. package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositForm.js +4 -1
  9. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +16 -12
  10. package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositForm.js +4 -1
  11. package/dist/components/DepositWithdrawal/DepositWithdrawal.d.ts +3 -1
  12. package/dist/components/DepositWithdrawal/DepositWithdrawal.js +2 -2
  13. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.d.ts +7 -1
  14. package/dist/components/DepositWithdrawal/DepositWithdrawal.lazy.js +13 -12
  15. package/dist/components/DepositWithdrawal/DepositWithdrawalContext.d.ts +6 -0
  16. package/dist/components/DepositWithdrawal/DepositWithdrawalContext.js +2 -0
  17. package/dist/components/DepositWithdrawal/Withdrawal/GCashWithdrawal/GCashWithdrawal.js +9 -1
  18. package/dist/components/DepositWithdrawal/Withdrawal/InstapayWithdrawal/InstapayWithdrawal.js +9 -1
  19. package/dist/components/DepositWithdrawal/Withdrawal/MayaAppWithdrawal/MayaAppWithdrawal.js +9 -1
  20. package/dist/components/DepositWithdrawal/Withdrawal/MayaWithdrawal/MayaWithdrawal.js +9 -1
  21. package/dist/components/Games/GamesContext.d.ts +10 -2
  22. package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselContext.d.ts +5 -1
  23. package/dist/components/Jackpots/JackpotsList/JackpotsListContext.d.ts +10 -2
  24. package/dist/components/KYC/KYCContext.d.ts +5 -1
  25. package/dist/components/KYC/backup/KYCContext.d.ts +5 -1
  26. package/dist/components/Messages/MessageContext.d.ts +5 -1
  27. package/dist/components/Quests/QuestsContext.d.ts +5 -1
  28. package/dist/components/SignIn/MobileNumberSignIn.js +7 -2
  29. package/dist/components/SignIn/NameAndPasswordSignIn.js +7 -2
  30. package/dist/components/SignIn/SignIn.lazy.d.ts +2 -0
  31. package/dist/components/SignIn/SignIn.lazy.js +4 -4
  32. package/dist/components/SignIn/SignInContext.d.ts +11 -1
  33. package/dist/components/SignIn/SignInContext.js +2 -1
  34. package/dist/components/SignUp/SignUp.lazy.d.ts +2 -0
  35. package/dist/components/SignUp/SignUp.lazy.js +4 -3
  36. package/dist/components/SignUp/SignUpContext.d.ts +6 -0
  37. package/dist/components/SignUp/SignUpContext.js +2 -0
  38. package/dist/components/SignUp/SignUpForm.js +7 -1
  39. package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselContext.d.ts +5 -1
  40. package/dist/components/Tournaments/TournamentsList/TournamentsListContext.d.ts +10 -2
  41. package/package.json +1 -1
@@ -3,7 +3,18 @@ interface CreateContextOptions<T, S extends boolean> {
3
3
  strict?: S;
4
4
  defaultValue?: T;
5
5
  }
6
- type CreateContextReturn<T, S extends boolean> = [S] extends [true] ? [React.Context<T>, () => T] : [React.Context<T>, () => T | null];
6
+ type ProviderProps<T> = React.PropsWithChildren<{
7
+ value: T;
8
+ }>;
9
+ type CreateContextReturn<T, S extends boolean> = [S] extends [true] ? [
10
+ provider: (props: ProviderProps<T>) => React.ReactNode,
11
+ hook: () => T,
12
+ context: React.Context<T>
13
+ ] : [
14
+ provider: (props: ProviderProps<T>) => React.ReactNode,
15
+ hook: () => T | null,
16
+ context: React.Context<T>
17
+ ];
7
18
  export declare function createContext<T>(options?: CreateContextOptions<T, true>): CreateContextReturn<T, true>;
8
19
  export declare function createContext<T>(options?: CreateContextOptions<T, false>): CreateContextReturn<T, false>;
9
20
  export {};
@@ -1,14 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  import invariant from 'tiny-invariant';
3
4
  export function createContext(options) {
4
5
  const strict = options?.strict ?? true;
5
6
  const defaultValue = options?.defaultValue ?? null;
6
7
  const Context = React.createContext(defaultValue ?? null);
8
+ const Provider = (props) => {
9
+ return (_jsx(Context.Provider, { value: props.value, children: props.children }));
10
+ };
7
11
  function useContext() {
8
12
  const context = React.use(Context);
9
13
  if (!context && strict)
10
14
  invariant(context);
11
15
  return context;
12
16
  }
13
- return [Context, useContext];
17
+ return [Provider, useContext, Context];
14
18
  }
@@ -1,2 +1,6 @@
1
1
  import type { AccountProps } from './Account.lazy';
2
- export declare const AccountPropsContext: import("react").Context<import("type-fest/source/required-deep").RequiredObjectDeep<AccountProps>>, useAccountPropsContext: () => import("type-fest/source/required-deep").RequiredObjectDeep<AccountProps>;
2
+ export declare const AccountPropsContext: (props: {
3
+ value: import("type-fest/source/required-deep").RequiredObjectDeep<AccountProps>;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useAccountPropsContext: () => import("type-fest/source/required-deep").RequiredObjectDeep<AccountProps>;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import invariant from 'tiny-invariant';
@@ -22,8 +23,10 @@ import { NumberInput } from '../../../../ui/NumberInput/index.js';
22
23
  import { Portal } from '../../../../ui/Portal/index.js';
23
24
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
24
25
  import { AmountChoices } from '../../AmountChoices.js';
26
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
25
27
  import { AvailablePromos } from '../AvailablePromos.js';
26
28
  export function GCashDeposit() {
29
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
27
30
  const globalStore = useGlobalStore(useShallow((ctx) => ({
28
31
  depositWithdrawal: ctx.depositWithdrawal,
29
32
  })));
@@ -134,7 +137,7 @@ export function GCashDeposit() {
134
137
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
135
138
  o.field.onChange(value);
136
139
  globalStore.depositWithdrawal.setPromo(null);
137
- }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
140
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, 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) => {
138
141
  if (!details.open) {
139
142
  setStatus('waiting');
140
143
  }
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
@@ -21,8 +22,10 @@ import { NumberInput } from '../../../../ui/NumberInput/index.js';
21
22
  import { Portal } from '../../../../ui/Portal/index.js';
22
23
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
23
24
  import { AmountChoices } from '../../AmountChoices.js';
25
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
24
26
  import { AvailablePromos } from '../AvailablePromos.js';
25
27
  export function MayaAppDeposit() {
28
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
26
29
  const globalStore = useGlobalStore(useShallow((ctx) => ({
27
30
  depositWithdrawal: ctx.depositWithdrawal,
28
31
  })));
@@ -131,7 +134,7 @@ export function MayaAppDeposit() {
131
134
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
132
135
  o.field.onChange(value);
133
136
  globalStore.depositWithdrawal.setPromo(null);
134
- }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
137
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, 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
138
  if (!details.open) {
136
139
  setStatus('waiting');
137
140
  }
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import invariant from 'tiny-invariant';
@@ -22,8 +23,10 @@ import { NumberInput } from '../../../../ui/NumberInput/index.js';
22
23
  import { Portal } from '../../../../ui/Portal/index.js';
23
24
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
24
25
  import { AmountChoices } from '../../AmountChoices.js';
26
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
25
27
  import { AvailablePromos } from '../AvailablePromos.js';
26
28
  export function MayaDeposit() {
29
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
27
30
  const globalStore = useGlobalStore(useShallow((ctx) => ({
28
31
  depositWithdrawal: ctx.depositWithdrawal,
29
32
  })));
@@ -134,7 +137,7 @@ export function MayaDeposit() {
134
137
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
135
138
  o.field.onChange(value);
136
139
  globalStore.depositWithdrawal.setPromo(null);
137
- }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
140
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: createDepositMutation.isPending, children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, 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) => {
138
141
  if (!details.open) {
139
142
  setStatus('waiting');
140
143
  }
@@ -1,15 +1,19 @@
1
- export declare const OnlineBankDepositContext: import("react").Context<{
2
- view: "vca" | "form";
3
- status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
- verify: () => void;
5
- reset: () => void;
6
- deposit: import("../../../../types").Deposit | null;
7
- generateVCA: (input: {
8
- amount: string;
9
- promo?: string | null;
10
- }) => void;
11
- }>, useOnlineBankDepositContext: () => {
12
- view: "vca" | "form";
1
+ export declare const OnlineBankDepositContext: (props: {
2
+ value: {
3
+ view: "form" | "vca";
4
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
+ verify: () => void;
6
+ reset: () => void;
7
+ deposit: import("../../../../types").Deposit | null;
8
+ generateVCA: (input: {
9
+ amount: string;
10
+ promo?: string | null;
11
+ }) => void;
12
+ };
13
+ } & {
14
+ children?: import("react").ReactNode | undefined;
15
+ }) => React.ReactNode, useOnlineBankDepositContext: () => {
16
+ view: "form" | "vca";
13
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
18
  verify: () => void;
15
19
  reset: () => void;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
3
  import { noop } from 'lodash-es';
4
+ import Link from 'next/link';
4
5
  import { useEffect } from 'react';
5
6
  import { Controller, useForm } from 'react-hook-form';
6
7
  import { z } from 'zod';
@@ -16,9 +17,11 @@ import { Field } from '../../../../ui/Field/index.js';
16
17
  import { NumberInput } from '../../../../ui/NumberInput/index.js';
17
18
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
18
19
  import { AmountChoices } from '../../AmountChoices.js';
20
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
19
21
  import { AvailablePromos } from '../AvailablePromos.js';
20
22
  import { useOnlineBankDepositContext } from './OnlineBankDepositContext.js';
21
23
  export function OnlineBankDepositForm() {
24
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
22
25
  const globalStore = useGlobalStore(useShallow((ctx) => ({
23
26
  depositWithdrawal: ctx.depositWithdrawal,
24
27
  })));
@@ -111,5 +114,5 @@ export function OnlineBankDepositForm() {
111
114
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { className: "mt-3xl", value: o.field.value, onChange: (value) => {
112
115
  o.field.onChange(value);
113
116
  globalStore.depositWithdrawal.setPromo(null);
114
- } })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] })] }));
117
+ } })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, 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" }), "."] })] }));
115
118
  }
@@ -1,15 +1,19 @@
1
- export declare const QRPHDepositContext: import("react").Context<{
2
- view: "qrCode" | "form";
3
- status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
4
- verify: () => void;
5
- reset: () => void;
6
- deposit: import("../../../../types").Deposit | null;
7
- generateQRCode: (input: {
8
- amount: string;
9
- promo?: string | null;
10
- }) => void;
11
- }>, useQRPHDepositContext: () => {
12
- view: "qrCode" | "form";
1
+ export declare const QRPHDepositContext: (props: {
2
+ value: {
3
+ view: "form" | "qrCode";
4
+ status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
+ verify: () => void;
6
+ reset: () => void;
7
+ deposit: import("../../../../types").Deposit | null;
8
+ generateQRCode: (input: {
9
+ amount: string;
10
+ promo?: string | null;
11
+ }) => void;
12
+ };
13
+ } & {
14
+ children?: import("react").ReactNode | undefined;
15
+ }) => React.ReactNode, useQRPHDepositContext: () => {
16
+ view: "form" | "qrCode";
13
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
14
18
  verify: () => void;
15
19
  reset: () => void;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
@@ -15,9 +16,11 @@ import { Field } from '../../../../ui/Field/index.js';
15
16
  import { NumberInput } from '../../../../ui/NumberInput/index.js';
16
17
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
17
18
  import { AmountChoices } from '../../AmountChoices.js';
19
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
18
20
  import { AvailablePromos } from '../AvailablePromos.js';
19
21
  import { useQRPHDepositContext } from './QRPHDepositContext.js';
20
22
  export function QRPHDepositForm() {
23
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
21
24
  const globalStore = useGlobalStore(useShallow((ctx) => ({
22
25
  depositWithdrawal: ctx.depositWithdrawal,
23
26
  })));
@@ -110,5 +113,5 @@ export function QRPHDepositForm() {
110
113
  }, min: minimumAmount, max: maximumAmount, className: "mt-lg" }), _jsx(Controller, { control: form.control, name: "promo", render: (o) => (_jsx(AvailablePromos, { value: o.field.value, onChange: (value) => {
111
114
  o.field.onChange(value);
112
115
  globalStore.depositWithdrawal.setPromo(null);
113
- }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, you agree to our", ' ', _jsx("button", { type: "button", className: "text-text-warning-primary-600 underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] })] }));
116
+ }, className: "mt-3xl" })) }), _jsx(Button, { type: "submit", className: "mt-3xl", children: "Deposit" }), _jsxs("p", { className: "text-text-tertiary-600 mt-lg text-xs", children: ["By depositing, 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" }), "."] })] }));
114
117
  }
@@ -1 +1,3 @@
1
- export declare function DepositWithdrawal(): import("react/jsx-runtime").JSX.Element | undefined;
1
+ import type { DepositWithdrawalProps } from './DepositWithdrawal.lazy';
2
+ export declare function DepositWithdrawal(props: DepositWithdrawalProps): import("react/jsx-runtime").JSX.Element | undefined;
3
+ export type { DepositWithdrawalProps };
@@ -7,8 +7,8 @@ const Component = dynamic(() => import('./DepositWithdrawal.lazy.js').then((m) =
7
7
  ssr: false,
8
8
  loading: () => null,
9
9
  });
10
- export function DepositWithdrawal() {
10
+ export function DepositWithdrawal(props) {
11
11
  const touched = useGlobalStore(useShallow((ctx) => ctx.depositWithdrawal['~touched']));
12
12
  if (touched)
13
- return _jsx(Component, {});
13
+ return _jsx(Component, { ...props });
14
14
  }
@@ -1 +1,7 @@
1
- export declare function DepositWithdrawal(): import("react/jsx-runtime").JSX.Element;
1
+ export interface DepositWithdrawalProps {
2
+ /** @default "/terms-of-use" */
3
+ termsOfUseUrl?: string;
4
+ /** @default "/privacy-policy" */
5
+ privacyPolicyUrl?: string;
6
+ }
7
+ export declare function DepositWithdrawal(props: DepositWithdrawalProps): import("react/jsx-runtime").JSX.Element;
@@ -13,8 +13,9 @@ import { Portal } from '../../ui/Portal/index.js';
13
13
  import { Tabs } from '../../ui/Tabs/index.js';
14
14
  import { formatNumber } from '../../utils/formatNumber.js';
15
15
  import { Deposit } from './Deposit/Deposit.js';
16
+ import { DepositWithdrawalPropsProvider } from './DepositWithdrawalContext.js';
16
17
  import { Withdrawal } from './Withdrawal/Withdrawal.js';
17
- export function DepositWithdrawal() {
18
+ export function DepositWithdrawal(props) {
18
19
  const globalStore = useGlobalStore(useShallow((ctx) => ({
19
20
  depositWithdrawal: ctx.depositWithdrawal,
20
21
  })));
@@ -22,15 +23,15 @@ export function DepositWithdrawal() {
22
23
  const walletQuery = useWalletQuery({
23
24
  refetchInterval: 5000,
24
25
  });
25
- return (_jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: globalStore.depositWithdrawal.open, onOpenChange: (details) => {
26
- globalStore.depositWithdrawal.setOpen(details.open);
27
- if (!details.open) {
28
- globalStore.depositWithdrawal.setPromo(null);
29
- }
30
- }, 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)]", children: _jsxs(Dialog.Content, { className: "lg:min-h-auto mx-auto min-h-full w-full px-4 py-3xl lg:w-[480px] lg:rounded-xl", children: [_jsxs(Dialog.Header, { className: "flex items-center gap-xl", children: [_jsx("div", { className: "border-border-primary shadow-xs text-gray-700 text-text-secondary-700 flex size-10 items-center justify-center rounded-md border", children: _jsx(Wallet02Icon, { className: "size-5" }) }), _jsx(Dialog.Title, { className: "grow text-lg font-semibold", children: "Wallet" }), _jsx(Dialog.Context, { children: (api) => (_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, {}) })) })] }), _jsxs(Dialog.Body, { className: "mt-3xl", children: [_jsx("p", { className: "text-text-secondary-700 text-center text-sm", children: "Deposit Balance" }), _jsx("p", { className: "text-center text-3xl font-bold leading-tight tracking-tight", children: formatNumber(walletQuery.data?.balance, {
31
- currency: localeInfo.currency.code,
32
- minDecimalPlaces: 2,
33
- }) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: (details) => {
34
- globalStore.depositWithdrawal.setTab(z.enum(['DEPOSIT', 'WITHDRAWAL']).parse(details.value));
35
- }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }));
26
+ return (_jsx(DepositWithdrawalPropsProvider, { value: props, children: _jsx(Dialog.Root, { lazyMount: true, unmountOnExit: true, open: globalStore.depositWithdrawal.open, onOpenChange: (details) => {
27
+ globalStore.depositWithdrawal.setOpen(details.open);
28
+ if (!details.open) {
29
+ globalStore.depositWithdrawal.setPromo(null);
30
+ }
31
+ }, 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)]", children: _jsxs(Dialog.Content, { className: "lg:min-h-auto mx-auto min-h-full w-full px-4 py-3xl lg:w-[480px] lg:rounded-xl", children: [_jsxs(Dialog.Header, { className: "flex items-center gap-xl", children: [_jsx("div", { className: "border-border-primary shadow-xs text-gray-700 text-text-secondary-700 flex size-10 items-center justify-center rounded-md border", children: _jsx(Wallet02Icon, { className: "size-5" }) }), _jsx(Dialog.Title, { className: "grow text-lg font-semibold", children: "Wallet" }), _jsx(Dialog.Context, { children: (api) => (_jsx(IconButton, { size: "sm", variant: "outline", colorScheme: "gray", onClick: () => api.setOpen(false), children: _jsx(XIcon, {}) })) })] }), _jsxs(Dialog.Body, { className: "mt-3xl", children: [_jsx("p", { className: "text-text-secondary-700 text-center text-sm", children: "Deposit Balance" }), _jsx("p", { className: "text-center text-3xl font-bold leading-tight tracking-tight", children: formatNumber(walletQuery.data?.balance, {
32
+ currency: localeInfo.currency.code,
33
+ minDecimalPlaces: 2,
34
+ }) }), _jsxs(Tabs.Root, { value: globalStore.depositWithdrawal.tab, onValueChange: (details) => {
35
+ globalStore.depositWithdrawal.setTab(z.enum(['DEPOSIT', 'WITHDRAWAL']).parse(details.value));
36
+ }, lazyMount: true, unmountOnExit: true, className: "mt-3xl space-y-4xl", children: [_jsxs(Tabs.List, { className: "w-full", children: [_jsx(Tabs.Trigger, { value: "DEPOSIT", className: "grow", children: "Deposit" }), _jsx(Tabs.Trigger, { value: "WITHDRAWAL", className: "grow", children: "Withdrawal" }), _jsx(Tabs.Indicator, {})] }), _jsx(Tabs.Content, { value: "DEPOSIT", className: "space-y-3xl", children: _jsx(Deposit, {}) }), _jsx(Tabs.Content, { value: "WITHDRAWAL", className: "space-y-3xl", children: _jsx(Withdrawal, {}) })] })] })] }) })] }) }) }));
36
37
  }
@@ -0,0 +1,6 @@
1
+ import type { DepositWithdrawalProps } from './DepositWithdrawal.lazy';
2
+ export declare const DepositWithdrawalPropsProvider: (props: {
3
+ value: DepositWithdrawalProps;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useDepositWithdrawalPropsContext: () => DepositWithdrawalProps;
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../client/utils/createContext.js';
2
+ export const [DepositWithdrawalPropsProvider, useDepositWithdrawalPropsContext,] = createContext();
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
7
+ import { useShallow } from 'zustand/shallow';
6
8
  import { useCreateGCashWithdrawalMutation } from '../../../../client/hooks/useCreateGCashWithdrawalMutation.js';
9
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
7
10
  import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
8
11
  import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
9
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
@@ -22,7 +25,12 @@ import { PasswordInput } from '../../../../ui/PasswordInput/index.js';
22
25
  import { Portal } from '../../../../ui/Portal/index.js';
23
26
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
24
27
  import { AmountChoices } from '../../AmountChoices.js';
28
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
25
29
  export function GCashWithdrawal() {
30
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
31
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
32
+ depositWithdrawal: ctx.depositWithdrawal,
33
+ })));
26
34
  const [status, setStatus] = useState('waiting');
27
35
  const localeInfo = useLocaleInfo();
28
36
  const mobileNumberParser = useMobileNumberParser();
@@ -109,7 +117,7 @@ export function GCashWithdrawal() {
109
117
  shouldDirty: true,
110
118
  shouldValidate: true,
111
119
  });
112
- }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
120
+ }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
113
121
  if (!details.open) {
114
122
  setStatus('waiting');
115
123
  }
@@ -1,10 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createListCollection } from '@ark-ui/react/collection';
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
+ import Link from 'next/link';
4
5
  import { useEffect, useMemo, useState } from 'react';
5
6
  import { Controller, useForm } from 'react-hook-form';
6
7
  import { z } from 'zod';
8
+ import { useShallow } from 'zustand/shallow';
7
9
  import { useCreateInstapayWithdrawalMutation } from '../../../../client/hooks/useCreateInstapayWithdrawalMutation.js';
10
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
8
11
  import { useInstapayBankListQuery } from '../../../../client/hooks/useInstapayBankListQuery.js';
9
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
10
13
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
@@ -24,7 +27,12 @@ import { Portal } from '../../../../ui/Portal/index.js';
24
27
  import { Select } from '../../../../ui/Select/index.js';
25
28
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
26
29
  import { AmountChoices } from '../../AmountChoices.js';
30
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
27
31
  export function InstapayWithdrawal() {
32
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
33
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
34
+ depositWithdrawal: ctx.depositWithdrawal,
35
+ })));
28
36
  const [status, setStatus] = useState('waiting');
29
37
  const createWithdrawalMutation = useCreateInstapayWithdrawalMutation({
30
38
  onMutate() {
@@ -133,7 +141,7 @@ export function InstapayWithdrawal() {
133
141
  shouldDirty: true,
134
142
  shouldValidate: true,
135
143
  });
136
- }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
144
+ }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
137
145
  if (!details.open) {
138
146
  setStatus('waiting');
139
147
  }
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
7
+ import { useShallow } from 'zustand/shallow';
6
8
  import { useCreateMayaAppWithdrawalMutation } from '../../../../client/hooks/useCreateMayaAppWithdrawalMutation.js';
9
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
7
10
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
8
11
  import { AlertCircleIcon } from '../../../../icons/AlertCircleIcon.js';
9
12
  import { ChevronDownIcon } from '../../../../icons/ChevronDownIcon.js';
@@ -20,7 +23,12 @@ import { PasswordInput } from '../../../../ui/PasswordInput/index.js';
20
23
  import { Portal } from '../../../../ui/Portal/index.js';
21
24
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
22
25
  import { AmountChoices } from '../../AmountChoices.js';
26
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
23
27
  export function MayaAppWithdrawal() {
28
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
29
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
30
+ depositWithdrawal: ctx.depositWithdrawal,
31
+ })));
24
32
  const [status, setStatus] = useState('waiting');
25
33
  const createWithdrawalMutation = useCreateMayaAppWithdrawalMutation({
26
34
  onMutate() {
@@ -99,7 +107,7 @@ export function MayaAppWithdrawal() {
99
107
  shouldDirty: true,
100
108
  shouldValidate: true,
101
109
  });
102
- }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
110
+ }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
103
111
  if (!details.open) {
104
112
  setStatus('waiting');
105
113
  }
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { zodResolver } from '@hookform/resolvers/zod';
3
+ import Link from 'next/link';
3
4
  import { useEffect, useState } from 'react';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
7
+ import { useShallow } from 'zustand/shallow';
6
8
  import { useCreateMayaWithdrawalMutation } from '../../../../client/hooks/useCreateMayaWithdrawalMutation.js';
9
+ import { useGlobalStore } from '../../../../client/hooks/useGlobalStore.js';
7
10
  import { useLocaleInfo } from '../../../../client/hooks/useLocaleInfo.js';
8
11
  import { useMobileNumberParser } from '../../../../client/hooks/useMobileNumberParser.js';
9
12
  import { usePaymentSettingsQuery } from '../../../../client/hooks/usePaymentSettingsQuery.js';
@@ -22,7 +25,12 @@ import { PasswordInput } from '../../../../ui/PasswordInput/index.js';
22
25
  import { Portal } from '../../../../ui/Portal/index.js';
23
26
  import { parseDecimal } from '../../../../utils/parseDecimal.js';
24
27
  import { AmountChoices } from '../../AmountChoices.js';
28
+ import { useDepositWithdrawalPropsContext } from '../../DepositWithdrawalContext.js';
25
29
  export function MayaWithdrawal() {
30
+ const depositWithdrawalProps = useDepositWithdrawalPropsContext();
31
+ const globalStore = useGlobalStore(useShallow((ctx) => ({
32
+ depositWithdrawal: ctx.depositWithdrawal,
33
+ })));
26
34
  const [status, setStatus] = useState('waiting');
27
35
  const localeInfo = useLocaleInfo();
28
36
  const mobileNumberParser = useMobileNumberParser();
@@ -109,7 +117,7 @@ export function MayaWithdrawal() {
109
117
  shouldDirty: true,
110
118
  shouldValidate: true,
111
119
  });
112
- }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx("button", { type: "button", className: "underline underline-offset-2", children: "Terms of Use and Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
120
+ }, 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: "Password" }), _jsxs(PasswordInput.Control, { children: [_jsx(PasswordInput.Input, { ...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 })] }), _jsxs("p", { className: "mt-4xl text-xs", children: ["Upon clicking the deposit button, you agree to the", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/terms-of-use', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Terms of Use" }), ' ', "and", ' ', _jsx(Link, { href: depositWithdrawalProps.termsOfUseUrl ?? '/privacy-policy', onClick: () => globalStore.depositWithdrawal.setOpen(false), className: "underline underline-offset-2", children: "Privacy Policy" }), "."] }), _jsx(Button, { type: "submit", className: "mt-4.5", disabled: createWithdrawalMutation.isPending, children: "Withdraw" }), _jsx(AlertDialog.Root, { open: status !== 'waiting', onOpenChange: (details) => {
113
121
  if (!details.open) {
114
122
  setStatus('waiting');
115
123
  }
@@ -1,4 +1,12 @@
1
1
  import type { Game } from '../../types';
2
2
  import type { GamesProps } from './Games';
3
- export declare const GamesPropsContext: import("react").Context<GamesProps>, useGamesPropsContext: () => GamesProps;
4
- export declare const GameContext: import("react").Context<Game>, useGameContext: () => Game;
3
+ export declare const GamesPropsContext: (props: {
4
+ value: GamesProps;
5
+ } & {
6
+ children?: import("react").ReactNode | undefined;
7
+ }) => React.ReactNode, useGamesPropsContext: () => GamesProps;
8
+ export declare const GameContext: (props: {
9
+ value: Game;
10
+ } & {
11
+ children?: import("react").ReactNode | undefined;
12
+ }) => React.ReactNode, useGameContext: () => Game;
@@ -1,2 +1,6 @@
1
1
  import type { Jackpot } from '../../../types';
2
- export declare const JackpotsCarouselItemContext: import("react").Context<Jackpot>, useJackpotsCarouselItemContext: () => Jackpot;
2
+ export declare const JackpotsCarouselItemContext: (props: {
3
+ value: Jackpot;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useJackpotsCarouselItemContext: () => Jackpot;
@@ -1,4 +1,12 @@
1
1
  import type { Jackpot } from '../../../types';
2
2
  import type { JackpotsListProps } from './JackpotsList';
3
- export declare const JackpotsListPropsContext: import("react").Context<JackpotsListProps>, useJackpotsListPropsContext: () => JackpotsListProps;
4
- export declare const JackpotsListItemContext: import("react").Context<Jackpot>, useJackpotsListItemContext: () => Jackpot;
3
+ export declare const JackpotsListPropsContext: (props: {
4
+ value: JackpotsListProps;
5
+ } & {
6
+ children?: import("react").ReactNode | undefined;
7
+ }) => React.ReactNode, useJackpotsListPropsContext: () => JackpotsListProps;
8
+ export declare const JackpotsListItemContext: (props: {
9
+ value: Jackpot;
10
+ } & {
11
+ children?: import("react").ReactNode | undefined;
12
+ }) => React.ReactNode, useJackpotsListItemContext: () => Jackpot;
@@ -1,2 +1,6 @@
1
1
  import type { UseKYCReturn } from './useKYC';
2
- export declare const KYCContext: import("react").Context<UseKYCReturn>, useKYCContext: () => UseKYCReturn;
2
+ export declare const KYCContext: (props: {
3
+ value: UseKYCReturn;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useKYCContext: () => UseKYCReturn;
@@ -1,2 +1,6 @@
1
1
  import type { UseKYCReturn } from './useKYC';
2
- export declare const KYCContext: import("react").Context<UseKYCReturn>, useKYCContext: () => UseKYCReturn;
2
+ export declare const KYCContext: (props: {
3
+ value: UseKYCReturn;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useKYCContext: () => UseKYCReturn;
@@ -1,2 +1,6 @@
1
1
  import type { Message } from '../../types';
2
- export declare const MessageContext: import("react").Context<Message>, useMessageContext: () => Message;
2
+ export declare const MessageContext: (props: {
3
+ value: Message;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useMessageContext: () => Message;
@@ -1,2 +1,6 @@
1
1
  import type { Quest } from '../../types';
2
- export declare const QuestContext: import("react").Context<Quest>, useQuestContext: () => Quest;
2
+ export declare const QuestContext: (props: {
3
+ value: Quest;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useQuestContext: () => Quest;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useDialogContext } from '@ark-ui/react/dialog';
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
+ import Link from 'next/link';
4
5
  import { useRef } from 'react';
5
6
  import { Controller, useForm } from 'react-hook-form';
6
7
  import { z } from 'zod';
@@ -20,8 +21,9 @@ import { Button } from '../../ui/Button/index.js';
20
21
  import { Checkbox } from '../../ui/Checkbox/index.js';
21
22
  import { Field } from '../../ui/Field/index.js';
22
23
  import { PinInput } from '../../ui/PinInput/index.js';
23
- import { useSignInContext } from './SignInContext.js';
24
+ import { useSignInContext, useSignInPropsContext } from './SignInContext.js';
24
25
  export function MobileNumberSignIn() {
26
+ const signInProps = useSignInPropsContext();
25
27
  const context = useSignInContext();
26
28
  const dialog = useDialogContext();
27
29
  const globalStore = useGlobalStore(useShallow((ctx) => ({
@@ -101,7 +103,10 @@ export function MobileNumberSignIn() {
101
103
  paddingLeft: `calc(2.75rem + ${localeInfo.mobileNumber.areaCode.length}ch)`,
102
104
  }, ...step1Form.register('mobileNumber') })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.mobileNumber?.message })] }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Log In" }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
103
105
  o.field.onChange(details.checked);
104
- }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
106
+ }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signInProps.termsAndConditionsUrl ??
107
+ '/terms-and-conditions', onClick: () => {
108
+ dialog.setOpen(false);
109
+ }, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
105
110
  dialog.setOpen(false);
106
111
  }, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
107
112
  dialog.setOpen(false);
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useDialogContext } from '@ark-ui/react/dialog';
3
3
  import { zodResolver } from '@hookform/resolvers/zod';
4
+ import Link from 'next/link';
4
5
  import { Controller, useForm } from 'react-hook-form';
5
6
  import { z } from 'zod';
6
7
  import { useShallow } from 'zustand/shallow';
@@ -18,8 +19,9 @@ import { Button } from '../../ui/Button/index.js';
18
19
  import { Checkbox } from '../../ui/Checkbox/index.js';
19
20
  import { Field } from '../../ui/Field/index.js';
20
21
  import { PasswordInput } from '../../ui/PasswordInput/index.js';
21
- import { useSignInContext } from './SignInContext.js';
22
+ import { useSignInContext, useSignInPropsContext } from './SignInContext.js';
22
23
  export function NameAndPasswordSignIn() {
24
+ const signInProps = useSignInPropsContext();
23
25
  const context = useSignInContext();
24
26
  const dialog = useDialogContext();
25
27
  const globalStore = useGlobalStore(useShallow((ctx) => ({
@@ -124,7 +126,10 @@ export function NameAndPasswordSignIn() {
124
126
  dialog.setOpen(false);
125
127
  }, children: "Forgot Password" }) })] }) }), signInMutation.data && (_jsxs(Field.Root, { invalid: !!form.formState.errors.secretAnswer, className: "mt-xl", children: [_jsx(Field.Label, { children: secretQuestion }), _jsx(Field.Input, { placeholder: "Answer the security question", ...form.register('secretAnswer') }), _jsx(Field.ErrorText, { children: form.formState.errors.secretAnswer?.message })] })), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: signInMutation.isPending || authenticateMutation.isPending, children: "Log In" }), _jsx(Controller, { control: form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { invalid: o.fieldState.invalid, className: "mt-xl", children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
126
128
  o.field.onChange(details.checked);
127
- }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
129
+ }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signInProps.termsAndConditionsUrl ??
130
+ '/terms-and-conditions', onClick: () => {
131
+ dialog.setOpen(false);
132
+ }, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
128
133
  dialog.setOpen(false);
129
134
  }, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Continue with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
130
135
  dialog.setOpen(false);
@@ -3,6 +3,8 @@ import type { ReactNode } from 'react';
3
3
  export interface SignInProps {
4
4
  logo: ImageProps['src'];
5
5
  className?: string;
6
+ /** @default '/terms-and-conditions' */
7
+ termsAndConditionsUrl?: string;
6
8
  children?: ReactNode;
7
9
  }
8
10
  export declare function SignIn(props: SignInProps): import("react/jsx-runtime").JSX.Element;
@@ -7,13 +7,13 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
7
7
  import { XIcon } from '../../icons/XIcon.js';
8
8
  import { Dialog } from '../../ui/Dialog/index.js';
9
9
  import { Portal } from '../../ui/Portal/index.js';
10
- import { SignInContext } from './SignInContext.js';
10
+ import { SignInPropsProvider, SignInProvider } from './SignInContext.js';
11
11
  import { SignInForm } from './SignInForm.js';
12
12
  import { useSignIn } from './useSignIn.js';
13
13
  export function SignIn(props) {
14
14
  const signIn = useSignIn();
15
15
  const signInStore = useGlobalStore(useShallow((ctx) => ctx.signIn));
16
- return (_jsx(SignInContext, { value: signIn, children: _jsx(Dialog.Root, { open: signInStore.open, onOpenChange: (details) => {
17
- signInStore.setOpen(details.open);
18
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge("bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl", props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-7.5 w-auto", draggable: false }), _jsx(SignInForm, {})] }) })] }) }) }));
16
+ return (_jsx(SignInPropsProvider, { value: props, children: _jsx(SignInProvider, { value: signIn, children: _jsx(Dialog.Root, { open: signInStore.open, onOpenChange: (details) => {
17
+ signInStore.setOpen(details.open);
18
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-7.5 w-auto", draggable: false }), _jsx(SignInForm, {})] }) })] }) }) }) }));
19
19
  }
@@ -1,2 +1,12 @@
1
+ import type { SignInProps } from './SignIn.lazy';
1
2
  import type { UseSignInReturn } from './useSignIn';
2
- export declare const SignInContext: import("react").Context<UseSignInReturn>, useSignInContext: () => UseSignInReturn;
3
+ export declare const SignInProvider: (props: {
4
+ value: UseSignInReturn;
5
+ } & {
6
+ children?: import("react").ReactNode | undefined;
7
+ }) => React.ReactNode, useSignInContext: () => UseSignInReturn;
8
+ export declare const SignInPropsProvider: (props: {
9
+ value: SignInProps;
10
+ } & {
11
+ children?: import("react").ReactNode | undefined;
12
+ }) => React.ReactNode, useSignInPropsContext: () => SignInProps;
@@ -1,2 +1,3 @@
1
1
  import { createContext } from '../../client/utils/createContext.js';
2
- export const [SignInContext, useSignInContext] = createContext();
2
+ export const [SignInProvider, useSignInContext] = createContext();
3
+ export const [SignInPropsProvider, useSignInPropsContext] = createContext();
@@ -3,6 +3,8 @@ import { type ReactNode } from 'react';
3
3
  export interface SignUpProps {
4
4
  logo: ImageProps['src'];
5
5
  children?: ReactNode;
6
+ /** @default "/terms-and-conditions" */
7
+ termsAndConditionsUrl?: string;
6
8
  className?: string;
7
9
  }
8
10
  export declare function SignUp(props: SignUpProps): import("react/jsx-runtime").JSX.Element;
@@ -8,10 +8,11 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
8
8
  import { XIcon } from '../../icons/XIcon.js';
9
9
  import { Dialog } from '../../ui/Dialog/index.js';
10
10
  import { Portal } from '../../ui/Portal/index.js';
11
+ import { SignUpPropsProvider } from './SignUpContext.js';
11
12
  import { SignUpForm } from './SignUpForm.js';
12
13
  export function SignUp(props) {
13
14
  const signUpStore = useGlobalStore(useShallow((ctx) => ctx.signUp));
14
- return (_jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
15
- signUpStore.setOpen(details.open);
16
- }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge("bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl", props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpForm, {}) })] }) })] }) }));
15
+ return (_jsx(SignUpPropsProvider, { value: props, children: _jsx(Dialog.Root, { open: signUpStore.open, onOpenChange: (details) => {
16
+ signUpStore.setOpen(details.open);
17
+ }, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: twMerge('bg-bg-primary-alt mx-auto h-full w-full items-start p-3xl pb-4xl lg:h-auto lg:w-[400px] lg:rounded-xl', props.className), children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto h-auto w-[120px]", draggable: false }), _jsx(Suspense, { children: _jsx(SignUpForm, {}) })] }) })] }) }) }));
17
18
  }
@@ -0,0 +1,6 @@
1
+ import type { SignUpProps } from './SignUp.lazy';
2
+ export declare const SignUpPropsProvider: (props: {
3
+ value: SignUpProps;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useSignUpPropsContext: () => SignUpProps;
@@ -0,0 +1,2 @@
1
+ import { createContext } from '../../client/utils/createContext.js';
2
+ export const [SignUpPropsProvider, useSignUpPropsContext] = createContext();
@@ -6,6 +6,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
6
6
  import { ObjectId } from '@opexa/object-id';
7
7
  import { differenceInYears, format } from 'date-fns';
8
8
  import { noop } from 'lodash-es';
9
+ import Link from 'next/link';
9
10
  import { useSearchParams } from 'next/navigation';
10
11
  import { useRef, useState } from 'react';
11
12
  import { Controller, useForm } from 'react-hook-form';
@@ -37,12 +38,14 @@ import { Field } from '../../ui/Field/index.js';
37
38
  import { PinInput } from '../../ui/PinInput/index.js';
38
39
  import { Select } from '../../ui/Select/index.js';
39
40
  import { createPoll } from '../../utils/createPoll.js';
41
+ import { useSignUpPropsContext } from './SignUpContext.js';
40
42
  const branchCollection = createListCollection({
41
43
  items: BRANCH_CODES,
42
44
  itemToValue: (item) => item.code,
43
45
  itemToString: (item) => `${item.code} - ${item.name}`,
44
46
  });
45
47
  export function SignUpForm() {
48
+ const signUpProps = useSignUpPropsContext();
46
49
  const [step, setStep] = useState(1);
47
50
  const dialog = useDialogContext();
48
51
  const search = useSearchParams();
@@ -168,7 +171,10 @@ export function SignUpForm() {
168
171
  placement: 'bottom',
169
172
  }, lazyMount: true, unmountOnExit: true, children: [_jsx(Select.Label, { children: "Branch" }), _jsxs(Select.Trigger, { children: [_jsx(Select.ValueText, {}), _jsx(Select.Indicator, { asChild: true, children: _jsx(ChevronDownIcon, {}) })] }), _jsx(Select.Positioner, { children: _jsx(Select.Content, { children: branchCollection.items.map((item) => (_jsx(Select.Item, { item: item, children: branchCollection.stringifyItem(item) }, item.code))) }) })] }), _jsx(Field.ErrorText, { children: step1Form.formState.errors.branchCode?.message })] }), _jsx(Controller, { control: step1Form.control, name: "termsAccepted", render: (o) => (_jsxs(Field.Root, { className: "mt-2xl", invalid: o.fieldState.invalid, children: [_jsxs(Checkbox.Root, { checked: o.field.value, onCheckedChange: (details) => {
170
173
  o.field.onChange(details.checked);
171
- }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx("span", { className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
174
+ }, children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsxs(Checkbox.Label, { children: ["I am at least 21 years of age and I accept the", ' ', _jsx(Link, { href: signUpProps.termsAndConditionsUrl ??
175
+ '/terms-and-conditions', onClick: () => {
176
+ dialog.setOpen(false);
177
+ }, className: "text-brand-400 whitespace-nowrap underline underline-offset-2", children: "Terms and Conditions." })] }), ' ', _jsx(Checkbox.HiddenInput, {})] }), _jsx(Field.ErrorText, { className: "ml-6 text-xs", children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-3xl", disabled: step1Form.formState.isSubmitting, children: "Create Account" })] }), _jsxs("div", { className: "mt-6 flex items-center gap-2", children: [_jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" }), _jsx("span", { className: "text-text-tertiary-600 text-sm font-semibold", children: "Log in directly with" }), _jsx("div", { className: "bg-text-tertiary-600/50 h-px flex-grow" })] }), _jsxs("div", { className: "mt-6", children: [_jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
172
178
  dialog.setOpen(false);
173
179
  }, className: "border-border-primary bg-bg-primary text-text-secondary-700", children: [_jsx(GoogleIcon, { className: "size-6" }), "Sign in with Google"] }), _jsxs(Button, { variant: "outline", colorScheme: "gray", onClick: () => {
174
180
  dialog.setOpen(false);
@@ -1,2 +1,6 @@
1
1
  import type { Tournament } from '../../../types';
2
- export declare const TournamentsCarouselItemContext: import("react").Context<Tournament>, useTournamentsCarouselItemContext: () => Tournament;
2
+ export declare const TournamentsCarouselItemContext: (props: {
3
+ value: Tournament;
4
+ } & {
5
+ children?: import("react").ReactNode | undefined;
6
+ }) => React.ReactNode, useTournamentsCarouselItemContext: () => Tournament;
@@ -1,4 +1,12 @@
1
1
  import type { Tournament } from '../../../types';
2
2
  import type { TournamentsListProps } from './TournamentsList';
3
- export declare const TournamentsListPropsContext: import("react").Context<TournamentsListProps>, useTournamentsListPropsContext: () => TournamentsListProps;
4
- export declare const TournamentsListItemContext: import("react").Context<Tournament>, useTournamentsListItemContext: () => Tournament;
3
+ export declare const TournamentsListPropsContext: (props: {
4
+ value: TournamentsListProps;
5
+ } & {
6
+ children?: import("react").ReactNode | undefined;
7
+ }) => React.ReactNode, useTournamentsListPropsContext: () => TournamentsListProps;
8
+ export declare const TournamentsListItemContext: (props: {
9
+ value: Tournament;
10
+ } & {
11
+ children?: import("react").ReactNode | undefined;
12
+ }) => React.ReactNode, useTournamentsListItemContext: () => Tournament;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.128",
3
+ "version": "0.0.129",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",