@opexa/portal-components 0.0.163 → 0.0.165

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.
@@ -107,12 +107,17 @@ function Wallet() {
107
107
  }
108
108
  function Links() {
109
109
  const accountProps = useAccountPropsContext();
110
- const signOutMutation = useSignOutMutation();
111
110
  const globalStore = useGlobalStore(useShallow((ctx) => ({
112
111
  account: ctx.account,
113
112
  account__mobile: ctx.account__mobile,
114
113
  messages: ctx.messages,
115
114
  })));
115
+ const signOutMutation = useSignOutMutation({
116
+ onSuccess() {
117
+ localStorage.clear();
118
+ sessionStorage.clear();
119
+ },
120
+ });
116
121
  const unreadMessagesCountQuery = useUnreadMessagesCountQuery({}, { refetchInterval: 5000 });
117
122
  const unreadMessagesCount = unreadMessagesCountQuery.data ?? 0;
118
123
  const profileCompletionQuery = useProfileCompletionQuery();
@@ -13,7 +13,6 @@ import { FaceIdIcon } from '../../icons/FaceIdIcon.js';
13
13
  import { FileCheck02Icon } from '../../icons/FileCheck02Icon.js';
14
14
  import { FileSearch02Icon } from '../../icons/FileSearch02Icon.js';
15
15
  import { FileX02Icon } from '../../icons/FileX02Icon.js';
16
- import { Globe05Icon } from '../../icons/Globe05Icon.js';
17
16
  import { Button } from '../../ui/Button/index.js';
18
17
  export function AccountVerification(props) {
19
18
  const globalStore = useGlobalStore(useShallow((ctx) => ({
@@ -30,7 +29,7 @@ export function AccountVerification(props) {
30
29
  verification?.status === 'UNVERIFIED';
31
30
  return (_jsxs("div", { className: props.className, children: [_jsxs("div", { className: "flex items-start gap-8", children: [_jsxs("div", { className: "grow", children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verify your identity" }), _jsx("p", { className: "text-text-tertiary-600 text-sm", children: "Complete personal verification to unlock all features and enhance account security." })] }), _jsx(ark.svg, { asChild: true, className: twMerge('size-6', profileCompletion?.accountVerification
32
31
  ? 'text-text-success-primary'
33
- : 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(Globe05Icon, {}), "Proof of address"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary flex justify-end border-t px-4 py-3 lg:py-xl", children: (!verification || verification?.status === 'REJECTED') && (_jsx(Button, { size: "sm", className: "w-full lg:w-fit", onClick: () => globalStore.kyc.setOpen(true), children: "Verify Now" })) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
32
+ : 'text-text-warning-primary'), children: profileCompletion?.accountVerification ? (_jsx(CheckVerified02Icon, {})) : (_jsx(AlertCircleIcon, {})) })] }), _jsxs("div", { className: "shadow-xs border-border-secondary bg-bg-primary-alt mt-5 rounded-xl border", children: [_jsx("div", { className: "px-4 py-5", children: _jsxs("ul", { className: "space-y-lg", children: [_jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FileCheck02Icon, {}), "Basic Information"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(CreditCard02Icon, {}), "Government ID"] }), _jsxs("li", { className: "text-text-secondary-700 icon:size-6 icon:text-text-nav-item-button-icon flex items-center gap-lg", children: [_jsx(FaceIdIcon, {}), "Facial Verification"] })] }) }), _jsx("div", { className: "border-border-secondary flex justify-end border-t px-4 py-3 lg:py-xl", children: (!verification || verification?.status === 'REJECTED') && (_jsx(Button, { size: "sm", className: "w-full lg:w-fit", onClick: () => globalStore.kyc.setOpen(true), children: "Verify Now" })) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
34
33
  }
35
34
  function VerificationNotSubmitted() {
36
35
  return (_jsxs("div", { className: "shadow-xs border-border-primary bg-bg-primary-alt mt-6 flex flex-col gap-2 rounded-xl border p-xl lg:flex-row", children: [_jsx("div", { className: "border-text-warning-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-warning-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(AlertCircleIcon, { className: "text-text-warning-primary size-5" }) }) }), _jsx("p", { className: "text-text-tertiary-600 max-w-[800px] text-sm", children: "To serve you better and unlock all features, please provide valid identification documents. This helps protect your account and makes recovery easier if ever needed." })] }));
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
- import { DOMAIN } from '../../constants/index.js';
4
3
  import { getSession } from '../../server/services/getSession.js';
5
4
  import { prefetchBonusQuery } from '../../server/utils/prefetchBonusQuery.js';
6
5
  import { getBonus } from '../../services/wallet.js';
@@ -22,7 +21,7 @@ export async function Bonus(props) {
22
21
  prefetchBonusQuery(props.id),
23
22
  ]);
24
23
  if (result.status === 'fulfilled' && result.value) {
25
- return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "twitter:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Bonus__client, { ...props })] }));
24
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:title", content: result.value.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "og:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.promo.description) }), _jsx("meta", { name: "twitter:image", content: result.value.promo.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Bonus__client, { ...props })] }));
26
25
  }
27
26
  else {
28
27
  return notFound();
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
- import { DOMAIN } from '../../constants/index.js';
4
3
  import { prefetchCashbackQuery } from '../../server/utils/prefetchCashbackQuery.js';
5
4
  import { getCashback } from '../../services/wallet.js';
6
5
  import { stripTags } from '../../utils/stripTags.js';
@@ -11,7 +10,7 @@ export async function Cashback(props) {
11
10
  prefetchCashbackQuery(props.id),
12
11
  ]);
13
12
  if (result.status === 'fulfilled' && result.value) {
14
- return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Cashback__client, { ...props })] }));
13
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Cashback__client, { ...props })] }));
15
14
  }
