@dubsdotapp/expo 0.2.58 → 0.2.60
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/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/usePushNotifications.ts +12 -1
- package/src/ui/UserProfileSheet.tsx +10 -3
package/dist/index.mjs
CHANGED
|
@@ -557,7 +557,7 @@ function createSecureStoreStorage() {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
// src/provider.tsx
|
|
560
|
-
import { createContext as createContext4, useContext as useContext4, useMemo as useMemo2, useCallback as useCallback15, useState as useState16, useEffect as
|
|
560
|
+
import { createContext as createContext4, useContext as useContext4, useMemo as useMemo2, useCallback as useCallback15, useState as useState16, useEffect as useEffect11 } from "react";
|
|
561
561
|
|
|
562
562
|
// src/ui/theme.ts
|
|
563
563
|
import { createContext, useContext } from "react";
|
|
@@ -1622,7 +1622,7 @@ function ManagedWalletProvider({
|
|
|
1622
1622
|
}
|
|
1623
1623
|
|
|
1624
1624
|
// src/ui/AuthGate.tsx
|
|
1625
|
-
import React2, { useState as useState15, useEffect as
|
|
1625
|
+
import React2, { useState as useState15, useEffect as useEffect10, useRef as useRef4, useCallback as useCallback14 } from "react";
|
|
1626
1626
|
import {
|
|
1627
1627
|
View as View2,
|
|
1628
1628
|
Text as Text2,
|
|
@@ -2310,7 +2310,7 @@ function useUFCFighterDetail(athleteId) {
|
|
|
2310
2310
|
}
|
|
2311
2311
|
|
|
2312
2312
|
// src/hooks/usePushNotifications.ts
|
|
2313
|
-
import { useState as useState14, useCallback as useCallback13, useRef as useRef3, useMemo } from "react";
|
|
2313
|
+
import { useState as useState14, useCallback as useCallback13, useRef as useRef3, useMemo, useEffect as useEffect9 } from "react";
|
|
2314
2314
|
import { Platform as Platform3 } from "react-native";
|
|
2315
2315
|
function usePushNotifications() {
|
|
2316
2316
|
const { client, appName } = useDubs();
|
|
@@ -2327,6 +2327,14 @@ function usePushNotifications() {
|
|
|
2327
2327
|
return null;
|
|
2328
2328
|
}
|
|
2329
2329
|
}, []);
|
|
2330
|
+
useEffect9(() => {
|
|
2331
|
+
const Notifications = getNotificationsModule();
|
|
2332
|
+
if (!Notifications) return;
|
|
2333
|
+
Notifications.getPermissionsAsync().then(({ status }) => {
|
|
2334
|
+
if (status === "granted") setHasPermission(true);
|
|
2335
|
+
}).catch(() => {
|
|
2336
|
+
});
|
|
2337
|
+
}, [getNotificationsModule]);
|
|
2330
2338
|
const getDeviceName = useCallback13(() => {
|
|
2331
2339
|
try {
|
|
2332
2340
|
const Device = __require("expo-device");
|
|
@@ -2461,7 +2469,7 @@ function AuthGate({
|
|
|
2461
2469
|
const [registrationPhase, setRegistrationPhase] = useState15(false);
|
|
2462
2470
|
const [showPushSetup, setShowPushSetup] = useState15(false);
|
|
2463
2471
|
const [isRestoredSession, setIsRestoredSession] = useState15(false);
|
|
2464
|
-
|
|
2472
|
+
useEffect10(() => {
|
|
2465
2473
|
let cancelled = false;
|
|
2466
2474
|
(async () => {
|
|
2467
2475
|
try {
|
|
@@ -2488,15 +2496,15 @@ function AuthGate({
|
|
|
2488
2496
|
cancelled = true;
|
|
2489
2497
|
};
|
|
2490
2498
|
}, []);
|
|
2491
|
-
|
|
2499
|
+
useEffect10(() => {
|
|
2492
2500
|
if (auth.status === "needsRegistration") setRegistrationPhase(true);
|
|
2493
2501
|
}, [auth.status]);
|
|
2494
|
-
|
|
2502
|
+
useEffect10(() => {
|
|
2495
2503
|
if (auth.status === "authenticated" && registrationPhase && !isRestoredSession) {
|
|
2496
2504
|
setShowPushSetup(true);
|
|
2497
2505
|
}
|
|
2498
2506
|
}, [auth.status, registrationPhase, isRestoredSession]);
|
|
2499
|
-
|
|
2507
|
+
useEffect10(() => {
|
|
2500
2508
|
if (auth.token) onSaveToken(auth.token);
|
|
2501
2509
|
}, [auth.token]);
|
|
2502
2510
|
const retry = useCallback14(() => {
|
|
@@ -2632,7 +2640,7 @@ function DefaultRegistrationScreen({
|
|
|
2632
2640
|
const fadeAnim = useRef4(new Animated.Value(1)).current;
|
|
2633
2641
|
const slideAnim = useRef4(new Animated.Value(0)).current;
|
|
2634
2642
|
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed);
|
|
2635
|
-
|
|
2643
|
+
useEffect10(() => {
|
|
2636
2644
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
2637
2645
|
const trimmed = username.trim();
|
|
2638
2646
|
if (trimmed.length < 3) {
|
|
@@ -2892,7 +2900,7 @@ function DefaultRegistrationScreen({
|
|
|
2892
2900
|
function PushTokenRestorer() {
|
|
2893
2901
|
const push = usePushNotifications();
|
|
2894
2902
|
const restored = useRef4(false);
|
|
2895
|
-
|
|
2903
|
+
useEffect10(() => {
|
|
2896
2904
|
if (restored.current) return;
|
|
2897
2905
|
restored.current = true;
|
|
2898
2906
|
push.restoreIfGranted();
|
|
@@ -2909,7 +2917,7 @@ function PushSetupScreen({
|
|
|
2909
2917
|
const push = usePushNotifications();
|
|
2910
2918
|
const fadeAnim = useRef4(new Animated.Value(0)).current;
|
|
2911
2919
|
const slideAnim = useRef4(new Animated.Value(30)).current;
|
|
2912
|
-
|
|
2920
|
+
useEffect10(() => {
|
|
2913
2921
|
Animated.parallel([
|
|
2914
2922
|
Animated.timing(fadeAnim, { toValue: 1, duration: 300, useNativeDriver: true }),
|
|
2915
2923
|
Animated.timing(slideAnim, { toValue: 0, duration: 300, useNativeDriver: true })
|
|
@@ -3071,7 +3079,7 @@ function DubsProvider({
|
|
|
3071
3079
|
const connection = useMemo2(() => new Connection2(rpcUrl, { commitment: "confirmed" }), [rpcUrl]);
|
|
3072
3080
|
const storage = useMemo2(() => tokenStorage || createSecureStoreStorage(), [tokenStorage]);
|
|
3073
3081
|
const [uiConfig, setUiConfig] = useState16(null);
|
|
3074
|
-
|
|
3082
|
+
useEffect11(() => {
|
|
3075
3083
|
client.getAppConfig().then((config2) => {
|
|
3076
3084
|
console.log("[DubsProvider] UI config loaded:", JSON.stringify(config2));
|
|
3077
3085
|
setUiConfig(config2);
|
|
@@ -3455,7 +3463,7 @@ var styles3 = StyleSheet4.create({
|
|
|
3455
3463
|
});
|
|
3456
3464
|
|
|
3457
3465
|
// src/ui/UserProfileSheet.tsx
|
|
3458
|
-
import { useState as useState17, useEffect as
|
|
3466
|
+
import { useState as useState17, useEffect as useEffect12, useRef as useRef5, useCallback as useCallback16, useMemo as useMemo4 } from "react";
|
|
3459
3467
|
import {
|
|
3460
3468
|
View as View5,
|
|
3461
3469
|
Text as Text5,
|
|
@@ -3467,7 +3475,8 @@ import {
|
|
|
3467
3475
|
KeyboardAvoidingView as KeyboardAvoidingView2,
|
|
3468
3476
|
Platform as Platform5,
|
|
3469
3477
|
Image as Image4,
|
|
3470
|
-
ScrollView as ScrollView3
|
|
3478
|
+
ScrollView as ScrollView3,
|
|
3479
|
+
Dimensions
|
|
3471
3480
|
} from "react-native";
|
|
3472
3481
|
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3473
3482
|
var DICEBEAR_STYLES2 = [
|
|
@@ -3513,19 +3522,19 @@ function UserProfileSheet({
|
|
|
3513
3522
|
const [avatarSeed, setAvatarSeed] = useState17(parsed.seed);
|
|
3514
3523
|
const [saving, setSaving] = useState17(false);
|
|
3515
3524
|
const [error, setError] = useState17(null);
|
|
3516
|
-
|
|
3525
|
+
useEffect12(() => {
|
|
3517
3526
|
const p = parseAvatarUrl(user.avatar);
|
|
3518
3527
|
setAvatarStyle(p.style);
|
|
3519
3528
|
setAvatarSeed(p.seed);
|
|
3520
3529
|
}, [user.avatar]);
|
|
3521
|
-
|
|
3530
|
+
useEffect12(() => {
|
|
3522
3531
|
Animated2.timing(overlayOpacity, {
|
|
3523
3532
|
toValue: visible ? 1 : 0,
|
|
3524
3533
|
duration: 250,
|
|
3525
3534
|
useNativeDriver: true
|
|
3526
3535
|
}).start();
|
|
3527
3536
|
}, [visible, overlayOpacity]);
|
|
3528
|
-
|
|
3537
|
+
useEffect12(() => {
|
|
3529
3538
|
if (visible) setError(null);
|
|
3530
3539
|
}, [visible]);
|
|
3531
3540
|
const currentAvatarUrl = getAvatarUrl2(avatarStyle, avatarSeed);
|
|
@@ -3678,6 +3687,7 @@ function UserProfileSheet({
|
|
|
3678
3687
|
}
|
|
3679
3688
|
)
|
|
3680
3689
|
] }),
|
|
3690
|
+
push.error ? /* @__PURE__ */ jsx7(View5, { style: [styles4.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx7(Text5, { style: [styles4.errorText, { color: t.errorText }], children: push.error.message }) }) : null,
|
|
3681
3691
|
onDisconnect ? /* @__PURE__ */ jsx7(
|
|
3682
3692
|
TouchableOpacity4,
|
|
3683
3693
|
{
|
|
@@ -3716,9 +3726,8 @@ var styles4 = StyleSheet5.create({
|
|
|
3716
3726
|
borderTopLeftRadius: 24,
|
|
3717
3727
|
borderTopRightRadius: 24,
|
|
3718
3728
|
paddingHorizontal: 20,
|
|
3719
|
-
paddingBottom:
|
|
3720
|
-
|
|
3721
|
-
maxHeight: "92%"
|
|
3729
|
+
paddingBottom: 0,
|
|
3730
|
+
height: Dimensions.get("window").height * 0.7
|
|
3722
3731
|
},
|
|
3723
3732
|
handleRow: {
|
|
3724
3733
|
alignItems: "center",
|
|
@@ -4347,7 +4356,7 @@ var styles9 = StyleSheet10.create({
|
|
|
4347
4356
|
});
|
|
4348
4357
|
|
|
4349
4358
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4350
|
-
import { useState as useState21, useEffect as
|
|
4359
|
+
import { useState as useState21, useEffect as useEffect13, useRef as useRef6, useCallback as useCallback17 } from "react";
|
|
4351
4360
|
import {
|
|
4352
4361
|
View as View11,
|
|
4353
4362
|
Text as Text11,
|
|
@@ -4388,14 +4397,14 @@ function CreateCustomGameSheet({
|
|
|
4388
4397
|
const [customAmount, setCustomAmount] = useState21("");
|
|
4389
4398
|
const [isCustom, setIsCustom] = useState21(false);
|
|
4390
4399
|
const overlayOpacity = useRef6(new Animated3.Value(0)).current;
|
|
4391
|
-
|
|
4400
|
+
useEffect13(() => {
|
|
4392
4401
|
Animated3.timing(overlayOpacity, {
|
|
4393
4402
|
toValue: visible ? 1 : 0,
|
|
4394
4403
|
duration: 250,
|
|
4395
4404
|
useNativeDriver: true
|
|
4396
4405
|
}).start();
|
|
4397
4406
|
}, [visible, overlayOpacity]);
|
|
4398
|
-
|
|
4407
|
+
useEffect13(() => {
|
|
4399
4408
|
if (visible) {
|
|
4400
4409
|
setSelectedAmount(defaultAmount ?? null);
|
|
4401
4410
|
setCustomAmount("");
|
|
@@ -4403,7 +4412,7 @@ function CreateCustomGameSheet({
|
|
|
4403
4412
|
mutation.reset();
|
|
4404
4413
|
}
|
|
4405
4414
|
}, [visible]);
|
|
4406
|
-
|
|
4415
|
+
useEffect13(() => {
|
|
4407
4416
|
if (mutation.status === "success" && mutation.data) {
|
|
4408
4417
|
onSuccess?.(mutation.data);
|
|
4409
4418
|
const timer = setTimeout(() => {
|
|
@@ -4412,7 +4421,7 @@ function CreateCustomGameSheet({
|
|
|
4412
4421
|
return () => clearTimeout(timer);
|
|
4413
4422
|
}
|
|
4414
4423
|
}, [mutation.status, mutation.data]);
|
|
4415
|
-
|
|
4424
|
+
useEffect13(() => {
|
|
4416
4425
|
if (mutation.status === "error" && mutation.error) {
|
|
4417
4426
|
onError?.(mutation.error);
|
|
4418
4427
|
}
|
|
@@ -4712,7 +4721,7 @@ var styles10 = StyleSheet11.create({
|
|
|
4712
4721
|
});
|
|
4713
4722
|
|
|
4714
4723
|
// src/ui/game/JoinGameSheet.tsx
|
|
4715
|
-
import { useState as useState22, useEffect as
|
|
4724
|
+
import { useState as useState22, useEffect as useEffect14, useRef as useRef7, useCallback as useCallback18, useMemo as useMemo8 } from "react";
|
|
4716
4725
|
import {
|
|
4717
4726
|
View as View12,
|
|
4718
4727
|
Text as Text12,
|
|
@@ -4750,20 +4759,20 @@ function JoinGameSheet({
|
|
|
4750
4759
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
4751
4760
|
const [selectedTeam, setSelectedTeam] = useState22(null);
|
|
4752
4761
|
const overlayOpacity = useRef7(new Animated4.Value(0)).current;
|
|
4753
|
-
|
|
4762
|
+
useEffect14(() => {
|
|
4754
4763
|
Animated4.timing(overlayOpacity, {
|
|
4755
4764
|
toValue: visible ? 1 : 0,
|
|
4756
4765
|
duration: 250,
|
|
4757
4766
|
useNativeDriver: true
|
|
4758
4767
|
}).start();
|
|
4759
4768
|
}, [visible, overlayOpacity]);
|
|
4760
|
-
|
|
4769
|
+
useEffect14(() => {
|
|
4761
4770
|
if (visible) {
|
|
4762
4771
|
setSelectedTeam(isPoolModeEnabled ? "home" : isCustomGame ? "away" : null);
|
|
4763
4772
|
mutation.reset();
|
|
4764
4773
|
}
|
|
4765
4774
|
}, [visible]);
|
|
4766
|
-
|
|
4775
|
+
useEffect14(() => {
|
|
4767
4776
|
if (mutation.status === "success" && mutation.data) {
|
|
4768
4777
|
onSuccess?.(mutation.data);
|
|
4769
4778
|
const timer = setTimeout(() => {
|
|
@@ -4772,7 +4781,7 @@ function JoinGameSheet({
|
|
|
4772
4781
|
return () => clearTimeout(timer);
|
|
4773
4782
|
}
|
|
4774
4783
|
}, [mutation.status, mutation.data]);
|
|
4775
|
-
|
|
4784
|
+
useEffect14(() => {
|
|
4776
4785
|
if (mutation.status === "error" && mutation.error) {
|
|
4777
4786
|
onError?.(mutation.error);
|
|
4778
4787
|
}
|
|
@@ -5123,7 +5132,7 @@ var styles11 = StyleSheet12.create({
|
|
|
5123
5132
|
});
|
|
5124
5133
|
|
|
5125
5134
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5126
|
-
import { useState as useState23, useEffect as
|
|
5135
|
+
import { useState as useState23, useEffect as useEffect15, useRef as useRef8, useCallback as useCallback19 } from "react";
|
|
5127
5136
|
import {
|
|
5128
5137
|
View as View13,
|
|
5129
5138
|
Text as Text13,
|
|
@@ -5158,14 +5167,14 @@ function ClaimPrizeSheet({
|
|
|
5158
5167
|
const celebrationScale = useRef8(new Animated5.Value(0)).current;
|
|
5159
5168
|
const celebrationOpacity = useRef8(new Animated5.Value(0)).current;
|
|
5160
5169
|
const [showCelebration, setShowCelebration] = useState23(false);
|
|
5161
|
-
|
|
5170
|
+
useEffect15(() => {
|
|
5162
5171
|
Animated5.timing(overlayOpacity, {
|
|
5163
5172
|
toValue: visible ? 1 : 0,
|
|
5164
5173
|
duration: 250,
|
|
5165
5174
|
useNativeDriver: true
|
|
5166
5175
|
}).start();
|
|
5167
5176
|
}, [visible, overlayOpacity]);
|
|
5168
|
-
|
|
5177
|
+
useEffect15(() => {
|
|
5169
5178
|
if (visible) {
|
|
5170
5179
|
mutation.reset();
|
|
5171
5180
|
setShowCelebration(false);
|
|
@@ -5173,7 +5182,7 @@ function ClaimPrizeSheet({
|
|
|
5173
5182
|
celebrationOpacity.setValue(0);
|
|
5174
5183
|
}
|
|
5175
5184
|
}, [visible]);
|
|
5176
|
-
|
|
5185
|
+
useEffect15(() => {
|
|
5177
5186
|
if (mutation.status === "success" && mutation.data) {
|
|
5178
5187
|
setShowCelebration(true);
|
|
5179
5188
|
Animated5.parallel([
|
|
@@ -5196,7 +5205,7 @@ function ClaimPrizeSheet({
|
|
|
5196
5205
|
return () => clearTimeout(timer);
|
|
5197
5206
|
}
|
|
5198
5207
|
}, [mutation.status, mutation.data]);
|
|
5199
|
-
|
|
5208
|
+
useEffect15(() => {
|
|
5200
5209
|
if (mutation.status === "error" && mutation.error) {
|
|
5201
5210
|
onError?.(mutation.error);
|
|
5202
5211
|
}
|