@opexa/portal-components 0.0.62 → 0.0.64
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.
- package/dist/client/hooks/index.d.ts +8 -2
- package/dist/client/hooks/index.js +8 -2
- package/dist/client/hooks/useBonusQuery.d.ts +3 -0
- package/dist/client/hooks/useBonusQuery.js +34 -0
- package/dist/client/hooks/useCashbackBonusQuery.d.ts +3 -0
- package/dist/client/hooks/useCashbackBonusQuery.js +34 -0
- package/dist/client/hooks/useCashbackBonusesQuery.d.ts +3 -0
- package/dist/client/hooks/useCashbackBonusesQuery.js +32 -0
- package/dist/client/hooks/useCashbackQuery.d.ts +3 -0
- package/dist/client/hooks/useCashbackQuery.js +20 -0
- package/dist/client/hooks/useClaimCashbackBonusMutation.d.ts +2 -0
- package/dist/client/hooks/useClaimCashbackBonusMutation.js +28 -0
- package/dist/client/hooks/useClaimSpotBonusMutation.d.ts +2 -0
- package/dist/client/hooks/useClaimSpotBonusMutation.js +28 -0
- package/dist/client/utils/createContext.d.ts +9 -0
- package/dist/client/utils/createContext.js +14 -0
- package/dist/client/utils/index.d.ts +1 -0
- package/dist/client/utils/index.js +1 -0
- package/dist/components/Bonuses/Bonuses.client.d.ts +2 -0
- package/dist/components/Bonuses/Bonuses.client.js +87 -0
- package/dist/components/Bonuses/Bonuses.d.ts +3 -3
- package/dist/components/Bonuses/Bonuses.js +6 -14
- package/dist/components/Bonuses/money-on-hand.png +0 -0
- package/dist/components/Bonuses/piggy-bank.png +0 -0
- package/dist/components/Cashback/Cashback.client.d.ts +1 -1
- package/dist/components/Cashback/Cashback.client.js +21 -3
- package/dist/components/Cashback/Cashback.d.ts +2 -5
- package/dist/components/Cashback/Cashback.js +11 -1
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +2 -0
- package/dist/components/CashbackBonus/CashbackBonus.client.js +9 -0
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +10 -0
- package/dist/components/CashbackBonus/CashbackBonus.js +5 -0
- package/dist/components/CashbackBonus/index.d.ts +1 -0
- package/dist/components/CashbackBonus/index.js +1 -0
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +1 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.js +2 -8
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +1 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.js +2 -8
- package/dist/components/Empty.d.ts +1 -0
- package/dist/components/Empty.js +1 -1
- package/dist/components/Games/GameContext.d.ts +1 -2
- package/dist/components/Games/GameContext.js +2 -8
- package/dist/components/KYC/KYCContext.d.ts +1 -2
- package/dist/components/KYC/KYCContext.js +2 -8
- package/dist/components/Messages/MessageItem.js +3 -2
- package/dist/components/Messages/MessagePopup.js +1 -0
- package/dist/components/Messages/MessageTrigger.d.ts +8 -0
- package/dist/components/Messages/MessageTrigger.js +18 -0
- package/dist/components/Messages/index.d.ts +2 -0
- package/dist/components/Messages/index.js +2 -0
- package/dist/components/PortalProvider/WebVitals.js +2 -2
- package/dist/components/Promo/Promo.client.d.ts +1 -1
- package/dist/components/Promo/Promo.client.js +3 -3
- package/dist/components/Promos/Cashback.d.ts +7 -0
- package/dist/components/Promos/Cashback.js +17 -0
- package/dist/components/Promos/Promo.d.ts +7 -0
- package/dist/components/Promos/Promo.js +17 -0
- package/dist/components/Promos/Promos.d.ts +4 -0
- package/dist/components/Promos/Promos.js +6 -6
- package/dist/components/Promos/PromosCarousel.d.ts +2 -0
- package/dist/components/Promos/{PromoCarousel.js → PromosCarousel.js} +9 -5
- package/dist/components/Promos/PromosGrid.d.ts +2 -0
- package/dist/components/Promos/PromosGrid.js +16 -0
- package/dist/components/SignIn/MobileNumberSignIn.js +5 -1
- package/dist/components/SignIn/NameAndPasswordSignIn.js +83 -20
- package/dist/components/SignIn/SignIn.js +6 -3
- package/dist/components/SignIn/SignInContext.d.ts +2 -12
- package/dist/components/SignIn/SignInContext.js +2 -18
- package/dist/components/SignIn/SignInForm.js +3 -3
- package/dist/components/SignIn/useSignIn.d.ts +10 -0
- package/dist/components/SignIn/useSignIn.js +11 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +2 -1
- package/dist/constants/index.d.ts +4 -2
- package/dist/constants/index.js +24 -0
- package/dist/server/utils/index.d.ts +4 -0
- package/dist/server/utils/index.js +4 -0
- package/dist/server/utils/prefetchBonusQuery.d.ts +1 -0
- package/dist/server/utils/prefetchBonusQuery.js +22 -0
- package/dist/server/utils/prefetchCashbackBonusQuery.d.ts +1 -0
- package/dist/server/utils/prefetchCashbackBonusQuery.js +22 -0
- package/dist/server/utils/prefetchCashbackBonusesQuery.d.ts +1 -0
- package/dist/server/utils/prefetchCashbackBonusesQuery.js +22 -0
- package/dist/server/utils/prefetchCashbackQuery.d.ts +1 -0
- package/dist/server/utils/prefetchCashbackQuery.js +17 -0
- package/dist/ui/Badge/Badge.d.ts +12 -0
- package/dist/ui/Badge/badge.recipe.d.ts +3 -0
- package/dist/ui/Badge/badge.recipe.js +11 -0
- package/dist/ui/Progress/progress.recipe.js +1 -1
- package/dist/utils/queryKeys.d.ts +6 -0
- package/dist/utils/queryKeys.js +18 -0
- package/package.json +3 -3
- package/dist/components/AccountPaymentMethods/AccountPaymentMethods.d.ts +0 -1
- package/dist/components/AccountPaymentMethods/AccountPaymentMethods.js +0 -3
- package/dist/components/AccountPaymentMethods/index.d.ts +0 -1
- package/dist/components/AccountPaymentMethods/index.js +0 -1
- package/dist/components/AccountVerification/AccountVerificationContext.d.ts +0 -14
- package/dist/components/AccountVerification/AccountVerificationContext.js +0 -27
- package/dist/components/AccountVerification/VerificationCapture.d.ts +0 -1
- package/dist/components/AccountVerification/VerificationCapture.js +0 -28
- package/dist/components/AccountVerification/VerificationComplete.d.ts +0 -1
- package/dist/components/AccountVerification/VerificationComplete.js +0 -9
- package/dist/components/AccountVerification/VerificationDetails.d.ts +0 -1
- package/dist/components/AccountVerification/VerificationDetails.js +0 -38
- package/dist/components/GamesSearch/GamesSearchTrigger.d.ts +0 -5
- package/dist/components/GamesSearch/GamesSearchTrigger.js +0 -14
- package/dist/components/KYC/AccountVerificationContext.d.ts +0 -14
- package/dist/components/KYC/AccountVerificationContext.js +0 -27
- package/dist/components/KYC/VerificationCapture.d.ts +0 -1
- package/dist/components/KYC/VerificationCapture.js +0 -28
- package/dist/components/KYC/VerificationComplete.d.ts +0 -1
- package/dist/components/KYC/VerificationComplete.js +0 -9
- package/dist/components/KYC/VerificationDetails.d.ts +0 -1
- package/dist/components/KYC/VerificationDetails.js +0 -38
- package/dist/components/Promo/PromoContent.d.ts +0 -2
- package/dist/components/Promo/PromoContent.js +0 -9
- package/dist/components/Promos/PromoCarousel.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -11
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -17
- package/dist/components/Rewards/Rewards.client.d.ts +0 -2
- package/dist/components/Rewards/Rewards.client.js +0 -25
- package/dist/components/Rewards/Rewards.d.ts +0 -15
- package/dist/components/Rewards/Rewards.js +0 -7
- package/dist/components/Rewards/index.d.ts +0 -1
- package/dist/components/Rewards/index.js +0 -1
|
@@ -5,7 +5,9 @@ export * from './AccountVerification';
|
|
|
5
5
|
export * from './Banner';
|
|
6
6
|
export * from './BetRecords';
|
|
7
7
|
export * from './Bonus';
|
|
8
|
+
export * from './Bonuses';
|
|
8
9
|
export * from './Cashback';
|
|
10
|
+
export * from './CashbackBonus';
|
|
9
11
|
export * from './DepositWithdrawal';
|
|
10
12
|
export * from './Disclaimer';
|
|
11
13
|
export * from './FavoriteGames';
|
|
@@ -23,7 +25,6 @@ export * from './Promo';
|
|
|
23
25
|
export * from './Promos';
|
|
24
26
|
export * from './Protected';
|
|
25
27
|
export * from './Quests';
|
|
26
|
-
export * from './Rewards';
|
|
27
28
|
export * from './Search';
|
|
28
29
|
export * from './SignIn';
|
|
29
30
|
export * from './SignUp';
|
package/dist/components/index.js
CHANGED
|
@@ -5,7 +5,9 @@ export * from './AccountVerification/index.js';
|
|
|
5
5
|
export * from './Banner/index.js';
|
|
6
6
|
export * from './BetRecords/index.js';
|
|
7
7
|
export * from './Bonus/index.js';
|
|
8
|
+
export * from './Bonuses/index.js';
|
|
8
9
|
export * from './Cashback/index.js';
|
|
10
|
+
export * from './CashbackBonus/index.js';
|
|
9
11
|
export * from './DepositWithdrawal/index.js';
|
|
10
12
|
export * from './Disclaimer/index.js';
|
|
11
13
|
export * from './FavoriteGames/index.js';
|
|
@@ -23,7 +25,6 @@ export * from './Promo/index.js';
|
|
|
23
25
|
export * from './Promos/index.js';
|
|
24
26
|
export * from './Protected/index.js';
|
|
25
27
|
export * from './Quests/index.js';
|
|
26
|
-
export * from './Rewards/index.js';
|
|
27
28
|
export * from './Search/index.js';
|
|
28
29
|
export * from './SignIn/index.js';
|
|
29
30
|
export * from './SignUp/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecretQuestion } from '@opexa/portal-sdk-core';
|
|
2
2
|
export declare const SITE_ID: string;
|
|
3
3
|
export declare const PLATFORM_ID: string;
|
|
4
4
|
export declare const PLATFORM_CODE: string;
|
|
@@ -6,5 +6,7 @@ export declare const ENVIRONMENT: "production" | "development";
|
|
|
6
6
|
export declare const BYPASS_RECAPTCHA: boolean;
|
|
7
7
|
export declare const ACCESS_TOKEN_COOKIE_NAME: string;
|
|
8
8
|
export declare const REFRESH_TOKEN_COOKIE_NAME: string;
|
|
9
|
-
export declare const LEGACY_GAME_PROVIDERS:
|
|
9
|
+
export declare const LEGACY_GAME_PROVIDERS: ["JILI", "PGSOFT", "FACHAI", "BTI", "DG", "PLAYTECH", "E2E", "ONEAPI_EVOLUTION", "CQ9", "JDB", "HABANERO", "SPINIX", "JOKER", "HACKSAW", "EVOLUTIONNETENT", "JDBGTF", "JDBSPRIBE", "MICROGAMING", "RELAXGAMING", "EVOPLAY", "BOOONGO", "BGAMING", "KINGMAKER", "KINGMIDAS", "YELLOWBAT", "ETENGJUE", "SABA", "PRAGMATICPLAY", "SPRIBE", "EZUGI", "ALIZE"];
|
|
10
10
|
export declare const RECAPTCHA_HEADER_KEY: string;
|
|
11
|
+
export declare const SECRET_QUESTIONS: ["BEST_CHILDHOOD_FRIEND", "BIRTH_PLACE", "FAVORITE_BOOK", "FAVORITE_MOVIE", "FAVORITE_TEACHER", "FIRST_CAR", "FIRST_PET", "FIRST_SCHOOL", "MOTHERS_MAIDEN_NAME", "PARENTS_MET_CITY"];
|
|
12
|
+
export declare const SECRET_QUESTIONS_MAP: Record<SecretQuestion, string>;
|
package/dist/constants/index.js
CHANGED
|
@@ -62,3 +62,27 @@ export const LEGACY_GAME_PROVIDERS = [
|
|
|
62
62
|
'ALIZE',
|
|
63
63
|
];
|
|
64
64
|
export const RECAPTCHA_HEADER_KEY = 'Google-Recaptcha-Response';
|
|
65
|
+
export const SECRET_QUESTIONS = [
|
|
66
|
+
'BEST_CHILDHOOD_FRIEND',
|
|
67
|
+
'BIRTH_PLACE',
|
|
68
|
+
'FAVORITE_BOOK',
|
|
69
|
+
'FAVORITE_MOVIE',
|
|
70
|
+
'FAVORITE_TEACHER',
|
|
71
|
+
'FIRST_CAR',
|
|
72
|
+
'FIRST_PET',
|
|
73
|
+
'FIRST_SCHOOL',
|
|
74
|
+
'MOTHERS_MAIDEN_NAME',
|
|
75
|
+
'PARENTS_MET_CITY',
|
|
76
|
+
];
|
|
77
|
+
export const SECRET_QUESTIONS_MAP = {
|
|
78
|
+
BEST_CHILDHOOD_FRIEND: 'What was the name of your best childhood friend?',
|
|
79
|
+
BIRTH_PLACE: 'What city were you born in?',
|
|
80
|
+
FAVORITE_BOOK: 'What is your favorite book?',
|
|
81
|
+
FAVORITE_MOVIE: 'What is your favorite movie?',
|
|
82
|
+
FAVORITE_TEACHER: 'Who was your favorite teacher in school?',
|
|
83
|
+
FIRST_CAR: 'What was the make and model of your first car?',
|
|
84
|
+
FIRST_PET: 'What was the name of your first pet?',
|
|
85
|
+
FIRST_SCHOOL: 'What was the name of your first school?',
|
|
86
|
+
MOTHERS_MAIDEN_NAME: "What is your mother's maiden name?",
|
|
87
|
+
PARENTS_MET_CITY: 'In what city did your parents meet?',
|
|
88
|
+
};
|
|
@@ -3,6 +3,10 @@ export * from './prefetchAvailablePromosQuery';
|
|
|
3
3
|
export * from './prefetchAvailableQuestsQuery';
|
|
4
4
|
export * from './prefetchBetRecordsQuery';
|
|
5
5
|
export * from './prefetchBonusesQuery';
|
|
6
|
+
export * from './prefetchBonusQuery';
|
|
7
|
+
export * from './prefetchCashbackBonusesQuery';
|
|
8
|
+
export * from './prefetchCashbackBonusQuery';
|
|
9
|
+
export * from './prefetchCashbackQuery';
|
|
6
10
|
export * from './prefetchCashbacksQuery';
|
|
7
11
|
export * from './prefetchDepositQuery';
|
|
8
12
|
export * from './prefetchDepositRecordsQuery';
|
|
@@ -3,6 +3,10 @@ export * from './prefetchAvailablePromosQuery.js';
|
|
|
3
3
|
export * from './prefetchAvailableQuestsQuery.js';
|
|
4
4
|
export * from './prefetchBetRecordsQuery.js';
|
|
5
5
|
export * from './prefetchBonusesQuery.js';
|
|
6
|
+
export * from './prefetchBonusQuery.js';
|
|
7
|
+
export * from './prefetchCashbackBonusesQuery.js';
|
|
8
|
+
export * from './prefetchCashbackBonusQuery.js';
|
|
9
|
+
export * from './prefetchCashbackQuery.js';
|
|
6
10
|
export * from './prefetchCashbacksQuery.js';
|
|
7
11
|
export * from './prefetchDepositQuery.js';
|
|
8
12
|
export * from './prefetchDepositRecordsQuery.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prefetchBonusQuery: (id: string) => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getBonus } from '@opexa/portal-sdk-core';
|
|
2
|
+
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
3
|
+
import { getBonusQueryKey, getQueryClient } from '../../utils/index.js';
|
|
4
|
+
import { getSession } from '../services/getSession.js';
|
|
5
|
+
export const prefetchBonusQuery = async (id) => {
|
|
6
|
+
const session = await getSession();
|
|
7
|
+
if (session.status === 'unauthenticated')
|
|
8
|
+
return;
|
|
9
|
+
await getQueryClient().prefetchQuery({
|
|
10
|
+
queryKey: getBonusQueryKey(id),
|
|
11
|
+
queryFn: async ({ signal }) => {
|
|
12
|
+
return await getBonus(id, {
|
|
13
|
+
signal,
|
|
14
|
+
environment: ENVIRONMENT,
|
|
15
|
+
headers: {
|
|
16
|
+
'Platform-Code': PLATFORM_CODE,
|
|
17
|
+
Authorization: `Bearer ${session.token}`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prefetchCashbackBonusQuery: (id: string) => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getCashbackBonus } from '@opexa/portal-sdk-core';
|
|
2
|
+
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
3
|
+
import { getCashbackBonusQueryKey, getQueryClient } from '../../utils/index.js';
|
|
4
|
+
import { getSession } from '../services/getSession.js';
|
|
5
|
+
export const prefetchCashbackBonusQuery = async (id) => {
|
|
6
|
+
const session = await getSession();
|
|
7
|
+
if (session.status === 'unauthenticated')
|
|
8
|
+
return;
|
|
9
|
+
await getQueryClient().prefetchQuery({
|
|
10
|
+
queryKey: getCashbackBonusQueryKey(id),
|
|
11
|
+
queryFn: async ({ signal }) => {
|
|
12
|
+
return await getCashbackBonus(id, {
|
|
13
|
+
signal,
|
|
14
|
+
environment: ENVIRONMENT,
|
|
15
|
+
headers: {
|
|
16
|
+
'Platform-Code': PLATFORM_CODE,
|
|
17
|
+
Authorization: `Bearer ${session.token}`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prefetchCashbackBonusesQuery: () => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getCashbackBonuses } from '@opexa/portal-sdk-core';
|
|
2
|
+
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
3
|
+
import { getCashbackBonusesQueryKey, getQueryClient } from '../../utils/index.js';
|
|
4
|
+
import { getSession } from '../services/index.js';
|
|
5
|
+
export const prefetchCashbackBonusesQuery = async () => {
|
|
6
|
+
const session = await getSession();
|
|
7
|
+
if (session.status === 'unauthenticated')
|
|
8
|
+
return;
|
|
9
|
+
await getQueryClient().prefetchQuery({
|
|
10
|
+
queryKey: getCashbackBonusesQueryKey(),
|
|
11
|
+
queryFn: async ({ signal }) => {
|
|
12
|
+
return await getCashbackBonuses({
|
|
13
|
+
signal,
|
|
14
|
+
environment: ENVIRONMENT,
|
|
15
|
+
headers: {
|
|
16
|
+
'Platform-Code': PLATFORM_CODE,
|
|
17
|
+
Authorization: `Bearer ${session.token}`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prefetchCashbackQuery: (id: string) => Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getCashback } from '@opexa/portal-sdk-core';
|
|
2
|
+
import { ENVIRONMENT, PLATFORM_CODE } from '../../constants/index.js';
|
|
3
|
+
import { getCashbackQueryKey, getQueryClient } from '../../utils/index.js';
|
|
4
|
+
export const prefetchCashbackQuery = async (id) => {
|
|
5
|
+
await getQueryClient().prefetchQuery({
|
|
6
|
+
queryKey: getCashbackQueryKey(id),
|
|
7
|
+
queryFn: async ({ signal }) => {
|
|
8
|
+
return await getCashback(id, {
|
|
9
|
+
signal,
|
|
10
|
+
environment: ENVIRONMENT,
|
|
11
|
+
headers: {
|
|
12
|
+
'Platform-Code': PLATFORM_CODE,
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
};
|
package/dist/ui/Badge/Badge.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
21
21
|
subtle: {};
|
|
22
22
|
};
|
|
23
23
|
colorScheme: {
|
|
24
|
+
gray: {};
|
|
24
25
|
brand: {};
|
|
25
26
|
danger: {};
|
|
26
27
|
success: {};
|
|
@@ -54,6 +55,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
54
55
|
subtle: {};
|
|
55
56
|
};
|
|
56
57
|
colorScheme: {
|
|
58
|
+
gray: {};
|
|
57
59
|
brand: {};
|
|
58
60
|
danger: {};
|
|
59
61
|
success: {};
|
|
@@ -87,6 +89,7 @@ export declare const Root: import("react").ComponentType<import("@ark-ui/react")
|
|
|
87
89
|
subtle: {};
|
|
88
90
|
};
|
|
89
91
|
colorScheme: {
|
|
92
|
+
gray: {};
|
|
90
93
|
brand: {};
|
|
91
94
|
danger: {};
|
|
92
95
|
success: {};
|
|
@@ -124,6 +127,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
124
127
|
subtle: {};
|
|
125
128
|
};
|
|
126
129
|
colorScheme: {
|
|
130
|
+
gray: {};
|
|
127
131
|
brand: {};
|
|
128
132
|
danger: {};
|
|
129
133
|
success: {};
|
|
@@ -157,6 +161,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
157
161
|
subtle: {};
|
|
158
162
|
};
|
|
159
163
|
colorScheme: {
|
|
164
|
+
gray: {};
|
|
160
165
|
brand: {};
|
|
161
166
|
danger: {};
|
|
162
167
|
success: {};
|
|
@@ -190,6 +195,7 @@ export declare const Label: import("react").ComponentType<import("@ark-ui/react"
|
|
|
190
195
|
subtle: {};
|
|
191
196
|
};
|
|
192
197
|
colorScheme: {
|
|
198
|
+
gray: {};
|
|
193
199
|
brand: {};
|
|
194
200
|
danger: {};
|
|
195
201
|
success: {};
|
|
@@ -227,6 +233,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
227
233
|
subtle: {};
|
|
228
234
|
};
|
|
229
235
|
colorScheme: {
|
|
236
|
+
gray: {};
|
|
230
237
|
brand: {};
|
|
231
238
|
danger: {};
|
|
232
239
|
success: {};
|
|
@@ -260,6 +267,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
260
267
|
subtle: {};
|
|
261
268
|
};
|
|
262
269
|
colorScheme: {
|
|
270
|
+
gray: {};
|
|
263
271
|
brand: {};
|
|
264
272
|
danger: {};
|
|
265
273
|
success: {};
|
|
@@ -293,6 +301,7 @@ export declare const Indicator: import("react").ComponentType<import("@ark-ui/re
|
|
|
293
301
|
subtle: {};
|
|
294
302
|
};
|
|
295
303
|
colorScheme: {
|
|
304
|
+
gray: {};
|
|
296
305
|
brand: {};
|
|
297
306
|
danger: {};
|
|
298
307
|
success: {};
|
|
@@ -330,6 +339,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
330
339
|
subtle: {};
|
|
331
340
|
};
|
|
332
341
|
colorScheme: {
|
|
342
|
+
gray: {};
|
|
333
343
|
brand: {};
|
|
334
344
|
danger: {};
|
|
335
345
|
success: {};
|
|
@@ -363,6 +373,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
363
373
|
subtle: {};
|
|
364
374
|
};
|
|
365
375
|
colorScheme: {
|
|
376
|
+
gray: {};
|
|
366
377
|
brand: {};
|
|
367
378
|
danger: {};
|
|
368
379
|
success: {};
|
|
@@ -396,6 +407,7 @@ export declare const Icon: import("react").ComponentType<import("@ark-ui/react")
|
|
|
396
407
|
subtle: {};
|
|
397
408
|
};
|
|
398
409
|
colorScheme: {
|
|
410
|
+
gray: {};
|
|
399
411
|
brand: {};
|
|
400
412
|
danger: {};
|
|
401
413
|
success: {};
|
|
@@ -17,6 +17,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
17
17
|
subtle: {};
|
|
18
18
|
};
|
|
19
19
|
colorScheme: {
|
|
20
|
+
gray: {};
|
|
20
21
|
brand: {};
|
|
21
22
|
danger: {};
|
|
22
23
|
success: {};
|
|
@@ -50,6 +51,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
50
51
|
subtle: {};
|
|
51
52
|
};
|
|
52
53
|
colorScheme: {
|
|
54
|
+
gray: {};
|
|
53
55
|
brand: {};
|
|
54
56
|
danger: {};
|
|
55
57
|
success: {};
|
|
@@ -83,6 +85,7 @@ export declare const badgeRecipe: import("tailwind-variants").TVReturnType<{
|
|
|
83
85
|
subtle: {};
|
|
84
86
|
};
|
|
85
87
|
colorScheme: {
|
|
88
|
+
gray: {};
|
|
86
89
|
brand: {};
|
|
87
90
|
danger: {};
|
|
88
91
|
success: {};
|
|
@@ -27,6 +27,7 @@ export const badgeRecipe = tv({
|
|
|
27
27
|
subtle: {},
|
|
28
28
|
},
|
|
29
29
|
colorScheme: {
|
|
30
|
+
gray: {},
|
|
30
31
|
brand: {},
|
|
31
32
|
danger: {},
|
|
32
33
|
success: {},
|
|
@@ -43,6 +44,16 @@ export const badgeRecipe = tv({
|
|
|
43
44
|
},
|
|
44
45
|
},
|
|
45
46
|
compoundVariants: [
|
|
47
|
+
{
|
|
48
|
+
variant: 'subtle',
|
|
49
|
+
colorScheme: 'gray',
|
|
50
|
+
className: {
|
|
51
|
+
root: 'bg-bg-primary border-border-primary border',
|
|
52
|
+
label: 'text-text-secondary-700',
|
|
53
|
+
indicator: 'bg-text-quarterary-500',
|
|
54
|
+
icon: 'text-text-quarterary-500',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
46
57
|
{
|
|
47
58
|
variant: 'subtle',
|
|
48
59
|
colorScheme: 'brand',
|
|
@@ -11,7 +11,7 @@ export const progressRecipe = tv({
|
|
|
11
11
|
unstyled: {},
|
|
12
12
|
solid: {
|
|
13
13
|
root: 'block w-full',
|
|
14
|
-
track: 'bg-bg-primary
|
|
14
|
+
track: 'bg-bg-primary w-full overflow-hidden rounded-full',
|
|
15
15
|
range: 'bg-brand-400 h-full rounded-full transition-all duration-200 ease-in-out',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
@@ -7,6 +7,7 @@ export declare const getAvailablePromosQueryKey: (input?: AvailablePromosInput)
|
|
|
7
7
|
export declare const getAvailableQuestsQueryKey: () => QueryKey;
|
|
8
8
|
export declare const getBetRecordsQueryKey: (input?: BetRecordsInput) => QueryKey;
|
|
9
9
|
export declare const getCashbacksQueryKey: () => QueryKey;
|
|
10
|
+
export declare const getCashbackBonusesQueryKey: () => QueryKey;
|
|
10
11
|
export declare const getCreateGameSessionMutationKey: () => MutationKey;
|
|
11
12
|
export declare const getCreateGCashDepositMutationKey: () => MutationKey;
|
|
12
13
|
export declare const getCreateMayaAppDepositMutationKey: () => MutationKey;
|
|
@@ -27,6 +28,7 @@ export declare const getMemberVerificationQueryKey: () => QueryKey;
|
|
|
27
28
|
export declare const getPaymentSettingsQueryKey: () => QueryKey;
|
|
28
29
|
export declare const getPlatformQueryKey: () => QueryKey;
|
|
29
30
|
export declare const getPromoQueryKey: (id: string) => QueryKey;
|
|
31
|
+
export declare const getCashbackQueryKey: (id: string) => QueryKey;
|
|
30
32
|
export declare const getPromosQueryKey: () => QueryKey;
|
|
31
33
|
export declare const getSendVerificationCodeMutationKey: () => MutationKey;
|
|
32
34
|
export declare const getSessionQueryKey: () => QueryKey;
|
|
@@ -46,7 +48,11 @@ export declare const getCreateInstapayWithdrawalMutationKey: () => MutationKey;
|
|
|
46
48
|
export declare const getMarkMessageAsReadMutationKey: () => MutationKey;
|
|
47
49
|
export declare const getCheckInDailyQuestMutationKey: () => MutationKey;
|
|
48
50
|
export declare const getUnreadMessagesCountQueryKey: (input?: UnreadMessagesCountInput) => QueryKey;
|
|
51
|
+
export declare const getBonusQueryKey: (id: string) => QueryKey;
|
|
52
|
+
export declare const getCashbackBonusQueryKey: (id: string) => QueryKey;
|
|
49
53
|
export declare const getBonusesQueryKey: () => QueryKey;
|
|
50
54
|
export declare const getMarkGameAsFavoriteMutationKey: () => MutationKey;
|
|
51
55
|
export declare const getUnmarkGameAsFavoriteMutationKey: () => MutationKey;
|
|
52
56
|
export declare const getUpdateAccountMutationKey: () => MutationKey;
|
|
57
|
+
export declare const getClaimCashbackBonusMutationKey: () => MutationKey;
|
|
58
|
+
export declare const getClaimSpotBonusMutationKey: () => MutationKey;
|
package/dist/utils/queryKeys.js
CHANGED
|
@@ -14,6 +14,9 @@ export const getBetRecordsQueryKey = (input) => [
|
|
|
14
14
|
input,
|
|
15
15
|
];
|
|
16
16
|
export const getCashbacksQueryKey = () => ['queries/cashbacks'];
|
|
17
|
+
export const getCashbackBonusesQueryKey = () => [
|
|
18
|
+
'queries/cashbackBonuses',
|
|
19
|
+
];
|
|
17
20
|
export const getCreateGameSessionMutationKey = () => [
|
|
18
21
|
'mutations/createGameSession',
|
|
19
22
|
];
|
|
@@ -69,6 +72,10 @@ export const getPaymentSettingsQueryKey = () => [
|
|
|
69
72
|
];
|
|
70
73
|
export const getPlatformQueryKey = () => ['queries/platform'];
|
|
71
74
|
export const getPromoQueryKey = (id) => ['queries/promo', id];
|
|
75
|
+
export const getCashbackQueryKey = (id) => [
|
|
76
|
+
'queries/cashback',
|
|
77
|
+
id,
|
|
78
|
+
];
|
|
72
79
|
export const getPromosQueryKey = () => ['queries/promos'];
|
|
73
80
|
export const getSendVerificationCodeMutationKey = () => [
|
|
74
81
|
'mutations/sendVerificationCode',
|
|
@@ -108,6 +115,11 @@ export const getCheckInDailyQuestMutationKey = () => [
|
|
|
108
115
|
'mutations/checkInDailyQuest',
|
|
109
116
|
];
|
|
110
117
|
export const getUnreadMessagesCountQueryKey = (input) => ['queries/unreadMessagesCount', input];
|
|
118
|
+
export const getBonusQueryKey = (id) => ['queries/bonus', id];
|
|
119
|
+
export const getCashbackBonusQueryKey = (id) => [
|
|
120
|
+
'queries/cashbackBonus',
|
|
121
|
+
id,
|
|
122
|
+
];
|
|
111
123
|
export const getBonusesQueryKey = () => ['queries/bonuses'];
|
|
112
124
|
export const getMarkGameAsFavoriteMutationKey = () => [
|
|
113
125
|
'mutations/markGameAsFavorite',
|
|
@@ -118,3 +130,9 @@ export const getUnmarkGameAsFavoriteMutationKey = () => [
|
|
|
118
130
|
export const getUpdateAccountMutationKey = () => [
|
|
119
131
|
'mutations/updateAccount',
|
|
120
132
|
];
|
|
133
|
+
export const getClaimCashbackBonusMutationKey = () => [
|
|
134
|
+
'mutations/claimCashbackBonus',
|
|
135
|
+
];
|
|
136
|
+
export const getClaimSpotBonusMutationKey = () => [
|
|
137
|
+
'mutations/claimSpotBonus',
|
|
138
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opexa/portal-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.64",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/components/index.d.ts",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@eslint/eslintrc": "3",
|
|
95
95
|
"@hookform/resolvers": "5.0.1",
|
|
96
|
-
"@opexa/portal-sdk-core": "0.0.
|
|
96
|
+
"@opexa/portal-sdk-core": "0.0.35",
|
|
97
97
|
"@tailwindcss/postcss": "4",
|
|
98
98
|
"@tanstack/react-query": "5.80.0",
|
|
99
99
|
"@tanstack/react-query-devtools": "5.80.0",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"@hookform/resolvers": "^4.0.0 || ^5.0.0",
|
|
120
|
-
"@opexa/portal-sdk-core": "^0.0.
|
|
120
|
+
"@opexa/portal-sdk-core": "^0.0.35",
|
|
121
121
|
"@tanstack/react-query": "^5.0.0",
|
|
122
122
|
"next": "^15.4.0-canary.1",
|
|
123
123
|
"react": "^19.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function AccountPaymentMethods(): null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AccountPaymentMethods';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './AccountPaymentMethods.js';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type Step = 1 | 2 | 3 | (number & {});
|
|
2
|
-
interface UseAccountVerificationReturn {
|
|
3
|
-
step: Step;
|
|
4
|
-
setStep: (step: Step) => void;
|
|
5
|
-
started: boolean;
|
|
6
|
-
setStarted: (started: boolean) => void;
|
|
7
|
-
completed: boolean;
|
|
8
|
-
setCompleted: (completed: boolean) => void;
|
|
9
|
-
reset: () => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function useAccountVerification(): UseAccountVerificationReturn;
|
|
12
|
-
export declare const AccountVerificationContext: import("react").Context<UseAccountVerificationReturn | null>;
|
|
13
|
-
export declare function useAccountVerificationContext(): UseAccountVerificationReturn;
|
|
14
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext, useState } from 'react';
|
|
2
|
-
import invariant from 'tiny-invariant';
|
|
3
|
-
export function useAccountVerification() {
|
|
4
|
-
const [step, setStep] = useState(1);
|
|
5
|
-
const [started, setStarted] = useState(false);
|
|
6
|
-
const [completed, setCompleted] = useState(false);
|
|
7
|
-
function reset() {
|
|
8
|
-
setStep(1);
|
|
9
|
-
setStarted(false);
|
|
10
|
-
setCompleted(false);
|
|
11
|
-
}
|
|
12
|
-
return {
|
|
13
|
-
step,
|
|
14
|
-
setStep,
|
|
15
|
-
started,
|
|
16
|
-
setStarted,
|
|
17
|
-
completed,
|
|
18
|
-
setCompleted,
|
|
19
|
-
reset,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export const AccountVerificationContext = createContext(null);
|
|
23
|
-
export function useAccountVerificationContext() {
|
|
24
|
-
const context = useContext(AccountVerificationContext);
|
|
25
|
-
invariant(context);
|
|
26
|
-
return context;
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function VerificationCapture(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { noop } from 'lodash-es';
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import { ArrowLeftIcon, CheckIcon, XIcon } from '../../icons/index.js';
|
|
5
|
-
import uploadId from '../../images/capture-id-banner.png';
|
|
6
|
-
import selfie from '../../images/capture-selfie-banner.png';
|
|
7
|
-
import { Button, Checkbox, Field, Progress } from '../../ui/index.js';
|
|
8
|
-
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
9
|
-
export function VerificationCapture() {
|
|
10
|
-
const context = useAccountVerificationContext();
|
|
11
|
-
if (!context.started)
|
|
12
|
-
return null;
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "grid grid-cols-4 items-center", children: [_jsxs("button", { className: "text-text-tertiary-600 flex gap-sm text-sm font-semibold", disabled: context.step <= 1, onClick: () => context.setStep(context.step - 1), children: [_jsx(ArrowLeftIcon, { className: "size-5" }), "Back"] }), _jsxs("div", { className: "col-span-2 flex justify-center gap-2", children: [_jsx(Progress.Root, { value: context.step >= 2 ? 100 : context.step >= 1 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) }), _jsx(Progress.Root, { value: context.completed ? 100 : context.step >= 3 ? 50 : 0, onValueChange: noop, className: "w-22.5 shrink-0", children: _jsx(Progress.Track, { children: _jsx(Progress.Range, {}) }) })] })] }), context.step === 1 && _jsx(Step1, {}), context.step === 2 && _jsx(Step2, {}), context.step === 3 && _jsx(Step3, {})] }));
|
|
14
|
-
}
|
|
15
|
-
function Step1() {
|
|
16
|
-
const context = useAccountVerificationContext();
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Prepare to upload your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: uploadId, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Upload front side of your ID"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "Don't edit image of your ID"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(2), children: "Continue" }) })] })] }));
|
|
18
|
-
}
|
|
19
|
-
function Step2() {
|
|
20
|
-
const context = useAccountVerificationContext();
|
|
21
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Take a selfie holding your ID" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsx(Image, { src: selfie, alt: "", className: "h-auto w-full", width: 600, height: 352 }), _jsxs("ul", { className: "mt-2xl space-y-3", children: [_jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Face and ID must be clearly visible"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(CheckIcon, { className: "text-text-featured-icon-light-success size-6" }), "Take a photo in a well lit room"] }), _jsxs("li", { className: "text-text-secondary-700 flex items-center gap-lg", children: [_jsx(XIcon, { className: "text-text-featured-icon-light-error size-6" }), "No hats, sunglasses, or masks"] })] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => context.setStep(3), children: "Continue" }) })] })] }));
|
|
22
|
-
}
|
|
23
|
-
function Step3() {
|
|
24
|
-
const context = useAccountVerificationContext();
|
|
25
|
-
return (_jsxs(_Fragment, { children: [_jsx("p", { className: "mt-2xl text-center text-2xl font-semibold", children: "Enter your basic and work-related information" }), _jsxs("div", { className: "border-border-secondary bg-bg-primary-alt shadow-xs mt-6 rounded-2xl border", children: [_jsxs("div", { className: "px-4 py-5", children: [_jsxs(Field.Root, { children: [_jsx(Field.Label, { children: "Permanent address" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Current address" }), _jsx(Field.Input, {})] }), _jsxs(Checkbox.Root, { className: "mt-sm", children: [_jsx(Checkbox.Control, { children: _jsx(Checkbox.Indicator, { asChild: true, children: _jsx(CheckIcon, {}) }) }), _jsx(Checkbox.Label, { children: "Same as permanent address" }), _jsx(Checkbox.HiddenInput, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Source of income" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nature of work" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Place of birth" }), _jsx(Field.Input, {})] }), _jsxs(Field.Root, { className: "mt-6", children: [_jsx(Field.Label, { children: "Nationality" }), _jsx(Field.Input, {})] })] }), _jsx("div", { className: "border-border-secondary border-t px-xl py-lg", children: _jsx(Button, { size: "sm", onClick: () => {
|
|
26
|
-
context.setCompleted(true);
|
|
27
|
-
}, children: "Continue" }) })] })] }));
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function VerificationComplete(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Portal } from '@ark-ui/react';
|
|
3
|
-
import { CheckCircleIcon } from '../../icons/index.js';
|
|
4
|
-
import { AlertDialog, Button } from '../../ui/index.js';
|
|
5
|
-
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
6
|
-
export function VerificationComplete() {
|
|
7
|
-
const context = useAccountVerificationContext();
|
|
8
|
-
return (_jsx(AlertDialog.Root, { open: context.completed, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, children: _jsxs(Portal, { children: [_jsx(AlertDialog.Backdrop, { className: "bg-bg-overlay/75 backdrop-blur-sm" }), _jsx(AlertDialog.Positioner, { children: _jsxs(AlertDialog.Content, { className: "mx-auto w-[21.438rem] p-xl", children: [_jsx("div", { className: "bg-bg-success-secondary text-text-featured-icon-light-success mx-auto flex size-12 items-center justify-center rounded-full", children: _jsx(CheckCircleIcon, {}) }), _jsx(AlertDialog.Title, { className: "mt-3 text-center", children: "Submission Successful" }), _jsx(AlertDialog.Description, { className: "text-text-tertiary-600 text-center", children: "Your documents have been submitted successfully. They\u2019re now under review, and you\u2019ll receive a notification as soon as your account is verified." }), _jsx(Button, { className: "mt-3xl", onClick: () => context.reset(), children: "Ok" })] }) })] }) }));
|
|
9
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function VerificationDetails(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ark } from '@ark-ui/react';
|
|
3
|
-
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { useMemberVerificationQuery, useProfileCompletionQuery, } from '../../client/hooks/index.js';
|
|
5
|
-
import { AlertCircleIcon, CheckVerified02Icon, CreditCard02Icon, FaceIdIcon, FileCheck02Icon, FileSearch02Icon, FileX02Icon, Globe05Icon, } from '../../icons/index.js';
|
|
6
|
-
import { Button } from '../../ui/index.js';
|
|
7
|
-
import { useAccountVerificationContext } from './AccountVerificationContext.js';
|
|
8
|
-
export function VerificationDetails() {
|
|
9
|
-
const context = useAccountVerificationContext();
|
|
10
|
-
const profileCompletionQuery = useProfileCompletionQuery();
|
|
11
|
-
const profileCompletion = profileCompletionQuery.data;
|
|
12
|
-
const verificationQuery = useMemberVerificationQuery();
|
|
13
|
-
const verification = verificationQuery.data;
|
|
14
|
-
const empty = verification == null;
|
|
15
|
-
const pending = verification?.status === 'PENDING';
|
|
16
|
-
const success = verification?.status === 'VERIFIED' || verification?.status === 'APPROVED';
|
|
17
|
-
const failed = verification?.status === 'REJECTED' ||
|
|
18
|
-
verification?.status === 'UNVERIFIED';
|
|
19
|
-
if (context.started)
|
|
20
|
-
return null;
|
|
21
|
-
return (_jsxs(_Fragment, { 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
|
|
22
|
-
? 'text-text-success-primary'
|
|
23
|
-
: '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: _jsx(Button, { size: "sm", onClick: () => {
|
|
24
|
-
context.setStarted(true);
|
|
25
|
-
}, className: "w-full lg:w-fit", children: "Verify Now" }) })] }), success && _jsx(VerificationSuccess, {}), pending && _jsx(VerificationInProgress, {}), failed && _jsx(VerificationFailed, {}), empty && _jsx(VerificationNotSubmitted, {})] }));
|
|
26
|
-
}
|
|
27
|
-
function VerificationNotSubmitted() {
|
|
28
|
-
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." })] }));
|
|
29
|
-
}
|
|
30
|
-
function VerificationInProgress() {
|
|
31
|
-
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(FileSearch02Icon, { className: "text-text-warning-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Under review" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs 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." })] })] }));
|
|
32
|
-
}
|
|
33
|
-
function VerificationSuccess() {
|
|
34
|
-
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-success-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-success-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileCheck02Icon, { className: "text-text-success-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification successful" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "Your account has been successfully verified. You now have full access to all features and improved account security." })] })] }));
|
|
35
|
-
}
|
|
36
|
-
function VerificationFailed() {
|
|
37
|
-
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-error-primary/10 flex size-[2.1875rem] items-center justify-center rounded-full border-2", children: _jsx("div", { className: "border-text-error-primary/30 flex size-[1.666625rem] items-center justify-center rounded-full border-2", children: _jsx(FileX02Icon, { className: "text-text-error-primary size-5" }) }) }), _jsxs("div", { children: [_jsx("h2", { className: "text-text-secondary-700 text-sm font-semibold", children: "Verification failed" }), _jsx("p", { className: "text-text-tertiary-600 mt-xs text-sm", children: "There was an issue with the verification process. Please try again or contact support for assistance." })] })] }));
|
|
38
|
-
}
|