16
15
  else {
17
16
  return notFound();
@@ -2,12 +2,11 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import Image from 'next/image';
4
4
  import Link from 'next/link';
5
- import { DOMAIN } from '../../constants/index.js';
6
5
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
7
6
  import { Prose } from '../../ui/Prose/index.js';
8
7
  import { stripTags } from '../../utils/stripTags.js';
9
8
  export function CustomPromo(props) {
10
- return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
9
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:title", content: props.promo.name }), _jsx("meta", { name: "og:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "og:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:title", content: props.promo.name }), _jsx("meta", { name: "twitter:description", content: stripTags(props.promo.description) }), _jsx("meta", { name: "twitter:image", content: props.promo.banner }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsxs("div", { className: props.className, children: [_jsxs(Link, { href: props.viewAllPromosUrl ?? '/promos', className: "text-button-tertiary-fg flex w-fit items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all Promotions"] }), _jsx(Image, { src: props.promo.banner, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-xl h-auto w-full rounded-xl lg:mt-6" }), _jsx("h1", { className: "mt-xl text-2xl font-semibold lg:mt-6 lg:text-3xl", children: props.promo.name }), _jsx(Prose, { className: "mt-2xl lg:mt-6", dangerouslySetInnerHTML: {
11
10
  __html: props.promo.description,
12
11
  } })] })] }));
13
12
  }
