@opexa/portal-components 0.0.560 → 0.0.562
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isBoolean
|
|
1
|
+
import { isBoolean } 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';
|
|
@@ -10,7 +10,6 @@ export function useCamera(options = {}) {
|
|
|
10
10
|
const [loading, setLoading] = useState(false);
|
|
11
11
|
const [snapping, setSnapping] = useState(false);
|
|
12
12
|
const desktop = useMediaQuery('(min-width: 1024px)');
|
|
13
|
-
const [mirror, setMirror] = useState(false);
|
|
14
13
|
const open = useCallback(async () => {
|
|
15
14
|
setData(null);
|
|
16
15
|
setError(null);
|
|
@@ -51,11 +50,6 @@ export function useCamera(options = {}) {
|
|
|
51
50
|
});
|
|
52
51
|
node.srcObject = result;
|
|
53
52
|
streamRef.current = result;
|
|
54
|
-
setMirror(!isObject(options.video)
|
|
55
|
-
? true
|
|
56
|
-
: options.video.facingMode === 'environment'
|
|
57
|
-
? false
|
|
58
|
-
: true);
|
|
59
53
|
}
|
|
60
54
|
catch (e) {
|
|
61
55
|
if (e instanceof Error) {
|
|
@@ -110,10 +104,6 @@ export function useCamera(options = {}) {
|
|
|
110
104
|
canvas.height = video.videoHeight;
|
|
111
105
|
context.imageSmoothingEnabled = true;
|
|
112
106
|
context.imageSmoothingQuality = 'high';
|
|
113
|
-
if (mirror) {
|
|
114
|
-
context.translate(canvas.width, 0);
|
|
115
|
-
context.scale(-1, 1);
|
|
116
|
-
}
|
|
117
107
|
context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
|
|
118
108
|
return new Promise((resolve) => {
|
|
119
109
|
canvas.toBlob(async (blob) => {
|
|
@@ -169,7 +159,7 @@ export function useCamera(options = {}) {
|
|
|
169
159
|
setSnapping(false);
|
|
170
160
|
}, 'image/jpeg', 1);
|
|
171
161
|
});
|
|
172
|
-
}, [
|
|
162
|
+
}, [options]);
|
|
173
163
|
const reset = useCallback(() => {
|
|
174
164
|
setData(null);
|
|
175
165
|
setError(null);
|
|
@@ -197,10 +187,9 @@ export function useCamera(options = {}) {
|
|
|
197
187
|
position: 'relative',
|
|
198
188
|
boxSizing: 'border-box',
|
|
199
189
|
background: 'transparent',
|
|
200
|
-
transform: mirror ? 'scaleX(-1)' : 'none',
|
|
201
190
|
pointerEvents: 'none',
|
|
202
191
|
},
|
|
203
|
-
}), [
|
|
192
|
+
}), []);
|
|
204
193
|
useEffect(() => {
|
|
205
194
|
return () => {
|
|
206
195
|
setData(null);
|
|
@@ -28,5 +28,5 @@ export function KYCDefault(props) {
|
|
|
28
28
|
session?.status !== 'unauthenticated';
|
|
29
29
|
return (_jsxs(_Fragment, { children: [_jsx(KYCDefaultContext, { value: kyc, children: _jsx(Dialog.Root, { open: isDialogOpen && !globalStore.responsibleGamingReminder.open, onOpenChange: (details) => {
|
|
30
30
|
globalStore.kyc.setOpen(details.open);
|
|
31
|
-
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "mx-auto
|
|
31
|
+
}, lazyMount: true, unmountOnExit: true, closeOnEscape: false, closeOnInteractOutside: false, onExitComplete: kyc.reset, children: _jsxs(Portal, { children: [_jsx(Dialog.Backdrop, {}), _jsx(Dialog.Positioner, { children: _jsx(Dialog.Content, { className: "mx-auto min-h-full w-full overflow-y-auto bg-bg-primary-alt lg:min-h-auto lg:w-fit", children: _jsxs("div", { className: "flex h-dvh w-full flex-col overflow-y-auto p-3xl sm:h-fit sm:overflow-auto lg:w-[400px]", children: [_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(IdentityVerification, {}), kyc.step === 2 && _jsx(PersonalInformation, {})] }) }) })] }) }) }), _jsx(KYCReminder, { ...props })] }));
|
|
32
32
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { usePathname } from 'next/navigation';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { useAccountQuery } from '../../client/hooks/useAccountQuery.js';
|
|
5
|
+
import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
|
|
5
6
|
import { useGlobalStore } from '../../client/hooks/useGlobalStore.js';
|
|
6
7
|
import { useMemberVerificationQuery } from '../../client/hooks/useMemberVerificationQuery.js';
|
|
7
|
-
import { useFeatureFlag } from '../../client/hooks/useFeatureFlag.js';
|
|
8
8
|
export function KycOpenOnHomeMount(props) {
|
|
9
9
|
const featureFlag = useFeatureFlag();
|
|
10
10
|
const setkycReminderOpen = useGlobalStore((s) => s.kycReminder.setOpen);
|
|
@@ -66,6 +66,8 @@ export function KycOpenOnHomeMount(props) {
|
|
|
66
66
|
accountLoading,
|
|
67
67
|
hasntCompletedKYC,
|
|
68
68
|
isVerificationLocked,
|
|
69
|
+
isPending,
|
|
70
|
+
featureFlag.enabled,
|
|
69
71
|
]);
|
|
70
72
|
return null;
|
|
71
73
|
}
|