@opexa/portal-components 0.0.129 → 0.0.131
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/useAvailableQuestsQuery.js +6 -2
- package/dist/client/hooks/useBonusQuery.js +1 -0
- package/dist/client/hooks/useBonusesCountQuery.js +1 -0
- package/dist/client/hooks/useBonusesQuery.js +7 -2
- package/dist/client/hooks/useCashbackBonusQuery.js +1 -0
- package/dist/client/hooks/useCashbackBonusesCountQuery.js +1 -0
- package/dist/client/hooks/useCashbackBonusesQuery.js +7 -2
- package/dist/components/Bonuses/Bonuses.client.js +6 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/package.json +8 -8
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getAvailableQuests } from '../../services/trigger.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getAvailableQuestsCountQueryKey, getAvailableQuestsQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useAvailableQuestsQuery = (config) => {
|
|
9
|
+
const queryClient = getQueryClient();
|
|
8
10
|
const sessionQuery = useSessionQuery();
|
|
9
11
|
const query = useQuery({
|
|
10
12
|
...config,
|
|
@@ -15,12 +17,14 @@ export const useAvailableQuestsQuery = (config) => {
|
|
|
15
17
|
queryFn: async ({ signal }) => {
|
|
16
18
|
const session = await getSession();
|
|
17
19
|
invariant(session.status === 'authenticated');
|
|
18
|
-
|
|
20
|
+
const quests = await getAvailableQuests({
|
|
19
21
|
signal,
|
|
20
22
|
headers: {
|
|
21
23
|
Authorization: `Bearer ${session.token}`,
|
|
22
24
|
},
|
|
23
25
|
});
|
|
26
|
+
queryClient.setQueryData(getAvailableQuestsCountQueryKey(), quests.length);
|
|
27
|
+
return quests;
|
|
24
28
|
},
|
|
25
29
|
});
|
|
26
30
|
return query;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getBonuses } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getBonusesCountQueryKey, getBonusesQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useBonusesQuery = (config) => {
|
|
9
|
+
const queryClient = getQueryClient();
|
|
8
10
|
const sessionQuery = useSessionQuery();
|
|
9
11
|
const query = useQuery({
|
|
12
|
+
staleTime: 1000 * 5,
|
|
10
13
|
...config,
|
|
11
14
|
enabled: config?.enabled === false
|
|
12
15
|
? false
|
|
@@ -15,12 +18,14 @@ export const useBonusesQuery = (config) => {
|
|
|
15
18
|
queryFn: async ({ signal }) => {
|
|
16
19
|
const session = await getSession();
|
|
17
20
|
invariant(session.status === 'authenticated');
|
|
18
|
-
|
|
21
|
+
const bonuses = await getBonuses({
|
|
19
22
|
signal,
|
|
20
23
|
headers: {
|
|
21
24
|
Authorization: `Bearer ${session.token}`,
|
|
22
25
|
},
|
|
23
26
|
});
|
|
27
|
+
queryClient.setQueryData(getBonusesCountQueryKey(), bonuses.length);
|
|
28
|
+
return bonuses;
|
|
24
29
|
},
|
|
25
30
|
});
|
|
26
31
|
return query;
|
|
@@ -7,6 +7,7 @@ import { useSessionQuery } from './useSessionQuery.js';
|
|
|
7
7
|
export const useCashbackBonusQuery = (id, config) => {
|
|
8
8
|
const sessionQuery = useSessionQuery();
|
|
9
9
|
const query = useQuery({
|
|
10
|
+
staleTime: 1000 * 2,
|
|
10
11
|
...config,
|
|
11
12
|
enabled: config?.enabled === false
|
|
12
13
|
? false
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import { getCashbackBonuses } from '../../services/wallet.js';
|
|
4
|
-
import {
|
|
4
|
+
import { getQueryClient } from '../../utils/getQueryClient.js';
|
|
5
|
+
import { getCashbackBonusesCountQueryKey, getCashbackBonusesQueryKey, } from '../../utils/queryKeys.js';
|
|
5
6
|
import { getSession } from '../services/getSession.js';
|
|
6
7
|
import { useSessionQuery } from './useSessionQuery.js';
|
|
7
8
|
export const useCashbackBonusesQuery = (config) => {
|
|
9
|
+
const queryClient = getQueryClient();
|
|
8
10
|
const sessionQuery = useSessionQuery();
|
|
9
11
|
return useQuery({
|
|
12
|
+
staleTime: 1000 * 5,
|
|
10
13
|
...config,
|
|
11
14
|
enabled: config?.enabled === false
|
|
12
15
|
? false
|
|
@@ -15,12 +18,14 @@ export const useCashbackBonusesQuery = (config) => {
|
|
|
15
18
|
queryFn: async ({ signal }) => {
|
|
16
19
|
const session = await getSession();
|
|
17
20
|
invariant(session.status === 'authenticated');
|
|
18
|
-
|
|
21
|
+
const cashbackBonuses = await getCashbackBonuses({
|
|
19
22
|
signal,
|
|
20
23
|
headers: {
|
|
21
24
|
Authorization: `Bearer ${session.token}`,
|
|
22
25
|
},
|
|
23
26
|
});
|
|
27
|
+
queryClient.setQueryData(getCashbackBonusesCountQueryKey(), cashbackBonuses.length);
|
|
28
|
+
return cashbackBonuses;
|
|
24
29
|
},
|
|
25
30
|
});
|
|
26
31
|
};
|
|
@@ -28,8 +28,12 @@ import { ClaimSpotBonus } from './ClaimSpotBonus.js';
|
|
|
28
28
|
const TABS = ['ALL', 'ACTIVE', 'CASHBACKS'];
|
|
29
29
|
export function Bonuses__client(props) {
|
|
30
30
|
const [tab, setTab] = useState(TABS[0]);
|
|
31
|
-
const bonusesQuery = useBonusesQuery(
|
|
32
|
-
|
|
31
|
+
const bonusesQuery = useBonusesQuery({
|
|
32
|
+
refetchInterval: 5000,
|
|
33
|
+
});
|
|
34
|
+
const cashbackBonusesQuery = useCashbackBonusesQuery({
|
|
35
|
+
refetchInterval: 5000,
|
|
36
|
+
});
|
|
33
37
|
const bonuses = tab === 'CASHBACKS'
|
|
34
38
|
? []
|
|
35
39
|
: (bonusesQuery.data ?? []).filter((bonus) => {
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const OnlineBankDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "vca" | "form";
|
|
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: "
|
|
16
|
+
view: "vca" | "form";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const QRPHDepositContext: (props: {
|
|
2
2
|
value: {
|
|
3
|
-
view: "
|
|
3
|
+
view: "qrCode" | "form";
|
|
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: "
|
|
16
|
+
view: "qrCode" | "form";
|
|
17
17
|
status: "waiting" | "processing" | "failed" | "verification-waiting" | "verification-processing" | "verification-failed" | "verification-success";
|
|
18
18
|
verify: () => void;
|
|
19
19
|
reset: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opexa/portal-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.131",
|
|
4
4
|
"exports": {
|
|
5
5
|
"./ui/*": {
|
|
6
6
|
"types": "./dist/ui/*/index.d.ts",
|
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
"release": "release-it"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@ark-ui/react": "^5.14.
|
|
80
|
+
"@ark-ui/react": "^5.14.1",
|
|
81
81
|
"@date-fns/tz": "^1.2.0",
|
|
82
|
-
"@next/third-parties": "^15.3.
|
|
82
|
+
"@next/third-parties": "^15.3.4",
|
|
83
83
|
"@tailwindcss/typography": "^0.5.16",
|
|
84
84
|
"date-fns": "^4.1.0",
|
|
85
85
|
"embla-carousel-autoplay": "^8.6.0",
|
|
@@ -101,8 +101,8 @@
|
|
|
101
101
|
"@hookform/resolvers": "5.1.1",
|
|
102
102
|
"@opexa/object-id": "0.1.6",
|
|
103
103
|
"@tailwindcss/postcss": "4",
|
|
104
|
-
"@tanstack/react-query": "5.80.
|
|
105
|
-
"@tanstack/react-query-devtools": "5.80.
|
|
104
|
+
"@tanstack/react-query": "5.80.10",
|
|
105
|
+
"@tanstack/react-query-devtools": "5.80.10",
|
|
106
106
|
"@total-typescript/ts-reset": "0.6.1",
|
|
107
107
|
"@types/lodash-es": "4.17.12",
|
|
108
108
|
"@types/node": "24",
|
|
@@ -110,16 +110,16 @@
|
|
|
110
110
|
"@types/react-dom": "19",
|
|
111
111
|
"copy-files-from-to": "3.12.1",
|
|
112
112
|
"eslint": "9",
|
|
113
|
-
"eslint-config-next": "15.3.
|
|
113
|
+
"eslint-config-next": "15.3.4",
|
|
114
114
|
"next": "15.4.0-canary.61",
|
|
115
115
|
"react": "19.1.0",
|
|
116
116
|
"react-dom": "19.1.0",
|
|
117
|
-
"react-hook-form": "7.
|
|
117
|
+
"react-hook-form": "7.58.1",
|
|
118
118
|
"release-it": "19.0.3",
|
|
119
119
|
"tailwindcss": "4.1.10",
|
|
120
120
|
"tsc-alias": "1.8.16",
|
|
121
121
|
"typescript": "5",
|
|
122
|
-
"zod": "3.25.
|
|
122
|
+
"zod": "3.25.67"
|
|
123
123
|
},
|
|
124
124
|
"peerDependencies": {
|
|
125
125
|
"@hookform/resolvers": "^4.0.0 || ^5.0.0",
|