@@ -1,6 +1,6 @@
1
1
  export declare const OnlineBankDepositContext: (props: {
2
2
  value: {
3
- view: "vca" | "form";
3
+ view: "form" | "vca";
4
4
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
@@ -13,7 +13,7 @@ export declare const OnlineBankDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useOnlineBankDepositContext: () => {
16
- view: "vca" | "form";
16
+ view: "form" | "vca";
17
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseOnlineBankDepositReturn = ReturnType<typeof useOnlineBankDeposit>;
3
3
  export declare function useOnlineBankDeposit(): {
4
- view: "vca" | "form";
4
+ view: "form" | "vca";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -1,6 +1,6 @@
1
1
  export declare const QRPHDepositContext: (props: {
2
2
  value: {
3
- view: "qrCode" | "form";
3
+ view: "form" | "qrCode";
4
4
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
5
5
  verify: () => void;
6
6
  reset: () => void;
@@ -13,7 +13,7 @@ export declare const QRPHDepositContext: (props: {
13
13
  } & {
14
14
  children?: import("react").ReactNode | undefined;
15
15
  }) => React.ReactNode, useQRPHDepositContext: () => {
16
- view: "qrCode" | "form";
16
+ view: "form" | "qrCode";
17
17
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
18
18
  verify: () => void;
19
19
  reset: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { Deposit } from '../../../../types';
2
2
  export type UseQRPHDepositReturn = ReturnType<typeof useQRPHDeposit>;
3
3
  export declare function useQRPHDeposit(): {
4
- view: "qrCode" | "form";
4
+ view: "form" | "qrCode";
5
5
  status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
6
6
  verify: () => void;
7
7
  reset: () => void;
@@ -4,6 +4,7 @@ import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
4
4
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
5
5
  import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
6
6
  import { useSessionQuery } from '../../client/hooks/useSessionQuery.js';
7
+ import { KYC_PROMPT_LOCALSTORAGE_KEY } from '../../constants/index.js';
7
8
  export function AutoOpen() {
8
9
  const kycStore = useGlobalStore(useShallow((ctx) => ctx.kyc));
9
10
  const { data: session } = useSessionQuery();
@@ -12,11 +13,13 @@ export function AutoOpen() {
12
13
  const shouldOpen = !account?.realName ||
13
14
  !account?.birthDay ||
14
15
  !verification ||
15
- verification.status === 'REJECTED';
16
+ verification.status === 'REJECTED' ||
17
+ verification.status === 'UNVERIFIED';
16
18
  useEffect(() => {
17
19
  if (session?.status == 'authenticated' &&
18
20
  !kycStore['~touched'] &&
19
- shouldOpen) {
21
+ shouldOpen &&
22
+ localStorage.getItem(KYC_PROMPT_LOCALSTORAGE_KEY) == null) {
20
23
  kycStore.setOpen(true);
21
24
  return;
22
25
  }
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
3
  import { useShallow } from 'zustand/shallow';
4
4
  import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
5
+ import { KYC_PROMPT_LOCALSTORAGE_KEY } from '../../constants/index.js';
5
6
  import { XIcon } from '../../icons/XIcon.js';
6
7
  import { Dialog } from '../../ui/Dialog/index.js';
7
8
  import { Portal } from '../../ui/Portal/index.js';
@@ -20,5 +21,8 @@ export function KYC(props) {
20
21
  const kyc = useKYC();
21
22
  return (_jsx(KYCContext, { value: kyc, children: _jsx(Dialog.Root, { open: globalStore.kyc.open, onOpenChange: (details) => {
22
23
  globalStore.kyc.setOpen(details.open);
24
+ if (!details.open) {
25
+ localStorage.setItem(KYC_PROMPT_LOCALSTORAGE_KEY, '');
26
+ }
23
27
  }, lazyMount: true, unmountOnExit: true, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsxs(Dialog.Content, { className: "bg-bg-primary-alt lg:min-h-auto mx-auto min-h-full w-full lg:w-fit", children: [kyc.capturing === 'SELFIE' && _jsx(CaptureSelfie, {}), kyc.capturing === 'ID_DOCUMENT' && _jsx(CaptureIdDocument, {}), !kyc.capturing && (_jsxs("div", { className: "w-full p-3xl lg:w-[400px]", children: [_jsx(Dialog.CloseTrigger, { children: _jsx(XIcon, {}) }), _jsx(Image, { src: props.logo, alt: "", width: 200, height: 100, className: "mx-auto mb-5 block h-7.5 w-auto", draggable: false }), _jsx(Indicator, {}), kyc.step === 1 && _jsx(BasicInformation, {}), kyc.step === 2 && _jsx(IdentityVerification, {}), kyc.step === 3 && _jsx(PersonalInformation, {})] }))] }) })] }) }) }));
24
28
  }
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import Image from 'next/image';
3
3
  import Link from 'next/link';
4
- import { DOMAIN } from '../../constants/index.js';
5
4
  import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
6
5
  import { Prose } from '../../ui/Prose/index.js';
7
6
  import { stripTags } from '../../utils/stripTags.js';
8
7
  export function News(props) {
9
- return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:title", content: props.news.title }), _jsx("meta", { name: "og:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:image", content: props.news.image }), _jsx("meta", { name: "twitter:title", content: props.news.title }), _jsx("meta", { name: "twitter:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "twitter:image", content: props.news.image }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
8
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:title", content: props.news.title }), _jsx("meta", { name: "og:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "og:image", content: props.news.image }), _jsx("meta", { name: "twitter:title", content: props.news.title }), _jsx("meta", { name: "twitter:description", content: stripTags(props.news.content) }), _jsx("meta", { name: "twitter:image", content: props.news.image }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsxs("div", { style: props.style, className: props.className, children: [_jsxs(Link, { href: props.viewAllUrl ?? '/news', className: "text-button-secondary-fg flex items-center gap-lg text-lg font-semibold", children: [_jsx(ChevronLeftIcon, { className: "size-6" }), "Back to all News"] }), _jsx(Image, { src: props.news.image, alt: "", width: 1024, height: 600, priority: true, unoptimized: true, className: "mt-3xl block h-auto w-full rounded-xl lg:mt-6" }), _jsx("p", { className: "text-brand-400 mt-xl text-sm font-semibold lg:mt-6", children: props.news.category }), _jsx("h2", { className: "mt-xl text-2xl font-semibold lg:mt-6", children: props.news.title }), _jsx(Prose, { className: "mt-xl lg:mt-6", dangerouslySetInnerHTML: {
10
9
  __html: props.news.content,
11
10
  } })] })] }));
12
11
  }
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { notFound } from 'next/navigation';
3
- import { DOMAIN } from '../../constants/index.js';
4
3
  import { prefetchPromoQuery } from '../../server/utils/prefetchPromoQuery.js';
5
4
  import { getPromo } from '../../services/wallet.js';
6
5
  import { stripTags } from '../../utils/stripTags.js';
@@ -11,7 +10,7 @@ export async function Promo(props) {
11
10
  prefetchPromoQuery(props.id),
12
11
  ]);
13
12
  if (result.status === 'fulfilled' && result.value) {
14
- return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx("meta", { name: "twitter:site", content: DOMAIN }), _jsx(Promo__client, { ...props })] }));
13
+ return (_jsxs(_Fragment, { children: [_jsx("meta", { name: "description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:title", content: result.value.name }), _jsx("meta", { name: "og:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "og:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:title", content: result.value.name }), _jsx("meta", { name: "twitter:description", content: stripTags(result.value.description) }), _jsx("meta", { name: "twitter:image", content: result.value.banner.url }), _jsx("meta", { name: "twitter:card", content: "summary_large_image" }), _jsx(Promo__client, { ...props })] }));
15
14
  }
16
15
  else {
17
16
  return notFound();
@@ -192,7 +192,8 @@ export function SignUpForm() {
192
192
  mobileNumber: mobileNumberParser.format(mobileNumber),
193
193
  verificationCode: verificationCode.join(''),
194
194
  referralCode: search.get('referralCode') ?? undefined,
195
- domain: search.get('domain') ?? undefined,
195
+ domain: search.get('domain') ??
196
+ new URL(window.location.href).hostname,
196
197
  btag: search.get('btag') ?? undefined,
197
198
  });
198
199
  const name = mobileNumberParser.format(mobileNumber);
@@ -3,4 +3,3 @@ export declare const PLATFORM_ID: string;
3
3
  export declare const PLATFORM_CODE: string;
4
4
  export declare const ENVIRONMENT: "production" | "development";
5
5
  export declare const BYPASS_RECAPTCHA: boolean;
6
- export declare const DOMAIN: string;
@@ -23,8 +23,3 @@ export const BYPASS_RECAPTCHA = z
23
23
  .transform(Boolean)
24
24
  .catch(false)
25
25
  .parse(process.env.NEXT_PUBLIC_BYPASS_RECAPTCHA);
26
- export const DOMAIN = z
27
- .string()
28
- .url()
29
- .catch('http://localhost:80')
30
- .parse(process.env.NEXT_PUBLIC_DOMAIN);
@@ -1,2 +1,3 @@
1
1
  export declare const ACCESS_TOKEN_COOKIE_NAME: string;
2
2
  export declare const REFRESH_TOKEN_COOKIE_NAME: string;
3
+ export declare const KYC_PROMPT_LOCALSTORAGE_KEY: string;
@@ -1,2 +1,3 @@
1
1
  export const ACCESS_TOKEN_COOKIE_NAME = 'WebPortalAuthAccessToken';
2
2
  export const REFRESH_TOKEN_COOKIE_NAME = 'WebPortalAuthRefreshToken';
3
+ export const KYC_PROMPT_LOCALSTORAGE_KEY = 'WebPortalKYCPrompted';
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { BYPASS_RECAPTCHA, DOMAIN, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
2
+ import { BYPASS_RECAPTCHA, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
3
3
  export async function graphqlRequest(url, query, variables, options) {
4
4
  const headers = new Headers();
5
5
  headers.set('Role', 'MEMBER');
@@ -9,7 +9,6 @@ export async function graphqlRequest(url, query, variables, options) {
9
9
  headers.set('Environment', ENVIRONMENT);
10
10
  headers.set('Accept', 'application/json');
11
11
  headers.set('Content-Type', 'application/json');
12
- headers.set('Domain', DOMAIN);
13
12
  new Headers(options?.headers).forEach((value, key) => {
14
13
  headers.set(key, value);
15
14
  });
@@ -114,7 +113,6 @@ export async function graphqlUpload(url, query, variables, options) {
114
113
  headers.set('Platform-ID', PLATFORM_ID);
115
114
  headers.set('Platform-Code', PLATFORM_CODE);
116
115
  headers.set('Environment', ENVIRONMENT);
117
- headers.set('Domain', DOMAIN);
118
116
  headers.delete('Content-Type');
119
117
  if (BYPASS_RECAPTCHA) {
120
118
  headers.set(TEST_PASS_HEADER_KEY, '');
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BYPASS_RECAPTCHA, DOMAIN, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
2
+ import { BYPASS_RECAPTCHA, ENVIRONMENT, PLATFORM_CODE, PLATFORM_ID, RECAPTCHA_HEADER_KEY, SITE_ID, TEST_PASS_HEADER_KEY, } from '../constants/index.js';
3
3
  export async function httpRequest(url, opts = {}) {
4
4
  const headers = new Headers(opts.headers);
5
5
  headers.set('Role', 'MEMBER');
@@ -7,7 +7,6 @@ export async function httpRequest(url, opts = {}) {
7
7
  headers.set('Platform-ID', PLATFORM_ID);
8
8
  headers.set('Platform-Code', PLATFORM_CODE);
9
9
  headers.set('Environment', ENVIRONMENT);
10
- headers.set('Domain', DOMAIN);
11
10
  new Headers(opts.headers).forEach((value, key) => {
12
11
  headers.set(key, value);
13
12
  });
@@ -45,7 +44,6 @@ httpRequest.json = async (url, opts = {}) => {
45
44
  headers.set('Platform-Code', PLATFORM_CODE);
46
45
  headers.set('Accept', 'application/json');
47
46
  headers.set('Content-Type', 'application/json');
48
- headers.set('Domain', DOMAIN);
49
47
  new Headers(opts.headers).forEach((value, key) => {
50
48
  headers.set(key, value);
51
49
  });
@@ -82,7 +82,7 @@ export declare const PLATFORM = "\n query Platform {\n timezone\n currenc
82
82
  export declare const PAYMENT_SETTINGS = "\n fragment DepositGatewaySettingsCoreData on DepositGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n bankAccountName\n bankAccountNumber\n bankIFSCCode\n upiId\n upiQRCode {\n id\n url\n }\n }\n\n fragment WithdrawalGatewaySettingsCoreData on WithdrawalGatewaySettings {\n minimumAmount\n maximumAmount\n webEnabled\n mobileWebEnabled\n androidEnabled\n iosEnabled\n }\n\n query PaymentSettings {\n minimumFirstDepositAmount\n restrictWithdrawalsToVerifiedMembers\n bankDepositGatewaySettings: depositGatewaySettings(gateway: BANK) {\n ...DepositGatewaySettingsCoreData\n }\n gcashDepositGatewaySettings: depositGatewaySettings(gateway: GCASH) {\n ...DepositGatewaySettingsCoreData\n }\n mayaDepositGatewaySettings: depositGatewaySettings(gateway: MAYA) {\n ...DepositGatewaySettingsCoreData\n }\n mayaAppDepositGatewaySettings: depositGatewaySettings(gateway: MAYA_APP) {\n ...DepositGatewaySettingsCoreData\n }\n onlineBankDepositGatewaySettings: depositGatewaySettings(\n gateway: ONLINE_BANK\n ) {\n ...DepositGatewaySettingsCoreData\n }\n qrphDepositGatewaySettings: depositGatewaySettings(gateway: QR_PH) {\n ...DepositGatewaySettingsCoreData\n }\n manualBankDepositGatewaySettings: depositGatewaySettings(\n gateway: MANUAL_BANK\n ) {\n ...DepositGatewaySettingsCoreData\n }\n manualUPIDepositGatewaySettings: depositGatewaySettings(\n gateway: MANUAL_UPI\n ) {\n ...DepositGatewaySettingsCoreData\n }\n bankWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: BANK) {\n ...WithdrawalGatewaySettingsCoreData\n }\n gcashWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: GCASH) {\n ...WithdrawalGatewaySettingsCoreData\n }\n mayaWithdrawalGatewaySettings: withdrawalGatewaySettings(gateway: MAYA) {\n ...WithdrawalGatewaySettingsCoreData\n }\n mayaAppWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: MAYA_APP\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n instapayWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: INSTAPAY\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualBankWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: MANUAL_BANK\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n manualUPIWithdrawalGatewaySettings: withdrawalGatewaySettings(\n gateway: MANUAL_UPI\n ) {\n ...WithdrawalGatewaySettingsCoreData\n }\n }\n";
83
83
  export declare const MAYA_SESSION = "\n query MayaSession($id: ObjectId!) {\n mayaSession(id: $id) {\n id\n member\n dateTimeCreated\n }\n }\n";
84
84
  export declare const VALIDATE_MAYA_SESSION = "\n mutation ValidateMayaSession {\n validateMayaSession: validMayaSession\n }\n";
85
- export declare const ACTIVITY_RECORDS = "\n query ActivityRecords(\n $after: Cursor\n $first: Int\n $filter: ActivityRecordsFilterInput\n ) {\n member {\n activityRecords(after: $after, first: $first, filter: $filter) {\n edges {\n cursor\n node {\n ... on MemberActivity {\n id\n type\n domain\n amount\n details\n dateTimeCreated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
85
+ export declare const ACTIVITY_RECORDS = "\n query ActivityRecords(\n $after: Cursor\n $first: Int\n $filter: ActivityRecordsFilterInput\n ) {\n member {\n activityRecords(after: $after, first: $first, filter: $filter) {\n edges {\n cursor\n node {\n ... on MemberActivity {\n id\n type\n amount\n details\n dateTimeCreated\n }\n }\n }\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n";
86
86
  export declare const REFERRAL_CODE = "\n query ReferralCode {\n referralCode\n }\n";
87
87
  export declare const UPDATE_REFERRAL_CODE = "\n mutation UpdateReferralCode($input: UpdateReferralCodeInput!) {\n updateReferralCode(input: $input) {\n ... on ReferralCodeNotAvailableError {\n name: __typename\n message\n }\n }\n }\n";
88
88
  export declare const REFERRAL_FRAGMENT = "\n fragment ReferralFragment on Referral {\n id\n upline {\n id\n name\n realName\n }\n downline {\n id\n name\n realName\n }\n level\n turnover\n commission\n dateTimeCreated\n }\n";
@@ -1812,7 +1812,6 @@ export const ACTIVITY_RECORDS = /* GraphQL */ `
1812
1812
  ... on MemberActivity {
1813
1813
  id
1814
1814
  type
1815
- domain
1816
1815
  amount
1817
1816
  details
1818
1817
  dateTimeCreated
@@ -606,7 +606,6 @@ export type ActivityRecordType = 'REGISTRATION' | 'LOGIN' | 'DEPOSIT' | 'WITHDRA
606
606
  export interface ActivityRecord {
607
607
  id: string;
608
608
  type: ActivityRecordType;
609
- domain?: string | null;
610
609
  amount?: string | null;
611
610
  details: string;
612
611
  dateTimeCreated: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opexa/portal-components",
3
- "version": "0.0.163",
3
+ "version": "0.0.165",
4
4
  "exports": {
5
5
  "./ui/*": {
6
6
  "types": "./dist/ui/*/index.d.ts",