@opexa/portal-components 0.0.173 → 0.0.175

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.
@@ -127,7 +127,7 @@ export function ForgotPasswordForm() {
127
127
  o.field.onChange(details.value);
128
128
  }, onValueComplete: () => {
129
129
  form2Ref.current?.requestSubmit();
130
- }, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
130
+ }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: resetPasswordMutation.isPending, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
131
131
  await sendVerificationCodeMutation.mutateAsync({
132
132
  channel: 'SMS',
133
133
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -24,6 +24,8 @@ export function MessagesPopup() {
24
24
  const transactionsPageUrl = messagesProps.transactionsPageUrl ?? '/transactions';
25
25
  const globalStore = useGlobalStore(useShallow((ctx) => ({
26
26
  kyc: ctx.kyc,
27
+ account: ctx.account,
28
+ account__mobile: ctx.account__mobile,
27
29
  message: ctx.message,
28
30
  messages: ctx.messages,
29
31
  gameLaunch: ctx.gameLaunch,
@@ -65,6 +67,8 @@ export function MessagesPopup() {
65
67
  !globalStore.depositWithdrawal.open &&
66
68
  !globalStore.messages.open &&
67
69
  !globalStore.message.open &&
70
+ !globalStore.account.open &&
71
+ !globalStore.account__mobile.open &&
68
72
  !globalStore.kyc.open &&
69
73
  !paused,
70
74
  refetchInterval: disclosure.open ? undefined : 1000 * 10,
@@ -130,7 +130,7 @@ export function MobileNumberSignIn() {
130
130
  o.field.onBlur();
131
131
  }, otp: true, onValueComplete: () => {
132
132
  form2Ref.current?.requestSubmit();
133
- }, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold", disabled: cooldown.cooling, onClick: async () => {
133
+ }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.fieldState.error?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold", disabled: cooldown.cooling, onClick: async () => {
134
134
  await sendVerificationCodeMutation.mutateAsync({
135
135
  channel: 'SMS',
136
136
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -251,7 +251,7 @@ export function SignUpForm() {
251
251
  o.field.onChange(details.value);
252
252
  }, onValueComplete: () => {
253
253
  form2Ref.current?.requestSubmit();
254
- }, children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
254
+ }, blurOnComplete: true, readOnly: step2Form.formState.isSubmitting, type: "numeric", children: [_jsxs(PinInput.Control, { className: "grid-cols-[1fr_1fr_1fr_auto_1fr_1fr_1fr] items-center gap-md", children: [_jsx(PinInput.Input, { index: 0 }), _jsx(PinInput.Input, { index: 1 }), _jsx(PinInput.Input, { index: 2 }), _jsx("span", { className: "text-text-placeholder-subtle text-2xl font-medium", children: "\u2013" }), _jsx(PinInput.Input, { index: 3 }), _jsx(PinInput.Input, { index: 4 }), _jsx(PinInput.Input, { index: 5 })] }), _jsx(PinInput.HiddenInput, {})] }), _jsx(Field.ErrorText, { children: o.formState.errors.verificationCode?.message })] })) }), _jsx(Button, { type: "submit", className: "mt-4xl", disabled: step2Form.formState.isSubmitting, children: "Verify" }), _jsxs("div", { className: "mt-3 flex w-full items-center justify-center gap-xs text-sm", children: [_jsx("span", { className: "text-text-secondary-700", children: "Didn't recieve the code?" }), _jsx("button", { type: "button", className: "text-button-secondary-fg font-semibold disabled:cursor-not-allowed disabled:opacity-75", disabled: cooldown.cooling, onClick: async () => {
255
255
  await sendVerificationCodeMutation.mutateAsync({
256
256
  channel: 'SMS',
257
257
  recipient: mobileNumberParser.format(step1Form.getValues('mobileNumber')),
@@ -1,7 +1,3 @@
1
1
  import { NextFetchEvent, NextResponse, type NextMiddleware, type NextRequest } from 'next/server';
2
- export declare const config: {
3
- runtime: string;
4
- matcher: string[];
5
- };
6
2
  export declare const middleware: (req: NextRequest) => Promise<NextResponse>;
7
3
  export declare function extendMiddleware<T>(fn: (req: NextRequest, evt: NextFetchEvent, res: NextResponse) => NextResponse<T> | Promise<NextResponse<T>>): NextMiddleware;
@@ -2,18 +2,12 @@ import { addDays, addMinutes } from 'date-fns';
2
2
  import { NextFetchEvent, NextResponse, } from 'next/server';
3
3
  import { ACCESS_TOKEN_COOKIE_NAME, DOMAIN_COOKIE_NAME, REFRESH_TOKEN_COOKIE_NAME, } from './constants/index.js';
4
4
  import { refreshSession } from './services/auth.js';
5
- export const config = {
6
- runtime: 'nodejs',
7
- matcher: [
8
- '/((?!api|models|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)',
9
- ],
10
- };
11
5
  export const middleware = async (req) => {
12
6
  const accessToken = req.cookies.get(ACCESS_TOKEN_COOKIE_NAME)?.value;
13
7
  const refreshToken = req.cookies.get(REFRESH_TOKEN_COOKIE_NAME)?.value;
14
8
  const res = NextResponse.next();
15
9
  if (req.nextUrl.searchParams.has('m')) {
16
- res.cookies.set(DOMAIN_COOKIE_NAME, `${req.nextUrl.origin}/${req.nextUrl.searchParams.get('m')}`, {
10
+ res.cookies.set(DOMAIN_COOKIE_NAME, `${req.nextUrl.hostname}/${req.nextUrl.searchParams.get('m')}`, {
17
11
  expires: addDays(new Date(), 30),
18
12
  httpOnly: true,
19
13
  sameSite: 'strict',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.173",
3
+ "version": "0.0.175",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",