@opexa/portal-components 0.0.259 → 0.0.261
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/useCamera.d.ts +11 -16
- package/dist/client/hooks/useCamera.js +29 -57
- package/dist/client/hooks/useUploadFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadFileMutation.js +24 -0
- package/dist/client/hooks/useUploadImageFileMutation.d.ts +2 -2
- package/dist/client/hooks/useUploadImageFileMutation.js +2 -2
- package/dist/client/hooks/useUploadPrivateImageFileMutation.d.ts +4 -0
- package/dist/client/hooks/useUploadPrivateImageFileMutation.js +24 -0
- package/dist/components/Bonus/Bonus.client.js +1 -1
- package/dist/components/Cashback/Cashback.client.js +1 -1
- package/dist/components/CustomPromo/CustomPromo.js +1 -1
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/OnlineBankDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts +1 -1
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/QRPHDepositContext.d.ts +2 -2
- package/dist/components/DepositWithdrawal/Deposit/QRPHDeposit/useQRPHDeposit.d.ts +1 -1
- package/dist/components/Disclaimer/Disclaimer.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.d.ts +1 -1
- package/dist/components/Disclaimer/DisclaimerV2.js +7 -5
- package/dist/components/GameLaunch/GameLaunch.lazy.js +1 -1
- package/dist/components/GamesSearch/GamesSearch.js +1 -1
- package/dist/components/Jackpots/JackpotsCarousel/JackpotsCarouselItem.module.css +184 -184
- package/dist/components/Jackpots/JackpotsList/JackpotsListItem.module.css +184 -184
- package/dist/components/KYC/AutoOpen.js +3 -8
- package/dist/components/KYC/utils.js +18 -18
- package/dist/components/Messages/Message.js +3 -2
- package/dist/components/Messages/MessagePopup.js +3 -2
- package/dist/components/News/News.js +1 -1
- package/dist/components/PortalProvider/FeatureFlag.js +1 -1
- package/dist/components/Promo/Promo.client.js +1 -1
- package/dist/components/Search/Search.lazy.js +1 -1
- package/dist/components/SignUp/SignUpForm.js +0 -4
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureIdDocument.js +198 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/CaptureSelfie.js +251 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.d.ts +10 -0
- package/dist/components/SignUp/SignUpPagcor/ImageUploader.js +41 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.d.ts +1 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpFormPagcor.js +429 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.d.ts +13 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcor.lazy.js +26 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.d.ts +7 -0
- package/dist/components/SignUp/SignUpPagcor/SignUpPagcorContext.js +2 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.d.ts +11 -0
- package/dist/components/SignUp/SignUpPagcor/useImageUploader.js +20 -0
- package/dist/components/Tournaments/TournamentsCarousel/TournamentsCarouselItem.module.css +184 -184
- package/dist/components/Tournaments/TournamentsList/TournamentItem.module.css +184 -184
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.d.ts +15 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.client.js +140 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.d.ts +2 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageField.js +11 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageFieldContext.d.ts +6 -0
- package/dist/components/shared/IdFrontImageField/IdFrontImageFieldContext.js +2 -0
- package/dist/components/shared/IdFrontImageField/index.d.ts +1 -0
- package/dist/components/shared/IdFrontImageField/index.js +1 -0
- package/dist/components/shared/IdFrontImageField/useIdFrontImageField.d.ts +22 -0
- package/dist/components/shared/IdFrontImageField/useIdFrontImageField.js +111 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.d.ts +15 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.client.js +170 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.d.ts +2 -0
- package/dist/components/shared/SelfieImageField/SelfieImageField.js +11 -0
- package/dist/components/shared/SelfieImageField/SelfieImageFieldContext.d.ts +6 -0
- package/dist/components/shared/SelfieImageField/SelfieImageFieldContext.js +2 -0
- package/dist/components/shared/SelfieImageField/index.d.ts +1 -0
- package/dist/components/shared/SelfieImageField/index.js +1 -0
- package/dist/components/shared/SelfieImageField/useSelfieImageField.d.ts +23 -0
- package/dist/components/shared/SelfieImageField/useSelfieImageField.js +208 -0
- package/dist/handlers/deleteSession.d.ts +9 -0
- package/dist/handlers/deleteSession.js +19 -0
- package/dist/handlers/getHealthCheck.d.ts +9 -0
- package/dist/handlers/getHealthCheck.js +16 -0
- package/dist/handlers/getSession.d.ts +10 -0
- package/dist/handlers/getSession.js +63 -0
- package/dist/handlers/index.d.ts +40 -0
- package/dist/handlers/index.js +56 -0
- package/dist/handlers/patchSession.d.ts +10 -0
- package/dist/handlers/patchSession.js +26 -0
- package/dist/handlers/postAuthenticate.d.ts +10 -0
- package/dist/handlers/postAuthenticate.js +51 -0
- package/dist/handlers/postSession.d.ts +17 -0
- package/dist/handlers/postSession.js +78 -0
- package/dist/handlers/postTransformIdFrontImage.d.ts +3 -0
- package/dist/handlers/postTransformIdFrontImage.js +67 -0
- package/dist/handlers/postTransformSelfieImage.d.ts +3 -0
- package/dist/handlers/postTransformSelfieImage.js +71 -0
- package/dist/services/file.d.ts +17 -12
- package/dist/services/file.js +21 -1
- package/dist/services/queries.d.ts +3 -1
- package/dist/services/queries.js +2568 -2532
- package/dist/styles/theme.css +694 -694
- package/dist/ui/DatePicker/DatePicker.d.ts +72 -72
- package/dist/ui/DatePicker/datePicker.recipe.d.ts +3 -3
- package/dist/utils/mutationKeys.d.ts +2 -0
- package/dist/utils/mutationKeys.js +8 -0
- package/dist/utils/resizeImageSize.d.ts +1 -0
- package/dist/utils/resizeImageSize.js +5 -0
- package/package.json +166 -165
- package/dist/client/hooks/index.d.ts +0 -65
- package/dist/client/hooks/index.js +0 -65
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -4
- package/dist/client/utils/index.d.ts +0 -3
- package/dist/client/utils/index.js +0 -3
- package/dist/components/CashbackBonus/CashbackBonus.client.d.ts +0 -2
- package/dist/components/CashbackBonus/CashbackBonus.client.js +0 -9
- package/dist/components/CashbackBonus/CashbackBonus.d.ts +0 -10
- package/dist/components/CashbackBonus/CashbackBonus.js +0 -5
- package/dist/components/CashbackBonus/index.d.ts +0 -1
- package/dist/components/CashbackBonus/index.js +0 -1
- package/dist/components/Empty.d.ts +0 -9
- package/dist/components/Empty.js +0 -7
- package/dist/components/Games/GameContext.d.ts +0 -2
- package/dist/components/Games/GameContext.js +0 -2
- package/dist/components/InfiniteScroll.d.ts +0 -10
- package/dist/components/InfiniteScroll.js +0 -25
- package/dist/components/JackpotCounter/JackpotCounter.client.d.ts +0 -2
- package/dist/components/JackpotCounter/JackpotCounter.client.js +0 -66
- package/dist/components/JackpotCounter/JackpotCounter.d.ts +0 -17
- package/dist/components/JackpotCounter/JackpotCounter.js +0 -21
- package/dist/components/JackpotCounter/JackpotCounterItem.d.ts +0 -18
- package/dist/components/JackpotCounter/JackpotCounterItem.js +0 -109
- package/dist/components/JackpotCounter/JackpotCounterItem.module.css +0 -184
- package/dist/components/JackpotCounter/index.d.ts +0 -1
- package/dist/components/JackpotCounter/index.js +0 -1
- package/dist/components/Jackpots/JackpotDesktop.d.ts +0 -1
- package/dist/components/Jackpots/JackpotDesktop.js +0 -45
- package/dist/components/Jackpots/JackpotGameProviders.d.ts +0 -5
- package/dist/components/Jackpots/JackpotGameProviders.js +0 -41
- package/dist/components/Jackpots/JackpotItemDesktop.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemDesktop.js +0 -43
- package/dist/components/Jackpots/JackpotItemMobile.d.ts +0 -9
- package/dist/components/Jackpots/JackpotItemMobile.js +0 -44
- package/dist/components/Jackpots/JackpotMobile.d.ts +0 -1
- package/dist/components/Jackpots/JackpotMobile.js +0 -46
- package/dist/components/Jackpots/JackpotRules.d.ts +0 -5
- package/dist/components/Jackpots/JackpotRules.js +0 -11
- package/dist/components/Jackpots/Jackpots.client.d.ts +0 -2
- package/dist/components/Jackpots/Jackpots.client.js +0 -29
- package/dist/components/Jackpots/JackpotsContext.d.ts +0 -4
- package/dist/components/Jackpots/JackpotsContext.js +0 -3
- package/dist/components/Jackpots/useJackpotData.d.ts +0 -14
- package/dist/components/Jackpots/useJackpotData.js +0 -93
- package/dist/components/Jackpots/useJackpotItemData.d.ts +0 -20
- package/dist/components/Jackpots/useJackpotItemData.js +0 -87
- package/dist/components/KYC/Header.d.ts +0 -1
- package/dist/components/KYC/Header.js +0 -8
- package/dist/components/KYC/Step1.d.ts +0 -1
- package/dist/components/KYC/Step1.js +0 -13
- package/dist/components/KYC/Step2.d.ts +0 -1
- package/dist/components/KYC/Step2.js +0 -13
- package/dist/components/KYC/Step3.d.ts +0 -1
- package/dist/components/KYC/Step3.js +0 -13
- package/dist/components/KYC/Step4.d.ts +0 -1
- package/dist/components/KYC/Step4.js +0 -7
- package/dist/components/Messages/MessageItem.d.ts +0 -4
- package/dist/components/Messages/MessageItem.js +0 -34
- 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/PromoCarousel.js +0 -41
- package/dist/components/Promos/PromoGrid.d.ts +0 -2
- package/dist/components/Promos/PromoGrid.js +0 -12
- package/dist/components/Promos/PromoItem.d.ts +0 -7
- package/dist/components/Promos/PromoItem.js +0 -10
- package/dist/components/TournamentCounter/TournamentCounter.client.d.ts +0 -2
- package/dist/components/TournamentCounter/TournamentCounter.client.js +0 -50
- package/dist/components/TournamentCounter/TournamentCounter.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounter.js +0 -21
- package/dist/components/TournamentCounter/TournamentCounterItem.d.ts +0 -8
- package/dist/components/TournamentCounter/TournamentCounterItem.js +0 -106
- package/dist/components/TournamentCounter/index.d.ts +0 -1
- package/dist/components/TournamentCounter/index.js +0 -1
- package/dist/components/Tournaments/TournamentDesktop.d.ts +0 -1
- package/dist/components/Tournaments/TournamentDesktop.js +0 -57
- package/dist/components/Tournaments/TournamentGameProviders.d.ts +0 -5
- package/dist/components/Tournaments/TournamentGameProviders.js +0 -38
- package/dist/components/Tournaments/TournamentItemDesktop.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemDesktop.js +0 -56
- package/dist/components/Tournaments/TournamentItemMobile.d.ts +0 -7
- package/dist/components/Tournaments/TournamentItemMobile.js +0 -54
- package/dist/components/Tournaments/TournamentMobile.d.ts +0 -1
- package/dist/components/Tournaments/TournamentMobile.js +0 -55
- package/dist/components/Tournaments/TournamentRules.d.ts +0 -5
- package/dist/components/Tournaments/TournamentRules.js +0 -11
- package/dist/components/Tournaments/Tournaments.client.d.ts +0 -2
- package/dist/components/Tournaments/Tournaments.client.js +0 -20
- package/dist/components/Tournaments/TournamentsContext.d.ts +0 -4
- package/dist/components/Tournaments/TournamentsContext.js +0 -3
- package/dist/components/Tournaments/useTournamentData.d.ts +0 -10
- package/dist/components/Tournaments/useTournamentData.js +0 -72
- package/dist/components/Tournaments/useTournamentItemData.d.ts +0 -16
- package/dist/components/Tournaments/useTournamentItemData.js +0 -64
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -33
- package/dist/constants/endpoints.d.ts +0 -10
- package/dist/constants/endpoints.js +0 -41
- package/dist/constants/envVars.d.ts +0 -5
- package/dist/constants/envVars.js +0 -28
- package/dist/constants/gameProviders.d.ts +0 -76
- package/dist/constants/gameProviders.js +0 -361
- package/dist/constants/gameTypes.d.ts +0 -3
- package/dist/constants/gameTypes.js +0 -64
- package/dist/constants/headerKeys.d.ts +0 -2
- package/dist/constants/headerKeys.js +0 -2
- package/dist/constants/secretQuestions.d.ts +0 -3
- package/dist/constants/secretQuestions.js +0 -24
- package/dist/constants/storageKeys.d.ts +0 -2
- package/dist/constants/storageKeys.js +0 -2
- package/dist/icons/index.d.ts +0 -65
- package/dist/icons/index.js +0 -65
- package/dist/images/hacksaw-gaming.png +0 -0
- package/dist/server/services/index.d.ts +0 -4
- package/dist/server/services/index.js +0 -4
- package/dist/server/utils/index.d.ts +0 -29
- package/dist/server/utils/index.js +0 -29
- package/dist/ui/Presence.d.ts +0 -2
- package/dist/ui/Presence.js +0 -7
- package/dist/ui/Prose.d.ts +0 -2
- package/dist/ui/Prose.js +0 -5
- package/dist/ui/index.d.ts +0 -26
- package/dist/ui/index.js +0 -26
- package/dist/utils/createErrorFromCode.d.ts +0 -2
- package/dist/utils/createErrorFromCode.js +0 -11
- package/dist/utils/index.d.ts +0 -17
- package/dist/utils/index.js +0 -17
- package/dist/utils/isMobile.d.ts +0 -5
- package/dist/utils/isMobile.js +0 -9
|
@@ -9,22 +9,10 @@ export interface CameraData {
|
|
|
9
9
|
file: File;
|
|
10
10
|
image: HTMLImageElement;
|
|
11
11
|
}
|
|
12
|
-
export interface CameraCropPoints {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
}
|
|
18
|
-
export type ScaleFactor = 1 | 1.15 | 1.25 | 1.5 | 1.75 | 2 | 2.15 | 2.25 | 2.5 | 2.75 | 3;
|
|
19
|
-
export interface CameraSnapOptions {
|
|
20
|
-
crop?: CameraCropPoints;
|
|
21
|
-
/** @default 2 */
|
|
22
|
-
scale?: ScaleFactor;
|
|
23
|
-
}
|
|
24
12
|
export interface UseCameraReturn<T extends string = never> {
|
|
25
13
|
open(): Promise<void>;
|
|
26
14
|
close(): Promise<void>;
|
|
27
|
-
snap(
|
|
15
|
+
snap(): Promise<void>;
|
|
28
16
|
reopen(): Promise<void>;
|
|
29
17
|
reset(): Promise<void>;
|
|
30
18
|
data: CameraData | null;
|
|
@@ -34,11 +22,18 @@ export interface UseCameraReturn<T extends string = never> {
|
|
|
34
22
|
videoRef: React.RefObject<HTMLVideoElement | null>;
|
|
35
23
|
videoProps: ComponentPropsWithRef<'video'>;
|
|
36
24
|
}
|
|
37
|
-
export
|
|
25
|
+
export type CameraTransformResult<T extends string = never> = {
|
|
26
|
+
ok: false;
|
|
27
|
+
error: CameraError<T>;
|
|
28
|
+
} | {
|
|
29
|
+
ok: true;
|
|
30
|
+
data: CameraData;
|
|
31
|
+
};
|
|
32
|
+
export interface CameraTransformContext extends CameraData {
|
|
33
|
+
video: HTMLVideoElement;
|
|
38
34
|
canvas: HTMLCanvasElement;
|
|
39
35
|
}
|
|
40
36
|
export interface UseCameraOptions<T extends string = never> extends MediaStreamConstraints {
|
|
41
|
-
transform?(
|
|
42
|
-
validate?(data: CameraData): CameraError<T> | void | null | undefined | Promise<CameraError<T> | void | null | undefined>;
|
|
37
|
+
transform?(context: CameraTransformContext): CameraTransformResult<T> | Promise<CameraTransformResult<T>>;
|
|
43
38
|
}
|
|
44
39
|
export declare function useCamera<T extends string = never>(options?: UseCameraOptions<T>): UseCameraReturn<T>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { isBoolean,
|
|
1
|
+
import { isBoolean, isObject } from 'lodash-es';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { useMediaQuery } from 'usehooks-ts';
|
|
5
5
|
export function useCamera(options = {}) {
|
|
6
|
-
const { transform, validate, ...constraints } = options;
|
|
7
6
|
const videoRef = useRef(null);
|
|
8
7
|
const streamRef = useRef(null);
|
|
9
8
|
const [data, setData] = useState(null);
|
|
@@ -30,7 +29,7 @@ export function useCamera(options = {}) {
|
|
|
30
29
|
const result = await navigator.mediaDevices.getUserMedia({
|
|
31
30
|
audio: false,
|
|
32
31
|
preferCurrentTab: true,
|
|
33
|
-
...
|
|
32
|
+
...options,
|
|
34
33
|
video: {
|
|
35
34
|
facingMode: 'user',
|
|
36
35
|
noiseSuppression: true,
|
|
@@ -47,14 +46,14 @@ export function useCamera(options = {}) {
|
|
|
47
46
|
max: 120,
|
|
48
47
|
ideal: 90,
|
|
49
48
|
},
|
|
50
|
-
...(isBoolean(
|
|
49
|
+
...(isBoolean(options.video) ? {} : options.video),
|
|
51
50
|
},
|
|
52
51
|
});
|
|
53
52
|
node.srcObject = result;
|
|
54
53
|
streamRef.current = result;
|
|
55
|
-
setMirror(!isObject(
|
|
54
|
+
setMirror(!isObject(options.video)
|
|
56
55
|
? true
|
|
57
|
-
:
|
|
56
|
+
: options.video.facingMode === 'environment'
|
|
58
57
|
? false
|
|
59
58
|
: true);
|
|
60
59
|
}
|
|
@@ -85,7 +84,7 @@ export function useCamera(options = {}) {
|
|
|
85
84
|
finally {
|
|
86
85
|
setLoading(false);
|
|
87
86
|
}
|
|
88
|
-
}, [
|
|
87
|
+
}, [options, desktop]);
|
|
89
88
|
const close = useCallback(() => {
|
|
90
89
|
setData(null);
|
|
91
90
|
setError(null);
|
|
@@ -97,7 +96,7 @@ export function useCamera(options = {}) {
|
|
|
97
96
|
resolve();
|
|
98
97
|
});
|
|
99
98
|
}, [setData, setError]);
|
|
100
|
-
const snap = useCallback(async (
|
|
99
|
+
const snap = useCallback(async () => {
|
|
101
100
|
setData(null);
|
|
102
101
|
setError(null);
|
|
103
102
|
setSnapping(true);
|
|
@@ -107,44 +106,15 @@ export function useCamera(options = {}) {
|
|
|
107
106
|
invariant(video, 'Could not find video element');
|
|
108
107
|
invariant(context, 'Could not get canvas context');
|
|
109
108
|
video.currentTime = 1;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const hdResolution = video.videoWidth >= 1280 && video.videoHeight >= 720;
|
|
113
|
-
const highResolution = video.videoWidth >= 1920 && video.videoHeight >= 1080;
|
|
114
|
-
const scaleFactor = lowResolution
|
|
115
|
-
? (opts.scale ?? (opts.crop ? 2.15 : 2))
|
|
116
|
-
: highResolution
|
|
117
|
-
? opts.crop
|
|
118
|
-
? 1.25
|
|
119
|
-
: 1.15
|
|
120
|
-
: hdResolution
|
|
121
|
-
? opts.crop
|
|
122
|
-
? 1.5
|
|
123
|
-
: 1.25
|
|
124
|
-
: opts.crop
|
|
125
|
-
? 1.5
|
|
126
|
-
: 2;
|
|
127
|
-
let x = 0;
|
|
128
|
-
let y = 0;
|
|
129
|
-
let w = video.videoWidth;
|
|
130
|
-
let h = video.videoHeight;
|
|
131
|
-
if (opts.crop) {
|
|
132
|
-
const scaleX = video.videoWidth / videoRect.width;
|
|
133
|
-
const scaleY = video.videoHeight / videoRect.height;
|
|
134
|
-
x = (opts.crop.x - videoRect.x) * scaleX;
|
|
135
|
-
y = (opts.crop.y - videoRect.y) * scaleY;
|
|
136
|
-
w = opts.crop.width * scaleX;
|
|
137
|
-
h = opts.crop.height * scaleY;
|
|
138
|
-
}
|
|
139
|
-
canvas.width = w * scaleFactor;
|
|
140
|
-
canvas.height = h * scaleFactor;
|
|
109
|
+
canvas.width = video.videoWidth;
|
|
110
|
+
canvas.height = video.videoHeight;
|
|
141
111
|
context.imageSmoothingEnabled = true;
|
|
142
112
|
context.imageSmoothingQuality = 'high';
|
|
143
113
|
if (mirror) {
|
|
144
114
|
context.translate(canvas.width, 0);
|
|
145
115
|
context.scale(-1, 1);
|
|
146
116
|
}
|
|
147
|
-
context.drawImage(video,
|
|
117
|
+
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
|
148
118
|
canvas.toBlob(async (blob) => {
|
|
149
119
|
if (!blob) {
|
|
150
120
|
setSnapping(false);
|
|
@@ -170,26 +140,28 @@ export function useCamera(options = {}) {
|
|
|
170
140
|
image.onerror = () => reject();
|
|
171
141
|
});
|
|
172
142
|
}
|
|
173
|
-
const data =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
})
|
|
180
|
-
: {
|
|
181
|
-
url,
|
|
182
|
-
file,
|
|
183
|
-
image,
|
|
184
|
-
};
|
|
185
|
-
const error = await validate?.(data);
|
|
186
|
-
if (error)
|
|
187
|
-
setError(error);
|
|
188
|
-
else
|
|
143
|
+
const data = {
|
|
144
|
+
url,
|
|
145
|
+
file,
|
|
146
|
+
image,
|
|
147
|
+
};
|
|
148
|
+
if (!options.transform) {
|
|
189
149
|
setData(data);
|
|
150
|
+
setSnapping(false);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const transformResult = await options.transform({
|
|
154
|
+
...data,
|
|
155
|
+
video,
|
|
156
|
+
canvas,
|
|
157
|
+
});
|
|
158
|
+
if (transformResult.ok)
|
|
159
|
+
setData(transformResult.data);
|
|
160
|
+
else
|
|
161
|
+
setError(transformResult.error);
|
|
190
162
|
setSnapping(false);
|
|
191
163
|
}, 'image/jpeg', 1);
|
|
192
|
-
}, [mirror,
|
|
164
|
+
}, [mirror, options]);
|
|
193
165
|
const reset = useCallback(() => {
|
|
194
166
|
setData(null);
|
|
195
167
|
setError(null);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { uploadFile } from '../../services/file.js';
|
|
5
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
|
+
import { getUploadFileMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
|
+
export const useUploadFileMutation = (config) => {
|
|
9
|
+
return useMutation({
|
|
10
|
+
...config,
|
|
11
|
+
mutationKey: getUploadFileMutationKey(),
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const session = await getSession();
|
|
14
|
+
invariant(session.status === 'authenticated');
|
|
15
|
+
const id = input.id ?? ObjectId.generate(ObjectType.File).toString();
|
|
16
|
+
await uploadFile({ ...input, id }, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
return id;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SetOptional } from 'type-fest';
|
|
2
|
-
import { type
|
|
2
|
+
import { type UploadFileInput } from '../../services/file';
|
|
3
3
|
import type { Mutation } from '../../types';
|
|
4
|
-
export declare const useUploadImageFileMutation: Mutation<string, SetOptional<
|
|
4
|
+
export declare const useUploadImageFileMutation: Mutation<string, SetOptional<UploadFileInput, 'id'>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ObjectId } from '@opexa/object-id';
|
|
2
2
|
import { useMutation } from '@tanstack/react-query';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
|
-
import {
|
|
4
|
+
import { uploadImageFile } from '../../services/file.js';
|
|
5
5
|
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
6
|
import { getUploadImageFileMutationKey } from '../../utils/mutationKeys.js';
|
|
7
7
|
import { getSession } from '../services/getSession.js';
|
|
@@ -13,7 +13,7 @@ export const useUploadImageFileMutation = (config) => {
|
|
|
13
13
|
const session = await getSession();
|
|
14
14
|
invariant(session.status === 'authenticated');
|
|
15
15
|
const id = input.id ?? ObjectId.generate(ObjectType.File).toString();
|
|
16
|
-
await
|
|
16
|
+
await uploadImageFile({ ...input, id }, {
|
|
17
17
|
headers: {
|
|
18
18
|
Authorization: `Bearer ${session.token}`,
|
|
19
19
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ObjectId } from '@opexa/object-id';
|
|
2
|
+
import { useMutation } from '@tanstack/react-query';
|
|
3
|
+
import invariant from 'tiny-invariant';
|
|
4
|
+
import { uploadPrivateImageFile, } from '../../services/file.js';
|
|
5
|
+
import { ObjectType } from '../../services/ObjectType.js';
|
|
6
|
+
import { getUploadPrivateImageFileMutationKey } from '../../utils/mutationKeys.js';
|
|
7
|
+
import { getSession } from '../services/getSession.js';
|
|
8
|
+
export const useUploadPrivateImageFileMutation = (config) => {
|
|
9
|
+
return useMutation({
|
|
10
|
+
...config,
|
|
11
|
+
mutationKey: getUploadPrivateImageFileMutationKey(),
|
|
12
|
+
mutationFn: async (input) => {
|
|
13
|
+
const session = await getSession();
|
|
14
|
+
invariant(session.status === 'authenticated');
|
|
15
|
+
const id = input.id ?? ObjectId.generate(ObjectType.File).toString();
|
|
16
|
+
await uploadPrivateImageFile({ ...input, id }, {
|
|
17
|
+
headers: {
|
|
18
|
+
Authorization: `Bearer ${session.token}`,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
return id;
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
};
|
|
@@ -13,7 +13,7 @@ import piggyBank from '../../images/piggy-bank.png';
|
|
|
13
13
|
import { Badge } from '../../ui/Badge/index.js';
|
|
14
14
|
import { Collapsible } from '../../ui/Collapsible/index.js';
|
|
15
15
|
import { Progress } from '../../ui/Progress/index.js';
|
|
16
|
-
import { Prose } from '../../ui/Prose.js';
|
|
16
|
+
import { Prose } from '../../ui/Prose/index.js';
|
|
17
17
|
import { capitalize } from '../../utils/capitalize.js';
|
|
18
18
|
import { formatNumber } from '../../utils/formatNumber.js';
|
|
19
19
|
import { parseDecimal } from '../../utils/parseDecimal.js';
|
|
@@ -11,7 +11,7 @@ import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
|
11
11
|
import { useLocaleInfo } from '../../client/hooks/useLocaleInfo.js';
|
|
12
12
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
13
13
|
import { Button } from '../../ui/Button/index.js';
|
|
14
|
-
import { Prose } from '../../ui/Prose.js';
|
|
14
|
+
import { Prose } from '../../ui/Prose/index.js';
|
|
15
15
|
export function Cashback__client(props) {
|
|
16
16
|
const availablePromosQuery = useAvailablePromosQuery();
|
|
17
17
|
const cashbackQuery = useCashbackQuery(props.id);
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import Image from 'next/image';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import { ChevronLeftIcon } from '../../icons/ChevronLeftIcon.js';
|
|
6
|
-
import { Prose } from '../../ui/Prose.js';
|
|
6
|
+
import { Prose } from '../../ui/Prose/index.js';
|
|
7
7
|
import { stripTags } from '../../utils/stripTags.js';
|
|
8
8
|
export function CustomPromo(props) {
|
|
9
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: {
|
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: "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: "
|
|
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;
|
package/dist/components/DepositWithdrawal/Deposit/OnlineBankDeposit/useOnlineBankDeposit.d.ts
CHANGED
|
@@ -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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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;
|
|
@@ -8,7 +8,7 @@ type DisclaimerProps = DisclaimerV1Props | {
|
|
|
8
8
|
responsibleGamingContent: string | ReactNode;
|
|
9
9
|
termsOfUseContent: string | ReactNode;
|
|
10
10
|
responsibleGamingLogo?: ImageProps['src'];
|
|
11
|
-
redirectUrlOnNoConsent
|
|
11
|
+
redirectUrlOnNoConsent?: string;
|
|
12
12
|
hasNoCheckbox?: boolean;
|
|
13
13
|
};
|
|
14
14
|
export declare function Disclaimer(props: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ export interface DisclaimerProps {
|
|
|
6
6
|
responsibleGamingContent: ReactNode;
|
|
7
7
|
termsOfUseContent: ReactNode;
|
|
8
8
|
responsibleGamingLogo?: ImageProps['src'];
|
|
9
|
-
redirectUrlOnNoConsent
|
|
9
|
+
redirectUrlOnNoConsent?: string;
|
|
10
10
|
hasNoCheckbox?: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function DisclaimerV2(props: DisclaimerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,18 +29,20 @@ export function DisclaimerV2(props) {
|
|
|
29
29
|
}, children: "Terms of Use" }), ' ', "and", ' ', _jsx("button", { type: "button", className: "text-brand-400 underline underline-offset-2", onClick: () => {
|
|
30
30
|
setResponsibleGamingOpen(true);
|
|
31
31
|
}, children: "Responsible Gaming" })] })), _jsx("div", { children: "Funds or credits in the account of any individual found ineligible to participate will be forfeited and turned over to the government as required by law" })] }) }), _jsxs("div", { className: "mt-4 flex w-full gap-3", children: [_jsx(Button, { type: "button", onClick: () => {
|
|
32
|
-
if (
|
|
33
|
-
|
|
32
|
+
if (props.redirectUrlOnNoConsent) {
|
|
33
|
+
window.location.href = props.redirectUrlOnNoConsent;
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
|
|
36
|
+
disclaimer.close();
|
|
37
37
|
}
|
|
38
|
-
}, variant: "outline", children: "Exit" }), _jsx(Button, { ref: acceptTriggerRef, type: "button", onClick: () => {
|
|
38
|
+
}, variant: "outline", children: "Exit" }), _jsx(Button, { ref: acceptTriggerRef, type: "button", disabled: !isChecked, "aria-disabled": !isChecked, onClick: () => {
|
|
39
39
|
if (isChecked) {
|
|
40
40
|
disclaimer.close();
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
43
|
+
if (props.redirectUrlOnNoConsent) {
|
|
44
|
+
window.location.href = props.redirectUrlOnNoConsent;
|
|
45
|
+
}
|
|
44
46
|
}
|
|
45
47
|
}, children: "Accept" })] })] }) })] }) })] }));
|
|
46
48
|
}
|
|
@@ -22,7 +22,7 @@ import { AlertDialog } from '../../ui/AlertDialog/index.js';
|
|
|
22
22
|
import { Button } from '../../ui/Button/index.js';
|
|
23
23
|
import { IconButton } from '../../ui/IconButton/index.js';
|
|
24
24
|
import { Portal } from '../../ui/Portal/index.js';
|
|
25
|
-
import { Presence } from '../../ui/Presence.js';
|
|
25
|
+
import { Presence } from '../../ui/Presence/index.js';
|
|
26
26
|
export function GameLaunch() {
|
|
27
27
|
const globalStore = useGlobalStore(useShallow((ctx) => ({
|
|
28
28
|
gameLaunch: ctx.gameLaunch,
|
|
@@ -10,7 +10,7 @@ import { SearchLgIcon } from '../../icons/SearchLgIcon.js';
|
|
|
10
10
|
import { Button } from '../../ui/Button/index.js';
|
|
11
11
|
import { Combobox } from '../../ui/Combobox/index.js';
|
|
12
12
|
import { Portal } from '../../ui/Portal/index.js';
|
|
13
|
-
import { Presence } from '../../ui/Presence.js';
|
|
13
|
+
import { Presence } from '../../ui/Presence/index.js';
|
|
14
14
|
import { getGameImageUrl } from '../../utils/getGameImageUrl.js';
|
|
15
15
|
import { GameLaunchTrigger } from '../GameLaunch/index.js';
|
|
16
16
|
export function GamesSearch(props) {
|