@dubsdotapp/expo 0.2.77 → 0.2.79
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 +659 -672
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +641 -647
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/AuthGate.tsx +12 -52
- package/src/ui/AvatarEditor.tsx +159 -0
- package/src/ui/UserProfileSheet.tsx +22 -139
package/dist/index.js
CHANGED
|
@@ -1695,7 +1695,7 @@ function ManagedWalletProvider({
|
|
|
1695
1695
|
|
|
1696
1696
|
// src/ui/AuthGate.tsx
|
|
1697
1697
|
var import_react17 = __toESM(require("react"));
|
|
1698
|
-
var
|
|
1698
|
+
var import_react_native8 = require("react-native");
|
|
1699
1699
|
|
|
1700
1700
|
// src/hooks/useEvents.ts
|
|
1701
1701
|
var import_react3 = require("react");
|
|
@@ -2526,7 +2526,8 @@ function usePushNotifications() {
|
|
|
2526
2526
|
};
|
|
2527
2527
|
}
|
|
2528
2528
|
|
|
2529
|
-
// src/ui/
|
|
2529
|
+
// src/ui/AvatarEditor.tsx
|
|
2530
|
+
var import_react_native7 = require("react-native");
|
|
2530
2531
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2531
2532
|
var DICEBEAR_STYLES = [
|
|
2532
2533
|
"adventurer",
|
|
@@ -2554,6 +2555,125 @@ function generateSeed() {
|
|
|
2554
2555
|
function getAvatarUrl(style, seed, bg = "1a1a2e", size = 256) {
|
|
2555
2556
|
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
2556
2557
|
}
|
|
2558
|
+
function parseAvatarUrl(url) {
|
|
2559
|
+
if (!url) return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2560
|
+
try {
|
|
2561
|
+
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
2562
|
+
if (match) {
|
|
2563
|
+
const bgMatch = url.match(/backgroundColor=([^&]+)/);
|
|
2564
|
+
return { style: match[1], seed: match[2], bg: bgMatch?.[1] || "1a1a2e" };
|
|
2565
|
+
}
|
|
2566
|
+
} catch {
|
|
2567
|
+
}
|
|
2568
|
+
return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2569
|
+
}
|
|
2570
|
+
function AvatarEditor({
|
|
2571
|
+
style: avatarStyle,
|
|
2572
|
+
seed: avatarSeed,
|
|
2573
|
+
bg: bgColor,
|
|
2574
|
+
onStyleChange,
|
|
2575
|
+
onSeedChange,
|
|
2576
|
+
onBgChange,
|
|
2577
|
+
disabled = false,
|
|
2578
|
+
accentColor
|
|
2579
|
+
}) {
|
|
2580
|
+
const t = useDubsTheme();
|
|
2581
|
+
const accent = accentColor || t.accent;
|
|
2582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native7.View, { style: styles2.container, children: [
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2584
|
+
import_react_native7.ScrollView,
|
|
2585
|
+
{
|
|
2586
|
+
horizontal: true,
|
|
2587
|
+
showsHorizontalScrollIndicator: false,
|
|
2588
|
+
contentContainerStyle: styles2.row,
|
|
2589
|
+
children: DICEBEAR_STYLES.map((st) => {
|
|
2590
|
+
const isSelected = st === avatarStyle;
|
|
2591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2592
|
+
import_react_native7.TouchableOpacity,
|
|
2593
|
+
{
|
|
2594
|
+
onPress: () => onStyleChange(st),
|
|
2595
|
+
activeOpacity: 0.7,
|
|
2596
|
+
disabled,
|
|
2597
|
+
style: [
|
|
2598
|
+
styles2.styleTile,
|
|
2599
|
+
{
|
|
2600
|
+
borderColor: isSelected ? accent : t.border,
|
|
2601
|
+
borderWidth: isSelected ? 2 : 1
|
|
2602
|
+
}
|
|
2603
|
+
],
|
|
2604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2605
|
+
import_react_native7.Image,
|
|
2606
|
+
{
|
|
2607
|
+
source: { uri: getAvatarUrl(st, avatarSeed, bgColor, 80) },
|
|
2608
|
+
style: styles2.styleTileImage
|
|
2609
|
+
}
|
|
2610
|
+
)
|
|
2611
|
+
},
|
|
2612
|
+
st
|
|
2613
|
+
);
|
|
2614
|
+
})
|
|
2615
|
+
}
|
|
2616
|
+
),
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.Text, { style: [styles2.label, { color: t.textSecondary }], children: "Background Color" }),
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2619
|
+
import_react_native7.ScrollView,
|
|
2620
|
+
{
|
|
2621
|
+
horizontal: true,
|
|
2622
|
+
showsHorizontalScrollIndicator: false,
|
|
2623
|
+
contentContainerStyle: styles2.row,
|
|
2624
|
+
children: BG_COLORS.map((color) => {
|
|
2625
|
+
const isSelected = color === bgColor;
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2627
|
+
import_react_native7.TouchableOpacity,
|
|
2628
|
+
{
|
|
2629
|
+
onPress: () => onBgChange(color),
|
|
2630
|
+
activeOpacity: 0.7,
|
|
2631
|
+
disabled,
|
|
2632
|
+
style: [
|
|
2633
|
+
styles2.colorSwatch,
|
|
2634
|
+
{ backgroundColor: `#${color}` },
|
|
2635
|
+
isSelected && { borderColor: accent, borderWidth: 2.5 }
|
|
2636
|
+
]
|
|
2637
|
+
},
|
|
2638
|
+
color
|
|
2639
|
+
);
|
|
2640
|
+
})
|
|
2641
|
+
}
|
|
2642
|
+
)
|
|
2643
|
+
] });
|
|
2644
|
+
}
|
|
2645
|
+
var styles2 = import_react_native7.StyleSheet.create({
|
|
2646
|
+
container: {
|
|
2647
|
+
gap: 10
|
|
2648
|
+
},
|
|
2649
|
+
row: {
|
|
2650
|
+
gap: 10
|
|
2651
|
+
},
|
|
2652
|
+
label: {
|
|
2653
|
+
fontSize: 14,
|
|
2654
|
+
fontWeight: "600"
|
|
2655
|
+
},
|
|
2656
|
+
styleTile: {
|
|
2657
|
+
width: 72,
|
|
2658
|
+
height: 72,
|
|
2659
|
+
borderRadius: 16,
|
|
2660
|
+
overflow: "hidden"
|
|
2661
|
+
},
|
|
2662
|
+
styleTileImage: {
|
|
2663
|
+
width: "100%",
|
|
2664
|
+
height: "100%"
|
|
2665
|
+
},
|
|
2666
|
+
colorSwatch: {
|
|
2667
|
+
width: 32,
|
|
2668
|
+
height: 32,
|
|
2669
|
+
borderRadius: 16,
|
|
2670
|
+
borderWidth: 1.5,
|
|
2671
|
+
borderColor: "rgba(255,255,255,0.15)"
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
// src/ui/AuthGate.tsx
|
|
2676
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2557
2677
|
function AuthGate({
|
|
2558
2678
|
children,
|
|
2559
2679
|
onSaveToken,
|
|
@@ -2620,12 +2740,12 @@ function AuthGate({
|
|
|
2620
2740
|
[auth]
|
|
2621
2741
|
);
|
|
2622
2742
|
if (phase === "init") {
|
|
2623
|
-
if (renderLoading) return /* @__PURE__ */ (0,
|
|
2624
|
-
return /* @__PURE__ */ (0,
|
|
2743
|
+
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading("authenticating") });
|
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: "authenticating", appName, accentColor });
|
|
2625
2745
|
}
|
|
2626
2746
|
if (auth.status === "authenticated") {
|
|
2627
2747
|
if (showPushSetup) {
|
|
2628
|
-
return /* @__PURE__ */ (0,
|
|
2748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2629
2749
|
PushSetupScreen,
|
|
2630
2750
|
{
|
|
2631
2751
|
accentColor,
|
|
@@ -2634,8 +2754,8 @@ function AuthGate({
|
|
|
2634
2754
|
}
|
|
2635
2755
|
);
|
|
2636
2756
|
}
|
|
2637
|
-
return /* @__PURE__ */ (0,
|
|
2638
|
-
pushEnabled && /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(AuthContext.Provider, { value: auth, children: [
|
|
2758
|
+
pushEnabled && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PushTokenRestorer, {}),
|
|
2639
2759
|
children
|
|
2640
2760
|
] });
|
|
2641
2761
|
}
|
|
@@ -2643,9 +2763,9 @@ function AuthGate({
|
|
|
2643
2763
|
const isRegistering = auth.status === "registering";
|
|
2644
2764
|
const regError = auth.status === "error" ? auth.error : null;
|
|
2645
2765
|
if (renderRegistration) {
|
|
2646
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderRegistration({ onRegister: handleRegister, registering: isRegistering, error: regError, client }) });
|
|
2647
2767
|
}
|
|
2648
|
-
return /* @__PURE__ */ (0,
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2649
2769
|
DefaultRegistrationScreen,
|
|
2650
2770
|
{
|
|
2651
2771
|
onRegister: handleRegister,
|
|
@@ -2658,11 +2778,11 @@ function AuthGate({
|
|
|
2658
2778
|
);
|
|
2659
2779
|
}
|
|
2660
2780
|
if (auth.status === "error" && auth.error) {
|
|
2661
|
-
if (renderError) return /* @__PURE__ */ (0,
|
|
2662
|
-
return /* @__PURE__ */ (0,
|
|
2781
|
+
if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderError(auth.error, retry) });
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
|
|
2663
2783
|
}
|
|
2664
|
-
if (renderLoading) return /* @__PURE__ */ (0,
|
|
2665
|
-
return /* @__PURE__ */ (0,
|
|
2784
|
+
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading(auth.status) });
|
|
2785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
2666
2786
|
}
|
|
2667
2787
|
function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
2668
2788
|
const t = useDubsTheme();
|
|
@@ -2677,44 +2797,44 @@ function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
|
2677
2797
|
authenticated: "Ready!",
|
|
2678
2798
|
error: "Something went wrong"
|
|
2679
2799
|
};
|
|
2680
|
-
return /* @__PURE__ */ (0,
|
|
2681
|
-
/* @__PURE__ */ (0,
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2683
|
-
/* @__PURE__ */ (0,
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.centerContent, children: [
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.brandingSection, children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.logoText, children: "D" }) }),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2684
2804
|
] }),
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2686
|
-
/* @__PURE__ */ (0,
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.loadingSection, children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { size: "large", color: accent }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.statusText, { color: t.textMuted }], children: statusText[status] || "Loading..." })
|
|
2688
2808
|
] })
|
|
2689
2809
|
] }) });
|
|
2690
2810
|
}
|
|
2691
2811
|
function DefaultErrorScreen({ error, onRetry, appName, accentColor }) {
|
|
2692
2812
|
const t = useDubsTheme();
|
|
2693
2813
|
const accent = accentColor || t.accent;
|
|
2694
|
-
return /* @__PURE__ */ (0,
|
|
2695
|
-
/* @__PURE__ */ (0,
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2697
|
-
/* @__PURE__ */ (0,
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.spreadContent, children: [
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.brandingSection, children: [
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.logoText, children: "D" }) }),
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2698
2818
|
] }),
|
|
2699
|
-
/* @__PURE__ */ (0,
|
|
2700
|
-
/* @__PURE__ */ (0,
|
|
2701
|
-
/* @__PURE__ */ (0,
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: { gap: 16 }, children: [
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.errorText, { color: t.errorText }], children: error.message }) }),
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { style: [s.primaryBtn, { backgroundColor: accent }], onPress: onRetry, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Try Again" }) })
|
|
2702
2822
|
] })
|
|
2703
2823
|
] }) });
|
|
2704
2824
|
}
|
|
2705
2825
|
function StepIndicator({ currentStep }) {
|
|
2706
2826
|
const t = useDubsTheme();
|
|
2707
2827
|
const steps = [0, 1, 2, 3];
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
2709
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2711
|
-
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.stepRow, children: steps.map((i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react17.default.Fragment, { children: [
|
|
2829
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.stepLine, { backgroundColor: i <= currentStep ? t.success : t.border }] }),
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2831
|
+
import_react_native8.View,
|
|
2712
2832
|
{
|
|
2713
2833
|
style: [
|
|
2714
2834
|
s.stepCircle,
|
|
2715
2835
|
i < currentStep ? { backgroundColor: t.success } : i === currentStep ? { backgroundColor: t.accent } : { backgroundColor: "transparent", borderWidth: 2, borderColor: t.border }
|
|
2716
2836
|
],
|
|
2717
|
-
children: i < currentStep ? /* @__PURE__ */ (0,
|
|
2837
|
+
children: i < currentStep ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.stepCheck, children: "\u2713" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.stepNum, { color: i === currentStep ? "#FFF" : t.textMuted }], children: i + 1 })
|
|
2718
2838
|
}
|
|
2719
2839
|
)
|
|
2720
2840
|
] }, i)) });
|
|
@@ -2739,8 +2859,8 @@ function DefaultRegistrationScreen({
|
|
|
2739
2859
|
const [checking, setChecking] = (0, import_react17.useState)(false);
|
|
2740
2860
|
const [availability, setAvailability] = (0, import_react17.useState)(null);
|
|
2741
2861
|
const debounceRef = (0, import_react17.useRef)(null);
|
|
2742
|
-
const fadeAnim = (0, import_react17.useRef)(new
|
|
2743
|
-
const slideAnim = (0, import_react17.useRef)(new
|
|
2862
|
+
const fadeAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(1)).current;
|
|
2863
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(0)).current;
|
|
2744
2864
|
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed, avatarBg);
|
|
2745
2865
|
(0, import_react17.useEffect)(() => {
|
|
2746
2866
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
@@ -2767,107 +2887,95 @@ function DefaultRegistrationScreen({
|
|
|
2767
2887
|
}, [username, client]);
|
|
2768
2888
|
const animateToStep = (0, import_react17.useCallback)((newStep) => {
|
|
2769
2889
|
const dir = newStep > step ? 1 : -1;
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2890
|
+
import_react_native8.Keyboard.dismiss();
|
|
2891
|
+
import_react_native8.Animated.parallel([
|
|
2892
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 0, duration: 120, useNativeDriver: true }),
|
|
2893
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: -dir * 40, duration: 120, useNativeDriver: true })
|
|
2774
2894
|
]).start(() => {
|
|
2775
2895
|
setStep(newStep);
|
|
2776
2896
|
slideAnim.setValue(dir * 40);
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2897
|
+
import_react_native8.Animated.parallel([
|
|
2898
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 1, duration: 200, useNativeDriver: true }),
|
|
2899
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: 0, duration: 200, useNativeDriver: true })
|
|
2780
2900
|
]).start();
|
|
2781
2901
|
});
|
|
2782
2902
|
}, [step, fadeAnim, slideAnim]);
|
|
2783
2903
|
const canContinueUsername = username.trim().length >= 3 && availability?.available === true && !checking;
|
|
2784
2904
|
const handleSubmit = () => {
|
|
2785
|
-
|
|
2905
|
+
import_react_native8.Keyboard.dismiss();
|
|
2786
2906
|
onRegister(username.trim(), referralCode.trim() || void 0, avatarUrl);
|
|
2787
2907
|
};
|
|
2788
|
-
const renderAvatarStep = () => /* @__PURE__ */ (0,
|
|
2789
|
-
/* @__PURE__ */ (0,
|
|
2790
|
-
/* @__PURE__ */ (0,
|
|
2791
|
-
/* @__PURE__ */ (0,
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
const renderAvatarStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.title, { color: t.text }], children: "Choose Your Avatar" }),
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Pick a look that represents you" }),
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 0 }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.avatarFrame, { borderColor: accent }], children: [
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.avatarLarge }),
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.checkBadge, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.checkBadgeText, children: "\u2713" }) })
|
|
2796
2916
|
] }) }),
|
|
2797
|
-
/* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.avatarActions, children: [
|
|
2918
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2919
|
+
import_react_native8.TouchableOpacity,
|
|
2800
2920
|
{
|
|
2801
2921
|
style: [s.outlineBtn, { borderColor: t.border }],
|
|
2802
2922
|
onPress: () => setAvatarSeed(generateSeed()),
|
|
2803
2923
|
activeOpacity: 0.7,
|
|
2804
|
-
children: /* @__PURE__ */ (0,
|
|
2924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.outlineBtnText, { color: t.text }], children: "\u21BB Shuffle" })
|
|
2805
2925
|
}
|
|
2806
2926
|
),
|
|
2807
|
-
/* @__PURE__ */ (0,
|
|
2808
|
-
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2928
|
+
import_react_native8.TouchableOpacity,
|
|
2809
2929
|
{
|
|
2810
2930
|
style: [s.outlineBtn, { borderColor: accent, backgroundColor: accent + "15" }],
|
|
2811
2931
|
onPress: () => setShowStyles(!showStyles),
|
|
2812
2932
|
activeOpacity: 0.7,
|
|
2813
|
-
children: /* @__PURE__ */ (0,
|
|
2933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.outlineBtnText, { color: accent }], children: "\u263A Customize" })
|
|
2814
2934
|
}
|
|
2815
2935
|
)
|
|
2816
2936
|
] }),
|
|
2817
|
-
showStyles && /* @__PURE__ */ (0,
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
import_react_native7.TouchableOpacity,
|
|
2830
|
-
{
|
|
2831
|
-
onPress: () => setAvatarBg(color),
|
|
2832
|
-
style: [
|
|
2833
|
-
s.colorSwatch,
|
|
2834
|
-
{ backgroundColor: `#${color}` },
|
|
2835
|
-
color === avatarBg && { borderColor: accent, borderWidth: 2.5 }
|
|
2836
|
-
]
|
|
2837
|
-
},
|
|
2838
|
-
color
|
|
2839
|
-
)) })
|
|
2840
|
-
] })
|
|
2937
|
+
showStyles && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.styleScroll, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2938
|
+
AvatarEditor,
|
|
2939
|
+
{
|
|
2940
|
+
style: avatarStyle,
|
|
2941
|
+
seed: avatarSeed,
|
|
2942
|
+
bg: avatarBg,
|
|
2943
|
+
onStyleChange: setAvatarStyle,
|
|
2944
|
+
onSeedChange: setAvatarSeed,
|
|
2945
|
+
onBgChange: setAvatarBg,
|
|
2946
|
+
accentColor: accent
|
|
2947
|
+
}
|
|
2948
|
+
) })
|
|
2841
2949
|
] }),
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2843
|
-
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.bottomRow, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2951
|
+
import_react_native8.TouchableOpacity,
|
|
2844
2952
|
{
|
|
2845
2953
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1 }],
|
|
2846
2954
|
onPress: () => animateToStep(1),
|
|
2847
2955
|
activeOpacity: 0.8,
|
|
2848
|
-
children: /* @__PURE__ */ (0,
|
|
2956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2849
2957
|
}
|
|
2850
2958
|
) })
|
|
2851
2959
|
] });
|
|
2852
|
-
const renderUsernameStep = () => /* @__PURE__ */ (0,
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2960
|
+
const renderUsernameStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.headerRow, children: [
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { onPress: () => animateToStep(0), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.titleInline, { color: t.text }], children: "Pick a Username" })
|
|
2857
2965
|
] }),
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2966
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "This is how others will see you" }),
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 1 }),
|
|
2968
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.avatarFrameSmall, { borderColor: accent }], children: [
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.avatarSmall }),
|
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.checkBadgeSm, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.checkBadgeTextSm, children: "\u2713" }) })
|
|
2863
2971
|
] }) }),
|
|
2864
|
-
/* @__PURE__ */ (0,
|
|
2865
|
-
/* @__PURE__ */ (0,
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.inputGroup, children: [
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2866
2974
|
"Username ",
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: { color: t.errorText }, children: "*" })
|
|
2868
2976
|
] }),
|
|
2869
|
-
/* @__PURE__ */ (0,
|
|
2870
|
-
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2978
|
+
import_react_native8.TextInput,
|
|
2871
2979
|
{
|
|
2872
2980
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: accent }],
|
|
2873
2981
|
placeholder: "Enter username",
|
|
@@ -2879,63 +2987,63 @@ function DefaultRegistrationScreen({
|
|
|
2879
2987
|
autoFocus: true
|
|
2880
2988
|
}
|
|
2881
2989
|
),
|
|
2882
|
-
checking ? /* @__PURE__ */ (0,
|
|
2990
|
+
checking ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: t.textDim }], children: "Checking..." }) : availability ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: availability.available ? t.success : t.errorText }], children: availability.available ? "\u2713 Available!" : availability.reason || "Username taken" }) : username.trim().length > 0 && username.trim().length < 3 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: t.textDim }], children: "At least 3 characters" }) : null
|
|
2883
2991
|
] })
|
|
2884
2992
|
] }),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2995
|
+
import_react_native8.TouchableOpacity,
|
|
2888
2996
|
{
|
|
2889
2997
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2890
2998
|
onPress: () => animateToStep(0),
|
|
2891
2999
|
activeOpacity: 0.7,
|
|
2892
|
-
children: /* @__PURE__ */ (0,
|
|
3000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2893
3001
|
}
|
|
2894
3002
|
),
|
|
2895
|
-
/* @__PURE__ */ (0,
|
|
2896
|
-
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3004
|
+
import_react_native8.TouchableOpacity,
|
|
2897
3005
|
{
|
|
2898
3006
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: canContinueUsername ? 1 : 0.4 }],
|
|
2899
3007
|
onPress: () => animateToStep(2),
|
|
2900
3008
|
disabled: !canContinueUsername,
|
|
2901
3009
|
activeOpacity: 0.8,
|
|
2902
|
-
children: /* @__PURE__ */ (0,
|
|
3010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2903
3011
|
}
|
|
2904
3012
|
)
|
|
2905
3013
|
] })
|
|
2906
3014
|
] });
|
|
2907
|
-
const renderReferralStep = () => /* @__PURE__ */ (0,
|
|
2908
|
-
/* @__PURE__ */ (0,
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
2910
|
-
/* @__PURE__ */ (0,
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
3015
|
+
const renderReferralStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.headerRow, children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { onPress: () => animateToStep(1), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.titleInline, { color: t.text }], children: "Almost There!" })
|
|
2912
3020
|
] }),
|
|
2913
|
-
/* @__PURE__ */ (0,
|
|
2914
|
-
/* @__PURE__ */ (0,
|
|
2915
|
-
/* @__PURE__ */ (0,
|
|
2916
|
-
/* @__PURE__ */ (0,
|
|
2917
|
-
/* @__PURE__ */ (0,
|
|
2918
|
-
/* @__PURE__ */ (0,
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
2920
|
-
/* @__PURE__ */ (0,
|
|
3021
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Got a referral code? (optional)" }),
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 2 }),
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.profileCard, { borderColor: t.border }], children: [
|
|
3024
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.profileLabel, { color: t.textMuted }], children: "Your Profile" }),
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.profileRow, children: [
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.profileAvatar }),
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: { gap: 4 }, children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.profileUsername, { color: t.text }], children: [
|
|
2921
3029
|
"@",
|
|
2922
3030
|
username
|
|
2923
3031
|
] }),
|
|
2924
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.profileReady, { color: t.success }], children: [
|
|
2925
3033
|
"\u2713",
|
|
2926
3034
|
" Ready to go!"
|
|
2927
3035
|
] })
|
|
2928
3036
|
] })
|
|
2929
3037
|
] })
|
|
2930
3038
|
] }),
|
|
2931
|
-
error ? /* @__PURE__ */ (0,
|
|
2932
|
-
/* @__PURE__ */ (0,
|
|
2933
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.errorText, { color: t.errorText }], children: error.message }) }) : null,
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.inputGroup, children: [
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2934
3042
|
"Referral Code ",
|
|
2935
|
-
/* @__PURE__ */ (0,
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: { color: t.textMuted }, children: "(optional)" })
|
|
2936
3044
|
] }),
|
|
2937
|
-
/* @__PURE__ */ (0,
|
|
2938
|
-
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3046
|
+
import_react_native8.TextInput,
|
|
2939
3047
|
{
|
|
2940
3048
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: t.border }],
|
|
2941
3049
|
placeholder: "Enter referral code",
|
|
@@ -2947,31 +3055,31 @@ function DefaultRegistrationScreen({
|
|
|
2947
3055
|
editable: !registering
|
|
2948
3056
|
}
|
|
2949
3057
|
),
|
|
2950
|
-
/* @__PURE__ */ (0,
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.hint, { color: t.textMuted }], children: [
|
|
2951
3059
|
"\u{1F381}",
|
|
2952
3060
|
" If a friend invited you, enter their code to give them credit!"
|
|
2953
3061
|
] })
|
|
2954
3062
|
] })
|
|
2955
3063
|
] }),
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2957
|
-
/* @__PURE__ */ (0,
|
|
2958
|
-
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3066
|
+
import_react_native8.TouchableOpacity,
|
|
2959
3067
|
{
|
|
2960
3068
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2961
3069
|
onPress: () => animateToStep(1),
|
|
2962
3070
|
disabled: registering,
|
|
2963
3071
|
activeOpacity: 0.7,
|
|
2964
|
-
children: /* @__PURE__ */ (0,
|
|
3072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2965
3073
|
}
|
|
2966
3074
|
),
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
2968
|
-
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3076
|
+
import_react_native8.TouchableOpacity,
|
|
2969
3077
|
{
|
|
2970
3078
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: registering ? 0.7 : 1 }],
|
|
2971
3079
|
onPress: handleSubmit,
|
|
2972
3080
|
disabled: registering,
|
|
2973
3081
|
activeOpacity: 0.8,
|
|
2974
|
-
children: registering ? /* @__PURE__ */ (0,
|
|
3082
|
+
children: registering ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Create Account" })
|
|
2975
3083
|
}
|
|
2976
3084
|
)
|
|
2977
3085
|
] })
|
|
@@ -2988,19 +3096,19 @@ function DefaultRegistrationScreen({
|
|
|
2988
3096
|
return null;
|
|
2989
3097
|
}
|
|
2990
3098
|
};
|
|
2991
|
-
return /* @__PURE__ */ (0,
|
|
2992
|
-
|
|
3099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3100
|
+
import_react_native8.KeyboardAvoidingView,
|
|
2993
3101
|
{
|
|
2994
3102
|
style: [s.container, { backgroundColor: t.background }],
|
|
2995
|
-
behavior:
|
|
2996
|
-
children: /* @__PURE__ */ (0,
|
|
2997
|
-
|
|
3103
|
+
behavior: import_react_native8.Platform.OS === "ios" ? "padding" : void 0,
|
|
3104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3105
|
+
import_react_native8.ScrollView,
|
|
2998
3106
|
{
|
|
2999
3107
|
contentContainerStyle: { flexGrow: 1 },
|
|
3000
3108
|
keyboardShouldPersistTaps: "handled",
|
|
3001
3109
|
bounces: false,
|
|
3002
|
-
children: /* @__PURE__ */ (0,
|
|
3003
|
-
|
|
3110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3111
|
+
import_react_native8.Animated.View,
|
|
3004
3112
|
{
|
|
3005
3113
|
style: [
|
|
3006
3114
|
{ flex: 1 },
|
|
@@ -3032,12 +3140,12 @@ function PushSetupScreen({
|
|
|
3032
3140
|
const t = useDubsTheme();
|
|
3033
3141
|
const accent = accentColor || t.accent;
|
|
3034
3142
|
const push = usePushNotifications();
|
|
3035
|
-
const fadeAnim = (0, import_react17.useRef)(new
|
|
3036
|
-
const slideAnim = (0, import_react17.useRef)(new
|
|
3143
|
+
const fadeAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(0)).current;
|
|
3144
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(30)).current;
|
|
3037
3145
|
(0, import_react17.useEffect)(() => {
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3146
|
+
import_react_native8.Animated.parallel([
|
|
3147
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 1, duration: 300, useNativeDriver: true }),
|
|
3148
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: 0, duration: 300, useNativeDriver: true })
|
|
3041
3149
|
]).start();
|
|
3042
3150
|
}, [fadeAnim, slideAnim]);
|
|
3043
3151
|
const handleEnable = async () => {
|
|
@@ -3049,45 +3157,45 @@ function PushSetupScreen({
|
|
|
3049
3157
|
"Your pick wins or loses",
|
|
3050
3158
|
"Final results and rankings"
|
|
3051
3159
|
];
|
|
3052
|
-
return /* @__PURE__ */ (0,
|
|
3053
|
-
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
3161
|
+
import_react_native8.Animated.View,
|
|
3054
3162
|
{
|
|
3055
3163
|
style: [
|
|
3056
3164
|
s.stepContainer,
|
|
3057
3165
|
{ opacity: fadeAnim, transform: [{ translateY: slideAnim }] }
|
|
3058
3166
|
],
|
|
3059
3167
|
children: [
|
|
3060
|
-
/* @__PURE__ */ (0,
|
|
3061
|
-
/* @__PURE__ */ (0,
|
|
3062
|
-
/* @__PURE__ */ (0,
|
|
3063
|
-
/* @__PURE__ */ (0,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
benefits.map((item, i) => /* @__PURE__ */ (0,
|
|
3068
|
-
/* @__PURE__ */ (0,
|
|
3069
|
-
/* @__PURE__ */ (0,
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
3169
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.title, { color: t.text }], children: "Enable Notifications" }),
|
|
3170
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Stay in the loop with real-time updates" }),
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 3 }),
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: pushStyles.iconContainer, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [pushStyles.bellCircle, { backgroundColor: accent + "20" }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.bellIcon, { color: accent }], children: "\u{1F514}" }) }) }),
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: pushStyles.benefitsList, children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.benefitsHeader, { color: t.text }], children: "Get real-time updates when:" }),
|
|
3175
|
+
benefits.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: pushStyles.benefitRow, children: [
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [pushStyles.bulletDot, { backgroundColor: accent }] }),
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.benefitText, { color: t.textMuted }], children: item })
|
|
3070
3178
|
] }, i))
|
|
3071
3179
|
] })
|
|
3072
3180
|
] }),
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
3075
|
-
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3183
|
+
import_react_native8.TouchableOpacity,
|
|
3076
3184
|
{
|
|
3077
3185
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
3078
3186
|
onPress: onComplete,
|
|
3079
3187
|
activeOpacity: 0.7,
|
|
3080
|
-
children: /* @__PURE__ */ (0,
|
|
3188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.textMuted }], children: "Maybe Later" })
|
|
3081
3189
|
}
|
|
3082
3190
|
),
|
|
3083
|
-
/* @__PURE__ */ (0,
|
|
3084
|
-
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3192
|
+
import_react_native8.TouchableOpacity,
|
|
3085
3193
|
{
|
|
3086
3194
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: push.loading ? 0.7 : 1 }],
|
|
3087
3195
|
onPress: handleEnable,
|
|
3088
3196
|
disabled: push.loading,
|
|
3089
3197
|
activeOpacity: 0.8,
|
|
3090
|
-
children: push.loading ? /* @__PURE__ */ (0,
|
|
3198
|
+
children: push.loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Enable Notifications" })
|
|
3091
3199
|
}
|
|
3092
3200
|
)
|
|
3093
3201
|
] })
|
|
@@ -3095,7 +3203,7 @@ function PushSetupScreen({
|
|
|
3095
3203
|
}
|
|
3096
3204
|
) });
|
|
3097
3205
|
}
|
|
3098
|
-
var pushStyles =
|
|
3206
|
+
var pushStyles = import_react_native8.StyleSheet.create({
|
|
3099
3207
|
iconContainer: { alignItems: "center", marginVertical: 24 },
|
|
3100
3208
|
bellCircle: { width: 100, height: 100, borderRadius: 50, justifyContent: "center", alignItems: "center" },
|
|
3101
3209
|
bellIcon: { fontSize: 48 },
|
|
@@ -3105,7 +3213,7 @@ var pushStyles = import_react_native7.StyleSheet.create({
|
|
|
3105
3213
|
bulletDot: { width: 8, height: 8, borderRadius: 4 },
|
|
3106
3214
|
benefitText: { fontSize: 16, flex: 1 }
|
|
3107
3215
|
});
|
|
3108
|
-
var s =
|
|
3216
|
+
var s = import_react_native8.StyleSheet.create({
|
|
3109
3217
|
container: { flex: 1 },
|
|
3110
3218
|
// Loading / Error
|
|
3111
3219
|
centerContent: { flex: 1, justifyContent: "center", alignItems: "center", paddingHorizontal: 32, gap: 48 },
|
|
@@ -3148,7 +3256,6 @@ var s = import_react_native7.StyleSheet.create({
|
|
|
3148
3256
|
styleScroll: { paddingHorizontal: 24, marginTop: 4 },
|
|
3149
3257
|
styleThumbWrap: { borderWidth: 2, borderRadius: 12, padding: 3, marginRight: 10 },
|
|
3150
3258
|
styleThumb: { width: 52, height: 52, borderRadius: 10, backgroundColor: "#E5E5EA" },
|
|
3151
|
-
colorSwatch: { width: 32, height: 32, borderRadius: 16, borderWidth: 1.5, borderColor: "rgba(255,255,255,0.15)", marginRight: 10 },
|
|
3152
3259
|
// Input
|
|
3153
3260
|
inputGroup: { paddingHorizontal: 24, gap: 6 },
|
|
3154
3261
|
inputLabel: { fontSize: 15, fontWeight: "600" },
|
|
@@ -3170,7 +3277,7 @@ var s = import_react_native7.StyleSheet.create({
|
|
|
3170
3277
|
});
|
|
3171
3278
|
|
|
3172
3279
|
// src/provider.tsx
|
|
3173
|
-
var
|
|
3280
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3174
3281
|
var DubsContext = (0, import_react18.createContext)(null);
|
|
3175
3282
|
function DubsProvider({
|
|
3176
3283
|
apiKey,
|
|
@@ -3220,7 +3327,7 @@ function DubsProvider({
|
|
|
3220
3327
|
themeOverrides.accent = uiConfig.accentColor;
|
|
3221
3328
|
}
|
|
3222
3329
|
if (externalWallet) {
|
|
3223
|
-
return /* @__PURE__ */ (0,
|
|
3330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3224
3331
|
ExternalWalletProvider,
|
|
3225
3332
|
{
|
|
3226
3333
|
client,
|
|
@@ -3240,7 +3347,7 @@ function DubsProvider({
|
|
|
3240
3347
|
}
|
|
3241
3348
|
) });
|
|
3242
3349
|
}
|
|
3243
|
-
return /* @__PURE__ */ (0,
|
|
3350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3244
3351
|
ManagedWalletProvider,
|
|
3245
3352
|
{
|
|
3246
3353
|
appName: uiConfig.appName || appName,
|
|
@@ -3252,7 +3359,7 @@ function DubsProvider({
|
|
|
3252
3359
|
tagline: uiConfig.tagline,
|
|
3253
3360
|
redirectUri,
|
|
3254
3361
|
appUrl: appUrl || uiConfig.appUrl,
|
|
3255
|
-
children: (adapter) => /* @__PURE__ */ (0,
|
|
3362
|
+
children: (adapter) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3256
3363
|
ManagedInner,
|
|
3257
3364
|
{
|
|
3258
3365
|
client,
|
|
@@ -3297,7 +3404,7 @@ function ManagedInner({
|
|
|
3297
3404
|
() => ({ client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled }),
|
|
3298
3405
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3299
3406
|
);
|
|
3300
|
-
return /* @__PURE__ */ (0,
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3301
3408
|
AuthGate,
|
|
3302
3409
|
{
|
|
3303
3410
|
onSaveToken: (token) => {
|
|
@@ -3341,9 +3448,9 @@ function ExternalWalletProvider({
|
|
|
3341
3448
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3342
3449
|
);
|
|
3343
3450
|
if (!managed) {
|
|
3344
|
-
return /* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children });
|
|
3345
3452
|
}
|
|
3346
|
-
return /* @__PURE__ */ (0,
|
|
3453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3347
3454
|
AuthGate,
|
|
3348
3455
|
{
|
|
3349
3456
|
onSaveToken: (token) => {
|
|
@@ -3374,8 +3481,8 @@ function useAppConfig() {
|
|
|
3374
3481
|
|
|
3375
3482
|
// src/ui/UserProfileCard.tsx
|
|
3376
3483
|
var import_react19 = require("react");
|
|
3377
|
-
var
|
|
3378
|
-
var
|
|
3484
|
+
var import_react_native9 = require("react-native");
|
|
3485
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3379
3486
|
function truncateAddress(address, chars = 4) {
|
|
3380
3487
|
if (address.length <= chars * 2 + 3) return address;
|
|
3381
3488
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3397,16 +3504,16 @@ function UserProfileCard({
|
|
|
3397
3504
|
() => ensurePngAvatar(avatarUrl) || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3398
3505
|
[avatarUrl, walletAddress]
|
|
3399
3506
|
);
|
|
3400
|
-
return /* @__PURE__ */ (0,
|
|
3401
|
-
/* @__PURE__ */ (0,
|
|
3402
|
-
/* @__PURE__ */ (0,
|
|
3403
|
-
username ? /* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3405
|
-
memberSince ? /* @__PURE__ */ (0,
|
|
3507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style: [styles3.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Image, { source: { uri: imageUri }, style: styles3.avatar }),
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style: styles3.info, children: [
|
|
3510
|
+
username ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.username, { color: t.text }], children: username }) : null,
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.address, { color: t.textMuted }], children: truncateAddress(walletAddress) }),
|
|
3512
|
+
memberSince ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.memberSince, { color: t.textDim }], children: formatMemberSince(memberSince) }) : null
|
|
3406
3513
|
] })
|
|
3407
3514
|
] });
|
|
3408
3515
|
}
|
|
3409
|
-
var
|
|
3516
|
+
var styles3 = import_react_native9.StyleSheet.create({
|
|
3410
3517
|
card: {
|
|
3411
3518
|
flexDirection: "row",
|
|
3412
3519
|
alignItems: "center",
|
|
@@ -3440,8 +3547,8 @@ var styles2 = import_react_native8.StyleSheet.create({
|
|
|
3440
3547
|
});
|
|
3441
3548
|
|
|
3442
3549
|
// src/ui/SettingsSheet.tsx
|
|
3443
|
-
var
|
|
3444
|
-
var
|
|
3550
|
+
var import_react_native10 = require("react-native");
|
|
3551
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3445
3552
|
function truncateAddress2(address, chars = 4) {
|
|
3446
3553
|
if (address.length <= chars * 2 + 3) return address;
|
|
3447
3554
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3458,13 +3565,13 @@ function SettingsSheet({
|
|
|
3458
3565
|
loggingOut = false
|
|
3459
3566
|
}) {
|
|
3460
3567
|
const t = useDubsTheme();
|
|
3461
|
-
return /* @__PURE__ */ (0,
|
|
3462
|
-
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3569
|
+
import_react_native10.ScrollView,
|
|
3463
3570
|
{
|
|
3464
|
-
style: [
|
|
3465
|
-
contentContainerStyle:
|
|
3571
|
+
style: [styles4.container, { backgroundColor: t.background }],
|
|
3572
|
+
contentContainerStyle: styles4.content,
|
|
3466
3573
|
children: [
|
|
3467
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3468
3575
|
UserProfileCard,
|
|
3469
3576
|
{
|
|
3470
3577
|
walletAddress,
|
|
@@ -3473,49 +3580,49 @@ function SettingsSheet({
|
|
|
3473
3580
|
memberSince
|
|
3474
3581
|
}
|
|
3475
3582
|
),
|
|
3476
|
-
/* @__PURE__ */ (0,
|
|
3477
|
-
onCopyAddress ? /* @__PURE__ */ (0,
|
|
3478
|
-
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.View, { style: [styles4.actionsCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3584
|
+
onCopyAddress ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3585
|
+
import_react_native10.TouchableOpacity,
|
|
3479
3586
|
{
|
|
3480
|
-
style:
|
|
3587
|
+
style: styles4.actionRow,
|
|
3481
3588
|
onPress: onCopyAddress,
|
|
3482
3589
|
activeOpacity: 0.7,
|
|
3483
3590
|
children: [
|
|
3484
|
-
/* @__PURE__ */ (0,
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3486
|
-
/* @__PURE__ */ (0,
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.View, { style: styles4.actionRowLeft, children: [
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionLabel, { color: t.text }], children: "Wallet Address" }),
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionValue, { color: t.textMuted }], children: truncateAddress2(walletAddress) })
|
|
3487
3594
|
] }),
|
|
3488
|
-
/* @__PURE__ */ (0,
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.copyLabel, { color: t.accent }], children: "Copy" })
|
|
3489
3596
|
]
|
|
3490
3597
|
}
|
|
3491
3598
|
) : null,
|
|
3492
|
-
onSupport ? /* @__PURE__ */ (0,
|
|
3493
|
-
onCopyAddress ? /* @__PURE__ */ (0,
|
|
3494
|
-
/* @__PURE__ */ (0,
|
|
3495
|
-
|
|
3599
|
+
onSupport ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
3600
|
+
onCopyAddress ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.View, { style: [styles4.separator, { backgroundColor: t.border }] }) : null,
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3602
|
+
import_react_native10.TouchableOpacity,
|
|
3496
3603
|
{
|
|
3497
|
-
style:
|
|
3604
|
+
style: styles4.actionRow,
|
|
3498
3605
|
onPress: onSupport,
|
|
3499
3606
|
activeOpacity: 0.7,
|
|
3500
3607
|
children: [
|
|
3501
|
-
/* @__PURE__ */ (0,
|
|
3502
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionLabel, { color: t.text }], children: "Help & Support" }),
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.chevron, { color: t.textMuted }], children: "\u203A" })
|
|
3503
3610
|
]
|
|
3504
3611
|
}
|
|
3505
3612
|
)
|
|
3506
3613
|
] }) : null
|
|
3507
3614
|
] }),
|
|
3508
|
-
/* @__PURE__ */ (0,
|
|
3509
|
-
|
|
3615
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3616
|
+
import_react_native10.TouchableOpacity,
|
|
3510
3617
|
{
|
|
3511
|
-
style: [
|
|
3618
|
+
style: [styles4.logoutButton, { borderColor: t.live }],
|
|
3512
3619
|
onPress: onLogout,
|
|
3513
3620
|
disabled: loggingOut,
|
|
3514
3621
|
activeOpacity: 0.7,
|
|
3515
|
-
children: loggingOut ? /* @__PURE__ */ (0,
|
|
3622
|
+
children: loggingOut ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.ActivityIndicator, { color: t.live, size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.logoutText, { color: t.live }], children: "Log Out" })
|
|
3516
3623
|
}
|
|
3517
3624
|
),
|
|
3518
|
-
appVersion ? /* @__PURE__ */ (0,
|
|
3625
|
+
appVersion ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.Text, { style: [styles4.version, { color: t.textDim }], children: [
|
|
3519
3626
|
"v",
|
|
3520
3627
|
appVersion
|
|
3521
3628
|
] }) : null
|
|
@@ -3523,7 +3630,7 @@ function SettingsSheet({
|
|
|
3523
3630
|
}
|
|
3524
3631
|
);
|
|
3525
3632
|
}
|
|
3526
|
-
var
|
|
3633
|
+
var styles4 = import_react_native10.StyleSheet.create({
|
|
3527
3634
|
container: {
|
|
3528
3635
|
flex: 1
|
|
3529
3636
|
},
|
|
@@ -3587,46 +3694,8 @@ var styles3 = import_react_native9.StyleSheet.create({
|
|
|
3587
3694
|
|
|
3588
3695
|
// src/ui/UserProfileSheet.tsx
|
|
3589
3696
|
var import_react20 = require("react");
|
|
3590
|
-
var
|
|
3591
|
-
var
|
|
3592
|
-
var DICEBEAR_STYLES2 = [
|
|
3593
|
-
"adventurer",
|
|
3594
|
-
"avataaars",
|
|
3595
|
-
"fun-emoji",
|
|
3596
|
-
"bottts",
|
|
3597
|
-
"big-smile",
|
|
3598
|
-
"thumbs"
|
|
3599
|
-
];
|
|
3600
|
-
var BG_COLORS2 = [
|
|
3601
|
-
"1a1a2e",
|
|
3602
|
-
"f43f5e",
|
|
3603
|
-
"f97316",
|
|
3604
|
-
"eab308",
|
|
3605
|
-
"22c55e",
|
|
3606
|
-
"3b82f6",
|
|
3607
|
-
"8b5cf6",
|
|
3608
|
-
"ec4899",
|
|
3609
|
-
"06b6d4",
|
|
3610
|
-
"64748b"
|
|
3611
|
-
];
|
|
3612
|
-
function generateSeed2() {
|
|
3613
|
-
return Math.random().toString(36).slice(2, 10);
|
|
3614
|
-
}
|
|
3615
|
-
function getAvatarUrl2(style, seed, bg = "1a1a2e", size = 256) {
|
|
3616
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
3617
|
-
}
|
|
3618
|
-
function parseAvatarUrl(url) {
|
|
3619
|
-
if (!url) return { style: "adventurer", seed: generateSeed2(), bg: "1a1a2e" };
|
|
3620
|
-
try {
|
|
3621
|
-
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
3622
|
-
if (match) {
|
|
3623
|
-
const bgMatch = url.match(/backgroundColor=([^&]+)/);
|
|
3624
|
-
return { style: match[1], seed: match[2], bg: bgMatch?.[1] || "1a1a2e" };
|
|
3625
|
-
}
|
|
3626
|
-
} catch {
|
|
3627
|
-
}
|
|
3628
|
-
return { style: "adventurer", seed: generateSeed2(), bg: "1a1a2e" };
|
|
3629
|
-
}
|
|
3697
|
+
var import_react_native11 = require("react-native");
|
|
3698
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3630
3699
|
function truncateAddress3(address, chars = 4) {
|
|
3631
3700
|
if (address.length <= chars * 2 + 3) return address;
|
|
3632
3701
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3640,8 +3709,9 @@ function UserProfileSheet({
|
|
|
3640
3709
|
}) {
|
|
3641
3710
|
const t = useDubsTheme();
|
|
3642
3711
|
const { client } = useDubs();
|
|
3712
|
+
const { refreshUser } = useAuth();
|
|
3643
3713
|
const push = usePushNotifications();
|
|
3644
|
-
const overlayOpacity = (0, import_react20.useRef)(new
|
|
3714
|
+
const overlayOpacity = (0, import_react20.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
3645
3715
|
const parsed = (0, import_react20.useMemo)(() => parseAvatarUrl(user.avatar), [user.avatar]);
|
|
3646
3716
|
const [avatarStyle, setAvatarStyle] = (0, import_react20.useState)(parsed.style);
|
|
3647
3717
|
const [avatarSeed, setAvatarSeed] = (0, import_react20.useState)(parsed.seed);
|
|
@@ -3655,7 +3725,7 @@ function UserProfileSheet({
|
|
|
3655
3725
|
setBgColor(p.bg);
|
|
3656
3726
|
}, [user.avatar]);
|
|
3657
3727
|
(0, import_react20.useEffect)(() => {
|
|
3658
|
-
|
|
3728
|
+
import_react_native11.Animated.timing(overlayOpacity, {
|
|
3659
3729
|
toValue: visible ? 1 : 0,
|
|
3660
3730
|
duration: 250,
|
|
3661
3731
|
useNativeDriver: true
|
|
@@ -3664,189 +3734,136 @@ function UserProfileSheet({
|
|
|
3664
3734
|
(0, import_react20.useEffect)(() => {
|
|
3665
3735
|
if (visible) setError(null);
|
|
3666
3736
|
}, [visible]);
|
|
3667
|
-
const currentAvatarUrl =
|
|
3737
|
+
const currentAvatarUrl = getAvatarUrl(avatarStyle, avatarSeed, bgColor);
|
|
3668
3738
|
const saveAvatar = (0, import_react20.useCallback)(async (newUrl) => {
|
|
3669
3739
|
setSaving(true);
|
|
3670
3740
|
setError(null);
|
|
3671
3741
|
try {
|
|
3672
3742
|
await client.updateProfile({ avatar: newUrl });
|
|
3743
|
+
await refreshUser();
|
|
3673
3744
|
onAvatarUpdated?.(newUrl);
|
|
3674
3745
|
} catch (err) {
|
|
3675
3746
|
setError(err instanceof Error ? err.message : "Failed to update avatar");
|
|
3676
3747
|
} finally {
|
|
3677
3748
|
setSaving(false);
|
|
3678
3749
|
}
|
|
3679
|
-
}, [client, onAvatarUpdated]);
|
|
3680
|
-
const
|
|
3681
|
-
(style)
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
},
|
|
3685
|
-
[avatarSeed, bgColor, saveAvatar]
|
|
3686
|
-
);
|
|
3750
|
+
}, [client, refreshUser, onAvatarUpdated]);
|
|
3751
|
+
const handleStyleChange = (0, import_react20.useCallback)((style) => {
|
|
3752
|
+
setAvatarStyle(style);
|
|
3753
|
+
saveAvatar(getAvatarUrl(style, avatarSeed, bgColor));
|
|
3754
|
+
}, [avatarSeed, bgColor, saveAvatar]);
|
|
3687
3755
|
const handleShuffle = (0, import_react20.useCallback)(() => {
|
|
3688
|
-
const newSeed =
|
|
3756
|
+
const newSeed = generateSeed();
|
|
3689
3757
|
setAvatarSeed(newSeed);
|
|
3690
|
-
saveAvatar(
|
|
3758
|
+
saveAvatar(getAvatarUrl(avatarStyle, newSeed, bgColor));
|
|
3691
3759
|
}, [avatarStyle, bgColor, saveAvatar]);
|
|
3692
|
-
const
|
|
3693
|
-
(color)
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
);
|
|
3699
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3700
|
-
import_react_native10.Modal,
|
|
3760
|
+
const handleBgChange = (0, import_react20.useCallback)((color) => {
|
|
3761
|
+
setBgColor(color);
|
|
3762
|
+
saveAvatar(getAvatarUrl(avatarStyle, avatarSeed, color));
|
|
3763
|
+
}, [avatarStyle, avatarSeed, saveAvatar]);
|
|
3764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3765
|
+
import_react_native11.Modal,
|
|
3701
3766
|
{
|
|
3702
3767
|
visible,
|
|
3703
3768
|
animationType: "slide",
|
|
3704
3769
|
transparent: true,
|
|
3705
3770
|
onRequestClose: onDismiss,
|
|
3706
3771
|
children: [
|
|
3707
|
-
/* @__PURE__ */ (0,
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
3709
|
-
|
|
3772
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Animated.View, { style: [styles5.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.TouchableOpacity, { style: styles5.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
3773
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3774
|
+
import_react_native11.KeyboardAvoidingView,
|
|
3710
3775
|
{
|
|
3711
|
-
style:
|
|
3712
|
-
behavior:
|
|
3713
|
-
children: /* @__PURE__ */ (0,
|
|
3714
|
-
/* @__PURE__ */ (0,
|
|
3715
|
-
/* @__PURE__ */ (0,
|
|
3716
|
-
/* @__PURE__ */ (0,
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
3776
|
+
style: styles5.keyboardView,
|
|
3777
|
+
behavior: import_react_native11.Platform.OS === "ios" ? "padding" : void 0,
|
|
3778
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.sheet, { backgroundColor: t.background }], children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.handle, { backgroundColor: t.textMuted }] }) }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.header, children: [
|
|
3781
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.headerTitle, { color: t.text }], children: "Profile" }),
|
|
3782
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
3718
3783
|
] }),
|
|
3719
|
-
/* @__PURE__ */ (0,
|
|
3720
|
-
|
|
3784
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3785
|
+
import_react_native11.ScrollView,
|
|
3721
3786
|
{
|
|
3722
|
-
style:
|
|
3723
|
-
contentContainerStyle:
|
|
3787
|
+
style: styles5.scrollContent,
|
|
3788
|
+
contentContainerStyle: styles5.scrollContentInner,
|
|
3724
3789
|
showsVerticalScrollIndicator: false,
|
|
3725
3790
|
bounces: false,
|
|
3726
3791
|
children: [
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3730
|
-
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.avatarSection, children: [
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.avatarContainer, { borderColor: t.border }], children: [
|
|
3794
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3795
|
+
import_react_native11.Image,
|
|
3731
3796
|
{
|
|
3732
3797
|
source: { uri: currentAvatarUrl },
|
|
3733
|
-
style:
|
|
3798
|
+
style: styles5.avatar
|
|
3734
3799
|
}
|
|
3735
3800
|
),
|
|
3736
|
-
saving && /* @__PURE__ */ (0,
|
|
3801
|
+
saving && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.avatarLoading, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.ActivityIndicator, { size: "small", color: "#FFFFFF" }) })
|
|
3737
3802
|
] }),
|
|
3738
|
-
user.username ? /* @__PURE__ */ (0,
|
|
3739
|
-
/* @__PURE__ */ (0,
|
|
3803
|
+
user.username ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.username, { color: t.text }], children: user.username }) : null,
|
|
3804
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.walletAddress, { color: t.textMuted }], children: truncateAddress3(user.walletAddress, 6) })
|
|
3740
3805
|
] }),
|
|
3741
|
-
/* @__PURE__ */ (0,
|
|
3742
|
-
/* @__PURE__ */ (0,
|
|
3743
|
-
/* @__PURE__ */ (0,
|
|
3744
|
-
/* @__PURE__ */ (0,
|
|
3745
|
-
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.section, children: [
|
|
3807
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.sectionHeaderRow, children: [
|
|
3808
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.sectionLabel, { color: t.textSecondary }], children: "Change Avatar" }),
|
|
3809
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3810
|
+
import_react_native11.TouchableOpacity,
|
|
3746
3811
|
{
|
|
3747
|
-
style: [
|
|
3812
|
+
style: [styles5.shuffleButton, { borderColor: t.border }],
|
|
3748
3813
|
onPress: handleShuffle,
|
|
3749
3814
|
activeOpacity: 0.7,
|
|
3750
3815
|
disabled: saving,
|
|
3751
|
-
children: /* @__PURE__ */ (0,
|
|
3816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.shuffleText, { color: t.accent }], children: "Shuffle" })
|
|
3752
3817
|
}
|
|
3753
3818
|
)
|
|
3754
3819
|
] }),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
-
|
|
3820
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3821
|
+
AvatarEditor,
|
|
3757
3822
|
{
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
{
|
|
3766
|
-
onPress: () => handleSelectStyle(style),
|
|
3767
|
-
activeOpacity: 0.7,
|
|
3768
|
-
disabled: saving,
|
|
3769
|
-
style: [
|
|
3770
|
-
styles4.styleTile,
|
|
3771
|
-
{
|
|
3772
|
-
borderColor: isSelected ? t.accent : t.border,
|
|
3773
|
-
borderWidth: isSelected ? 2 : 1
|
|
3774
|
-
}
|
|
3775
|
-
],
|
|
3776
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3777
|
-
import_react_native10.Image,
|
|
3778
|
-
{
|
|
3779
|
-
source: { uri: getAvatarUrl2(style, avatarSeed, bgColor, 80) },
|
|
3780
|
-
style: styles4.styleTileImage
|
|
3781
|
-
}
|
|
3782
|
-
)
|
|
3783
|
-
},
|
|
3784
|
-
style
|
|
3785
|
-
);
|
|
3786
|
-
})
|
|
3787
|
-
}
|
|
3788
|
-
),
|
|
3789
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.sectionLabel, { color: t.textSecondary, marginTop: 4 }], children: "Background Color" }),
|
|
3790
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3791
|
-
import_react_native10.ScrollView,
|
|
3792
|
-
{
|
|
3793
|
-
horizontal: true,
|
|
3794
|
-
showsHorizontalScrollIndicator: false,
|
|
3795
|
-
contentContainerStyle: styles4.colorPickerContent,
|
|
3796
|
-
children: BG_COLORS2.map((color) => {
|
|
3797
|
-
const isSelected = color === bgColor;
|
|
3798
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3799
|
-
import_react_native10.TouchableOpacity,
|
|
3800
|
-
{
|
|
3801
|
-
onPress: () => handleSelectBgColor(color),
|
|
3802
|
-
activeOpacity: 0.7,
|
|
3803
|
-
disabled: saving,
|
|
3804
|
-
style: [
|
|
3805
|
-
styles4.colorSwatch,
|
|
3806
|
-
{ backgroundColor: `#${color}` },
|
|
3807
|
-
isSelected && { borderColor: t.accent, borderWidth: 2.5 }
|
|
3808
|
-
]
|
|
3809
|
-
},
|
|
3810
|
-
color
|
|
3811
|
-
);
|
|
3812
|
-
})
|
|
3823
|
+
style: avatarStyle,
|
|
3824
|
+
seed: avatarSeed,
|
|
3825
|
+
bg: bgColor,
|
|
3826
|
+
onStyleChange: handleStyleChange,
|
|
3827
|
+
onSeedChange: setAvatarSeed,
|
|
3828
|
+
onBgChange: handleBgChange,
|
|
3829
|
+
disabled: saving
|
|
3813
3830
|
}
|
|
3814
3831
|
)
|
|
3815
3832
|
] }),
|
|
3816
|
-
error ? /* @__PURE__ */ (0,
|
|
3817
|
-
push.enabled && /* @__PURE__ */ (0,
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
3821
|
-
|
|
3833
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.errorText, { color: t.errorText }], children: error }) }) : null,
|
|
3834
|
+
push.enabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.notifRow, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3835
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.notifLeft, children: [
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.notifLabel, { color: t.text }], children: "Push Notifications" }),
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3838
|
+
import_react_native11.Text,
|
|
3822
3839
|
{
|
|
3823
3840
|
style: [
|
|
3824
|
-
|
|
3841
|
+
styles5.notifStatus,
|
|
3825
3842
|
{ color: push.hasPermission ? t.success : t.textMuted }
|
|
3826
3843
|
],
|
|
3827
3844
|
children: push.hasPermission ? "Enabled" : "Disabled"
|
|
3828
3845
|
}
|
|
3829
3846
|
)
|
|
3830
3847
|
] }),
|
|
3831
|
-
!push.hasPermission && /* @__PURE__ */ (0,
|
|
3832
|
-
|
|
3848
|
+
!push.hasPermission && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3849
|
+
import_react_native11.TouchableOpacity,
|
|
3833
3850
|
{
|
|
3834
|
-
style: [
|
|
3851
|
+
style: [styles5.enableButton, { backgroundColor: t.accent }],
|
|
3835
3852
|
onPress: push.register,
|
|
3836
3853
|
disabled: push.loading,
|
|
3837
3854
|
activeOpacity: 0.8,
|
|
3838
|
-
children: push.loading ? /* @__PURE__ */ (0,
|
|
3855
|
+
children: push.loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.ActivityIndicator, { size: "small", color: "#FFFFFF" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: styles5.enableText, children: "Enable" })
|
|
3839
3856
|
}
|
|
3840
3857
|
)
|
|
3841
3858
|
] }),
|
|
3842
|
-
push.enabled && push.error ? /* @__PURE__ */ (0,
|
|
3843
|
-
onDisconnect ? /* @__PURE__ */ (0,
|
|
3844
|
-
|
|
3859
|
+
push.enabled && push.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.errorText, { color: t.errorText }], children: push.error.message }) }) : null,
|
|
3860
|
+
onDisconnect ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3861
|
+
import_react_native11.TouchableOpacity,
|
|
3845
3862
|
{
|
|
3846
|
-
style: [
|
|
3863
|
+
style: [styles5.disconnectButton, { borderColor: t.live }],
|
|
3847
3864
|
onPress: onDisconnect,
|
|
3848
3865
|
activeOpacity: 0.7,
|
|
3849
|
-
children: /* @__PURE__ */ (0,
|
|
3866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.disconnectText, { color: t.live }], children: "Disconnect Wallet" })
|
|
3850
3867
|
}
|
|
3851
3868
|
) : null
|
|
3852
3869
|
]
|
|
@@ -3859,9 +3876,9 @@ function UserProfileSheet({
|
|
|
3859
3876
|
}
|
|
3860
3877
|
);
|
|
3861
3878
|
}
|
|
3862
|
-
var
|
|
3879
|
+
var styles5 = import_react_native11.StyleSheet.create({
|
|
3863
3880
|
overlay: {
|
|
3864
|
-
...
|
|
3881
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3865
3882
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
3866
3883
|
},
|
|
3867
3884
|
overlayTap: {
|
|
@@ -3879,7 +3896,7 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3879
3896
|
borderTopRightRadius: 24,
|
|
3880
3897
|
paddingHorizontal: 20,
|
|
3881
3898
|
paddingBottom: 0,
|
|
3882
|
-
height:
|
|
3899
|
+
height: import_react_native11.Dimensions.get("window").height * 0.7
|
|
3883
3900
|
},
|
|
3884
3901
|
handleRow: {
|
|
3885
3902
|
alignItems: "center",
|
|
@@ -3912,7 +3929,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3912
3929
|
scrollContentInner: {
|
|
3913
3930
|
paddingBottom: 8
|
|
3914
3931
|
},
|
|
3915
|
-
// Avatar
|
|
3916
3932
|
avatarSection: {
|
|
3917
3933
|
alignItems: "center",
|
|
3918
3934
|
paddingTop: 8,
|
|
@@ -3928,11 +3944,10 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3928
3944
|
},
|
|
3929
3945
|
avatar: {
|
|
3930
3946
|
width: "100%",
|
|
3931
|
-
height: "100%"
|
|
3932
|
-
backgroundColor: "#1a1a2e"
|
|
3947
|
+
height: "100%"
|
|
3933
3948
|
},
|
|
3934
3949
|
avatarLoading: {
|
|
3935
|
-
...
|
|
3950
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3936
3951
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
3937
3952
|
justifyContent: "center",
|
|
3938
3953
|
alignItems: "center"
|
|
@@ -3945,7 +3960,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3945
3960
|
fontSize: 13,
|
|
3946
3961
|
fontFamily: "monospace"
|
|
3947
3962
|
},
|
|
3948
|
-
// Change Avatar
|
|
3949
3963
|
section: {
|
|
3950
3964
|
marginBottom: 20,
|
|
3951
3965
|
gap: 12
|
|
@@ -3969,31 +3983,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3969
3983
|
fontSize: 13,
|
|
3970
3984
|
fontWeight: "600"
|
|
3971
3985
|
},
|
|
3972
|
-
stylePickerContent: {
|
|
3973
|
-
gap: 10
|
|
3974
|
-
},
|
|
3975
|
-
colorPickerContent: {
|
|
3976
|
-
gap: 8
|
|
3977
|
-
},
|
|
3978
|
-
colorSwatch: {
|
|
3979
|
-
width: 32,
|
|
3980
|
-
height: 32,
|
|
3981
|
-
borderRadius: 16,
|
|
3982
|
-
borderWidth: 1.5,
|
|
3983
|
-
borderColor: "rgba(255,255,255,0.15)"
|
|
3984
|
-
},
|
|
3985
|
-
styleTile: {
|
|
3986
|
-
width: 72,
|
|
3987
|
-
height: 72,
|
|
3988
|
-
borderRadius: 16,
|
|
3989
|
-
overflow: "hidden"
|
|
3990
|
-
},
|
|
3991
|
-
styleTileImage: {
|
|
3992
|
-
width: "100%",
|
|
3993
|
-
height: "100%",
|
|
3994
|
-
backgroundColor: "#1a1a2e"
|
|
3995
|
-
},
|
|
3996
|
-
// Error
|
|
3997
3986
|
errorBox: {
|
|
3998
3987
|
marginBottom: 16,
|
|
3999
3988
|
borderRadius: 12,
|
|
@@ -4004,7 +3993,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4004
3993
|
fontSize: 13,
|
|
4005
3994
|
fontWeight: "500"
|
|
4006
3995
|
},
|
|
4007
|
-
// Push Notifications
|
|
4008
3996
|
notifRow: {
|
|
4009
3997
|
flexDirection: "row",
|
|
4010
3998
|
alignItems: "center",
|
|
@@ -4035,7 +4023,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4035
4023
|
fontSize: 14,
|
|
4036
4024
|
fontWeight: "700"
|
|
4037
4025
|
},
|
|
4038
|
-
// Disconnect
|
|
4039
4026
|
disconnectButton: {
|
|
4040
4027
|
height: 52,
|
|
4041
4028
|
borderRadius: 16,
|
|
@@ -4051,8 +4038,8 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4051
4038
|
|
|
4052
4039
|
// src/ui/game/GamePoster.tsx
|
|
4053
4040
|
var import_react21 = require("react");
|
|
4054
|
-
var
|
|
4055
|
-
var
|
|
4041
|
+
var import_react_native12 = require("react-native");
|
|
4042
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4056
4043
|
function computeCountdown(lockTimestamp) {
|
|
4057
4044
|
if (!lockTimestamp) return "";
|
|
4058
4045
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -4073,27 +4060,27 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4073
4060
|
const away = opponents[1];
|
|
4074
4061
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
4075
4062
|
const isLive = countdown === "LIVE";
|
|
4076
|
-
return /* @__PURE__ */ (0,
|
|
4077
|
-
game.media?.poster ? /* @__PURE__ */ (0,
|
|
4063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.container, children: [
|
|
4064
|
+
game.media?.poster ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4078
4065
|
Img,
|
|
4079
4066
|
{
|
|
4080
4067
|
source: { uri: game.media.poster },
|
|
4081
|
-
style:
|
|
4068
|
+
style: styles6.image,
|
|
4082
4069
|
resizeMode: "cover"
|
|
4083
4070
|
}
|
|
4084
|
-
) : /* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4071
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.image, { backgroundColor: t.surface }], children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.fallback, children: [
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: home?.imageUrl, size: 56, Img }),
|
|
4073
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.vs, children: "VS" }),
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: away?.imageUrl, size: 56, Img })
|
|
4088
4075
|
] }) }),
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
/* @__PURE__ */ (0,
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.overlay }),
|
|
4077
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.teamNames, children: [
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: home?.name || "Home" }),
|
|
4079
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameVs, children: "vs" }),
|
|
4080
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: away?.name || "Away" })
|
|
4094
4081
|
] }),
|
|
4095
|
-
countdown ? /* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
countdown ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.countdownPill, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.countdownText, isLive && styles6.countdownLive], children: countdown }) }) : null,
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.poolPill, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: styles6.poolText, children: [
|
|
4097
4084
|
game.totalPool || 0,
|
|
4098
4085
|
" SOL"
|
|
4099
4086
|
] }) })
|
|
@@ -4102,9 +4089,9 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4102
4089
|
function TeamLogoInternal({ url, size, Img }) {
|
|
4103
4090
|
const [failed, setFailed] = (0, import_react21.useState)(false);
|
|
4104
4091
|
if (!url || failed) {
|
|
4105
|
-
return /* @__PURE__ */ (0,
|
|
4092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
4106
4093
|
}
|
|
4107
|
-
return /* @__PURE__ */ (0,
|
|
4094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4108
4095
|
Img,
|
|
4109
4096
|
{
|
|
4110
4097
|
source: { uri: url },
|
|
@@ -4114,7 +4101,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
4114
4101
|
}
|
|
4115
4102
|
);
|
|
4116
4103
|
}
|
|
4117
|
-
var
|
|
4104
|
+
var styles6 = import_react_native12.StyleSheet.create({
|
|
4118
4105
|
container: {
|
|
4119
4106
|
height: 200,
|
|
4120
4107
|
borderRadius: 16,
|
|
@@ -4122,12 +4109,12 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4122
4109
|
position: "relative"
|
|
4123
4110
|
},
|
|
4124
4111
|
image: {
|
|
4125
|
-
...
|
|
4112
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4126
4113
|
justifyContent: "center",
|
|
4127
4114
|
alignItems: "center"
|
|
4128
4115
|
},
|
|
4129
4116
|
overlay: {
|
|
4130
|
-
...
|
|
4117
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4131
4118
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4132
4119
|
},
|
|
4133
4120
|
fallback: {
|
|
@@ -4202,8 +4189,8 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4202
4189
|
|
|
4203
4190
|
// src/ui/game/LivePoolsCard.tsx
|
|
4204
4191
|
var import_react22 = require("react");
|
|
4205
|
-
var
|
|
4206
|
-
var
|
|
4192
|
+
var import_react_native13 = require("react-native");
|
|
4193
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4207
4194
|
function LivePoolsCard({
|
|
4208
4195
|
game,
|
|
4209
4196
|
shortName,
|
|
@@ -4225,29 +4212,29 @@ function LivePoolsCard({
|
|
|
4225
4212
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4226
4213
|
};
|
|
4227
4214
|
}, [homePool, awayPool, totalPool]);
|
|
4228
|
-
return /* @__PURE__ */ (0,
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4230
|
-
/* @__PURE__ */ (0,
|
|
4215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: [styles7.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4216
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.title, { color: t.text }], children: "Live Pools" }),
|
|
4217
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.total, { color: t.accent }], children: [
|
|
4231
4218
|
totalPool,
|
|
4232
4219
|
" SOL total"
|
|
4233
4220
|
] }),
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4236
|
-
/* @__PURE__ */ (0,
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.bars, children: [
|
|
4222
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: homeName, amount: homePool, percent: homePercent, color: homeColor, t }),
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: awayName, amount: awayPool, percent: awayPercent, color: awayColor, t })
|
|
4237
4224
|
] }),
|
|
4238
|
-
/* @__PURE__ */ (0,
|
|
4239
|
-
/* @__PURE__ */ (0,
|
|
4225
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.oddsRow, children: [
|
|
4226
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4240
4227
|
homeName,
|
|
4241
4228
|
": ",
|
|
4242
|
-
/* @__PURE__ */ (0,
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4243
4230
|
homeOdds,
|
|
4244
4231
|
"x"
|
|
4245
4232
|
] })
|
|
4246
4233
|
] }),
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4234
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4248
4235
|
awayName,
|
|
4249
4236
|
": ",
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4237
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4251
4238
|
awayOdds,
|
|
4252
4239
|
"x"
|
|
4253
4240
|
] })
|
|
@@ -4256,16 +4243,16 @@ function LivePoolsCard({
|
|
|
4256
4243
|
] });
|
|
4257
4244
|
}
|
|
4258
4245
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4259
|
-
return /* @__PURE__ */ (0,
|
|
4260
|
-
/* @__PURE__ */ (0,
|
|
4261
|
-
/* @__PURE__ */ (0,
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.barRow, children: [
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.barLabel, { color: t.textSecondary }], numberOfLines: 1, children: name }),
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.barTrack, { backgroundColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.barFill, { width: `${Math.max(percent, 2)}%`, backgroundColor: color }] }) }),
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.barAmount, { color: t.text }], children: [
|
|
4263
4250
|
amount,
|
|
4264
4251
|
" SOL"
|
|
4265
4252
|
] })
|
|
4266
4253
|
] });
|
|
4267
4254
|
}
|
|
4268
|
-
var
|
|
4255
|
+
var styles7 = import_react_native13.StyleSheet.create({
|
|
4269
4256
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4270
4257
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4271
4258
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4281,8 +4268,8 @@ var styles6 = import_react_native12.StyleSheet.create({
|
|
|
4281
4268
|
|
|
4282
4269
|
// src/ui/game/PickWinnerCard.tsx
|
|
4283
4270
|
var import_react23 = require("react");
|
|
4284
|
-
var
|
|
4285
|
-
var
|
|
4271
|
+
var import_react_native14 = require("react-native");
|
|
4272
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4286
4273
|
function PickWinnerCard({
|
|
4287
4274
|
game,
|
|
4288
4275
|
selectedTeam,
|
|
@@ -4306,10 +4293,10 @@ function PickWinnerCard({
|
|
|
4306
4293
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4307
4294
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4308
4295
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4309
|
-
return /* @__PURE__ */ (0,
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
4312
|
-
/* @__PURE__ */ (0,
|
|
4296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: [styles8.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.title, { color: t.text }], children: "Pick Your Winner" }),
|
|
4298
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.row, children: [
|
|
4299
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4313
4300
|
TeamOption,
|
|
4314
4301
|
{
|
|
4315
4302
|
name: homeName,
|
|
@@ -4323,7 +4310,7 @@ function PickWinnerCard({
|
|
|
4323
4310
|
t
|
|
4324
4311
|
}
|
|
4325
4312
|
),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4313
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4327
4314
|
TeamOption,
|
|
4328
4315
|
{
|
|
4329
4316
|
name: awayName,
|
|
@@ -4354,30 +4341,30 @@ function TeamOption({
|
|
|
4354
4341
|
const [imgFailed, setImgFailed] = (0, import_react23.useState)(false);
|
|
4355
4342
|
const Img = ImageComponent || require("react-native").Image;
|
|
4356
4343
|
const showImage = imageUrl && !imgFailed;
|
|
4357
|
-
return /* @__PURE__ */ (0,
|
|
4358
|
-
|
|
4344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4345
|
+
import_react_native14.TouchableOpacity,
|
|
4359
4346
|
{
|
|
4360
|
-
style: [
|
|
4347
|
+
style: [styles8.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4361
4348
|
onPress,
|
|
4362
4349
|
activeOpacity: 0.7,
|
|
4363
4350
|
children: [
|
|
4364
|
-
showImage ? /* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
4366
|
-
/* @__PURE__ */ (0,
|
|
4351
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Img, { source: { uri: imageUrl }, style: styles8.logo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.logo, styles8.logoPlaceholder] }),
|
|
4352
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.name, { color: t.text }], numberOfLines: 1, children: name }),
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.odds, { color }], children: [
|
|
4367
4354
|
odds,
|
|
4368
4355
|
"x"
|
|
4369
4356
|
] }),
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4357
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.bets, { color: t.textMuted }], children: [
|
|
4371
4358
|
bets,
|
|
4372
4359
|
" ",
|
|
4373
4360
|
bets === 1 ? "bet" : "bets"
|
|
4374
4361
|
] }),
|
|
4375
|
-
selected && /* @__PURE__ */ (0,
|
|
4362
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.badge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: styles8.badgeText, children: "Selected" }) })
|
|
4376
4363
|
]
|
|
4377
4364
|
}
|
|
4378
4365
|
);
|
|
4379
4366
|
}
|
|
4380
|
-
var
|
|
4367
|
+
var styles8 = import_react_native14.StyleSheet.create({
|
|
4381
4368
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4382
4369
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4383
4370
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4393,8 +4380,8 @@ var styles7 = import_react_native13.StyleSheet.create({
|
|
|
4393
4380
|
|
|
4394
4381
|
// src/ui/game/PlayersCard.tsx
|
|
4395
4382
|
var import_react24 = require("react");
|
|
4396
|
-
var
|
|
4397
|
-
var
|
|
4383
|
+
var import_react_native15 = require("react-native");
|
|
4384
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4398
4385
|
function truncateWallet(addr, chars) {
|
|
4399
4386
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4400
4387
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4414,12 +4401,12 @@ function PlayersCard({
|
|
|
4414
4401
|
if (team === "away") return awayColor;
|
|
4415
4402
|
return drawColor;
|
|
4416
4403
|
};
|
|
4417
|
-
return /* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4405
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.title, { color: t.text }], children: [
|
|
4419
4406
|
"Players",
|
|
4420
4407
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4421
4408
|
] }),
|
|
4422
|
-
bettors.length === 0 ? /* @__PURE__ */ (0,
|
|
4409
|
+
bettors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.empty, { color: t.textMuted }], children: "No players yet \u2014 be the first!" }) : bettors.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4423
4410
|
BettorRow,
|
|
4424
4411
|
{
|
|
4425
4412
|
bettor: b,
|
|
@@ -4444,17 +4431,17 @@ function BettorRow({
|
|
|
4444
4431
|
const [imgFailed, setImgFailed] = (0, import_react24.useState)(false);
|
|
4445
4432
|
const Img = ImageComponent || require("react-native").Image;
|
|
4446
4433
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4447
|
-
return /* @__PURE__ */ (0,
|
|
4448
|
-
/* @__PURE__ */ (0,
|
|
4449
|
-
showAvatar ? /* @__PURE__ */ (0,
|
|
4450
|
-
/* @__PURE__ */ (0,
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.dot, { backgroundColor: dotColor }] }),
|
|
4436
|
+
showAvatar ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Img, { source: { uri: ensurePngAvatar(bettor.avatar) }, style: styles9.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.avatar, styles9.avatarPlaceholder] }),
|
|
4437
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: styles9.nameCol, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.username, { color: t.text }], numberOfLines: 1, children: bettor.username || truncateWallet(bettor.wallet, truncateChars) }) }),
|
|
4438
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.amount, { color: t.textSecondary }], children: [
|
|
4452
4439
|
bettor.amount,
|
|
4453
4440
|
" SOL"
|
|
4454
4441
|
] })
|
|
4455
4442
|
] });
|
|
4456
4443
|
}
|
|
4457
|
-
var
|
|
4444
|
+
var styles9 = import_react_native15.StyleSheet.create({
|
|
4458
4445
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4459
4446
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4460
4447
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4469,8 +4456,8 @@ var styles8 = import_react_native14.StyleSheet.create({
|
|
|
4469
4456
|
|
|
4470
4457
|
// src/ui/game/JoinGameButton.tsx
|
|
4471
4458
|
var import_react25 = require("react");
|
|
4472
|
-
var
|
|
4473
|
-
var
|
|
4459
|
+
var import_react_native16 = require("react-native");
|
|
4460
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4474
4461
|
var STATUS_LABELS = {
|
|
4475
4462
|
building: "Building transaction...",
|
|
4476
4463
|
signing: "Approve in wallet...",
|
|
@@ -4486,30 +4473,30 @@ function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
|
4486
4473
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4487
4474
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4488
4475
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4489
|
-
return /* @__PURE__ */ (0,
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: [styles10.bar, { backgroundColor: t.background, borderTopColor: t.border }], children: [
|
|
4477
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.buyInRow, children: [
|
|
4478
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.buyInLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.Text, { style: [styles10.buyInValue, { color: t.text }], children: [
|
|
4493
4480
|
game.buyIn,
|
|
4494
4481
|
" SOL"
|
|
4495
4482
|
] })
|
|
4496
4483
|
] }),
|
|
4497
|
-
/* @__PURE__ */ (0,
|
|
4498
|
-
|
|
4484
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4485
|
+
import_react_native16.TouchableOpacity,
|
|
4499
4486
|
{
|
|
4500
|
-
style: [
|
|
4487
|
+
style: [styles10.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4501
4488
|
disabled: !selectedTeam || isJoining,
|
|
4502
4489
|
onPress: onJoin,
|
|
4503
4490
|
activeOpacity: 0.8,
|
|
4504
|
-
children: isJoining ? /* @__PURE__ */ (0,
|
|
4505
|
-
/* @__PURE__ */ (0,
|
|
4506
|
-
/* @__PURE__ */ (0,
|
|
4507
|
-
] }) : /* @__PURE__ */ (0,
|
|
4491
|
+
children: isJoining ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.joiningRow, children: [
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.ActivityIndicator, { size: "small", color: "#000" }),
|
|
4493
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: styles10.buttonText, children: statusLabel })
|
|
4494
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.buttonText, !selectedTeam && { color: t.textMuted }], children: selectedTeam ? `Join Bet \u2014 ${game.buyIn} SOL` : "Pick a team to bet" })
|
|
4508
4495
|
}
|
|
4509
4496
|
)
|
|
4510
4497
|
] });
|
|
4511
4498
|
}
|
|
4512
|
-
var
|
|
4499
|
+
var styles10 = import_react_native16.StyleSheet.create({
|
|
4513
4500
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4514
4501
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4515
4502
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4521,8 +4508,8 @@ var styles9 = import_react_native15.StyleSheet.create({
|
|
|
4521
4508
|
|
|
4522
4509
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4523
4510
|
var import_react26 = require("react");
|
|
4524
|
-
var
|
|
4525
|
-
var
|
|
4511
|
+
var import_react_native17 = require("react-native");
|
|
4512
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4526
4513
|
var STATUS_LABELS2 = {
|
|
4527
4514
|
building: "Building transaction...",
|
|
4528
4515
|
signing: "Approve in wallet...",
|
|
@@ -4549,9 +4536,9 @@ function CreateCustomGameSheet({
|
|
|
4549
4536
|
const [selectedAmount, setSelectedAmount] = (0, import_react26.useState)(null);
|
|
4550
4537
|
const [customAmount, setCustomAmount] = (0, import_react26.useState)("");
|
|
4551
4538
|
const [isCustom, setIsCustom] = (0, import_react26.useState)(false);
|
|
4552
|
-
const overlayOpacity = (0, import_react26.useRef)(new
|
|
4539
|
+
const overlayOpacity = (0, import_react26.useRef)(new import_react_native17.Animated.Value(0)).current;
|
|
4553
4540
|
(0, import_react26.useEffect)(() => {
|
|
4554
|
-
|
|
4541
|
+
import_react_native17.Animated.timing(overlayOpacity, {
|
|
4555
4542
|
toValue: visible ? 1 : 0,
|
|
4556
4543
|
duration: 250,
|
|
4557
4544
|
useNativeDriver: true
|
|
@@ -4621,42 +4608,42 @@ function CreateCustomGameSheet({
|
|
|
4621
4608
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4622
4609
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4623
4610
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4624
|
-
return /* @__PURE__ */ (0,
|
|
4625
|
-
|
|
4611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4612
|
+
import_react_native17.Modal,
|
|
4626
4613
|
{
|
|
4627
4614
|
visible,
|
|
4628
4615
|
animationType: "slide",
|
|
4629
4616
|
transparent: true,
|
|
4630
4617
|
onRequestClose: onDismiss,
|
|
4631
4618
|
children: [
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4633
|
-
/* @__PURE__ */ (0,
|
|
4634
|
-
|
|
4619
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Animated.View, { style: [styles11.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.TouchableOpacity, { style: styles11.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4620
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4621
|
+
import_react_native17.KeyboardAvoidingView,
|
|
4635
4622
|
{
|
|
4636
|
-
style:
|
|
4637
|
-
behavior:
|
|
4638
|
-
children: /* @__PURE__ */ (0,
|
|
4639
|
-
/* @__PURE__ */ (0,
|
|
4640
|
-
/* @__PURE__ */ (0,
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4642
|
-
/* @__PURE__ */ (0,
|
|
4623
|
+
style: styles11.keyboardView,
|
|
4624
|
+
behavior: import_react_native17.Platform.OS === "ios" ? "padding" : void 0,
|
|
4625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: styles11.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.sheet, { backgroundColor: t.background }], children: [
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: styles11.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.header, children: [
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Create Pool" : "New Game" }),
|
|
4629
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4643
4630
|
] }),
|
|
4644
|
-
!isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
4646
|
-
/* @__PURE__ */ (0,
|
|
4631
|
+
!isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.section, children: [
|
|
4632
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.sectionLabel, { color: t.textSecondary }], children: "Buy-In Amount" }),
|
|
4633
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.chipsRow, children: [
|
|
4647
4634
|
presetAmounts.map((amount) => {
|
|
4648
4635
|
const active = !isCustom && selectedAmount === amount;
|
|
4649
|
-
return /* @__PURE__ */ (0,
|
|
4650
|
-
|
|
4636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4637
|
+
import_react_native17.TouchableOpacity,
|
|
4651
4638
|
{
|
|
4652
4639
|
style: [
|
|
4653
|
-
|
|
4640
|
+
styles11.chip,
|
|
4654
4641
|
{ borderColor: active ? t.accent : t.border },
|
|
4655
4642
|
active && { backgroundColor: t.accent }
|
|
4656
4643
|
],
|
|
4657
4644
|
onPress: () => handlePresetSelect(amount),
|
|
4658
4645
|
activeOpacity: 0.8,
|
|
4659
|
-
children: /* @__PURE__ */ (0,
|
|
4646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4660
4647
|
amount,
|
|
4661
4648
|
" SOL"
|
|
4662
4649
|
] })
|
|
@@ -4664,24 +4651,24 @@ function CreateCustomGameSheet({
|
|
|
4664
4651
|
amount
|
|
4665
4652
|
);
|
|
4666
4653
|
}),
|
|
4667
|
-
/* @__PURE__ */ (0,
|
|
4668
|
-
|
|
4654
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4655
|
+
import_react_native17.TouchableOpacity,
|
|
4669
4656
|
{
|
|
4670
4657
|
style: [
|
|
4671
|
-
|
|
4658
|
+
styles11.chip,
|
|
4672
4659
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4673
4660
|
isCustom && { backgroundColor: t.accent }
|
|
4674
4661
|
],
|
|
4675
4662
|
onPress: handleCustomSelect,
|
|
4676
4663
|
activeOpacity: 0.8,
|
|
4677
|
-
children: /* @__PURE__ */ (0,
|
|
4664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4678
4665
|
}
|
|
4679
4666
|
)
|
|
4680
4667
|
] }),
|
|
4681
|
-
isCustom && /* @__PURE__ */ (0,
|
|
4682
|
-
|
|
4668
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4669
|
+
import_react_native17.TextInput,
|
|
4683
4670
|
{
|
|
4684
|
-
style: [
|
|
4671
|
+
style: [styles11.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4685
4672
|
placeholder: "Enter amount in SOL",
|
|
4686
4673
|
placeholderTextColor: t.textDim,
|
|
4687
4674
|
keyboardType: "decimal-pad",
|
|
@@ -4691,43 +4678,43 @@ function CreateCustomGameSheet({
|
|
|
4691
4678
|
}
|
|
4692
4679
|
)
|
|
4693
4680
|
] }),
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4695
|
-
/* @__PURE__ */ (0,
|
|
4696
|
-
/* @__PURE__ */ (0,
|
|
4697
|
-
/* @__PURE__ */ (0,
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4683
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4684
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: finalAmount ? `${finalAmount} SOL` : "\u2014" })
|
|
4698
4685
|
] }),
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
4701
|
-
/* @__PURE__ */ (0,
|
|
4702
|
-
/* @__PURE__ */ (0,
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max players" : "Players" }),
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: isPoolModeEnabled ? playerCount : playersLabel })
|
|
4703
4690
|
] }),
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
4706
|
-
/* @__PURE__ */ (0,
|
|
4707
|
-
/* @__PURE__ */ (0,
|
|
4708
|
-
/* @__PURE__ */ (0,
|
|
4709
|
-
finalAmount ? /* @__PURE__ */ (0,
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max pot" : "Winner Takes" }),
|
|
4694
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.winnerCol, children: [
|
|
4695
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.success }], children: finalAmount ? `${(finalAmount * playerCount * (1 - fee / 100)).toFixed(4)} SOL` : "\u2014" }),
|
|
4696
|
+
finalAmount ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.feeNote, { color: t.textDim }], children: [
|
|
4710
4697
|
fee,
|
|
4711
4698
|
"% platform fee"
|
|
4712
4699
|
] }) : null
|
|
4713
4700
|
] })
|
|
4714
4701
|
] })
|
|
4715
4702
|
] }),
|
|
4716
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
4717
|
-
/* @__PURE__ */ (0,
|
|
4718
|
-
|
|
4703
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
4704
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4705
|
+
import_react_native17.TouchableOpacity,
|
|
4719
4706
|
{
|
|
4720
4707
|
style: [
|
|
4721
|
-
|
|
4708
|
+
styles11.ctaButton,
|
|
4722
4709
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4723
4710
|
],
|
|
4724
4711
|
disabled: !canCreate,
|
|
4725
4712
|
onPress: handleCreate,
|
|
4726
4713
|
activeOpacity: 0.8,
|
|
4727
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
4714
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.ctaLoading, children: [
|
|
4715
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
4716
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.ctaText, children: statusLabel })
|
|
4717
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.ctaText, children: isPoolModeEnabled ? "Pool Created!" : STATUS_LABELS2.success }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.ctaText, !canCreate && { opacity: 0.5 }], children: isPoolModeEnabled ? `Create Pool \u2014 ${finalAmount} SOL` : effectiveAmount ? `Create Game \u2014 ${effectiveAmount} SOL` : "Select buy-in amount" })
|
|
4731
4718
|
}
|
|
4732
4719
|
)
|
|
4733
4720
|
] }) })
|
|
@@ -4737,9 +4724,9 @@ function CreateCustomGameSheet({
|
|
|
4737
4724
|
}
|
|
4738
4725
|
);
|
|
4739
4726
|
}
|
|
4740
|
-
var
|
|
4727
|
+
var styles11 = import_react_native17.StyleSheet.create({
|
|
4741
4728
|
overlay: {
|
|
4742
|
-
...
|
|
4729
|
+
...import_react_native17.StyleSheet.absoluteFillObject,
|
|
4743
4730
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4744
4731
|
},
|
|
4745
4732
|
overlayTap: {
|
|
@@ -4875,8 +4862,8 @@ var styles10 = import_react_native16.StyleSheet.create({
|
|
|
4875
4862
|
|
|
4876
4863
|
// src/ui/game/JoinGameSheet.tsx
|
|
4877
4864
|
var import_react27 = require("react");
|
|
4878
|
-
var
|
|
4879
|
-
var
|
|
4865
|
+
var import_react_native18 = require("react-native");
|
|
4866
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4880
4867
|
var STATUS_LABELS3 = {
|
|
4881
4868
|
building: "Building transaction...",
|
|
4882
4869
|
signing: "Approve in wallet...",
|
|
@@ -4901,9 +4888,9 @@ function JoinGameSheet({
|
|
|
4901
4888
|
const mutation = useJoinGame();
|
|
4902
4889
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
4903
4890
|
const [selectedTeam, setSelectedTeam] = (0, import_react27.useState)(null);
|
|
4904
|
-
const overlayOpacity = (0, import_react27.useRef)(new
|
|
4891
|
+
const overlayOpacity = (0, import_react27.useRef)(new import_react_native18.Animated.Value(0)).current;
|
|
4905
4892
|
(0, import_react27.useEffect)(() => {
|
|
4906
|
-
|
|
4893
|
+
import_react_native18.Animated.timing(overlayOpacity, {
|
|
4907
4894
|
toValue: visible ? 1 : 0,
|
|
4908
4895
|
duration: 250,
|
|
4909
4896
|
useNativeDriver: true
|
|
@@ -4967,30 +4954,30 @@ function JoinGameSheet({
|
|
|
4967
4954
|
}
|
|
4968
4955
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4969
4956
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4970
|
-
return /* @__PURE__ */ (0,
|
|
4971
|
-
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4958
|
+
import_react_native18.Modal,
|
|
4972
4959
|
{
|
|
4973
4960
|
visible,
|
|
4974
4961
|
animationType: "slide",
|
|
4975
4962
|
transparent: true,
|
|
4976
4963
|
onRequestClose: onDismiss,
|
|
4977
4964
|
children: [
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
|
|
4965
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Animated.View, { style: [styles12.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { style: styles12.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4966
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4967
|
+
import_react_native18.KeyboardAvoidingView,
|
|
4981
4968
|
{
|
|
4982
|
-
style:
|
|
4983
|
-
behavior:
|
|
4984
|
-
children: /* @__PURE__ */ (0,
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
4987
|
-
/* @__PURE__ */ (0,
|
|
4988
|
-
/* @__PURE__ */ (0,
|
|
4969
|
+
style: styles12.keyboardView,
|
|
4970
|
+
behavior: import_react_native18.Platform.OS === "ios" ? "padding" : void 0,
|
|
4971
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.sheet, { backgroundColor: t.background }], children: [
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.header, children: [
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
4975
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4989
4976
|
] }),
|
|
4990
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4991
|
-
/* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
4993
|
-
/* @__PURE__ */ (0,
|
|
4977
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.section, children: [
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
4979
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.teamsRow, children: [
|
|
4980
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4994
4981
|
TeamButton,
|
|
4995
4982
|
{
|
|
4996
4983
|
name: homeName,
|
|
@@ -5004,7 +4991,7 @@ function JoinGameSheet({
|
|
|
5004
4991
|
t
|
|
5005
4992
|
}
|
|
5006
4993
|
),
|
|
5007
|
-
/* @__PURE__ */ (0,
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5008
4995
|
TeamButton,
|
|
5009
4996
|
{
|
|
5010
4997
|
name: awayName,
|
|
@@ -5020,64 +5007,64 @@ function JoinGameSheet({
|
|
|
5020
5007
|
)
|
|
5021
5008
|
] })
|
|
5022
5009
|
] }),
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5025
|
-
/* @__PURE__ */ (0,
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5012
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5013
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
5027
5014
|
buyIn,
|
|
5028
5015
|
" SOL"
|
|
5029
5016
|
] })
|
|
5030
5017
|
] }),
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5032
|
-
isPoolModeEnabled ? /* @__PURE__ */ (0,
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5035
|
-
/* @__PURE__ */ (0,
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5019
|
+
isPoolModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: bettors.length })
|
|
5036
5023
|
] }),
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5026
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5027
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: [
|
|
5041
5028
|
totalPool,
|
|
5042
5029
|
" SOL"
|
|
5043
5030
|
] })
|
|
5044
5031
|
] })
|
|
5045
|
-
] }) : /* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5047
|
-
/* @__PURE__ */ (0,
|
|
5048
|
-
/* @__PURE__ */ (0,
|
|
5032
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: selectedName })
|
|
5049
5036
|
] }),
|
|
5050
|
-
/* @__PURE__ */ (0,
|
|
5051
|
-
/* @__PURE__ */ (0,
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
5054
5041
|
poolAfterJoin,
|
|
5055
5042
|
" SOL"
|
|
5056
5043
|
] })
|
|
5057
5044
|
] }),
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5047
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5048
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5062
5049
|
] })
|
|
5063
5050
|
] })
|
|
5064
5051
|
] }),
|
|
5065
|
-
alreadyJoined && /* @__PURE__ */ (0,
|
|
5066
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5067
|
-
/* @__PURE__ */ (0,
|
|
5068
|
-
|
|
5052
|
+
alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5053
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5054
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5055
|
+
import_react_native18.TouchableOpacity,
|
|
5069
5056
|
{
|
|
5070
5057
|
style: [
|
|
5071
|
-
|
|
5058
|
+
styles12.ctaButton,
|
|
5072
5059
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5073
5060
|
],
|
|
5074
5061
|
disabled: !canJoin,
|
|
5075
5062
|
onPress: handleJoin,
|
|
5076
5063
|
activeOpacity: 0.8,
|
|
5077
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5078
|
-
/* @__PURE__ */ (0,
|
|
5079
|
-
/* @__PURE__ */ (0,
|
|
5080
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5064
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.ctaLoading, children: [
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: statusLabel })
|
|
5067
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.ctaText, !canJoin && { opacity: 0.5 }], children: alreadyJoined ? "Already Joined" : isPoolModeEnabled ? `Join Pool \u2014 ${buyIn} SOL` : selectedTeam ? `Join Game \u2014 ${buyIn} SOL` : "Pick a side to join" })
|
|
5081
5068
|
}
|
|
5082
5069
|
)
|
|
5083
5070
|
] }) })
|
|
@@ -5101,32 +5088,32 @@ function TeamButton({
|
|
|
5101
5088
|
const [imgFailed, setImgFailed] = (0, import_react27.useState)(false);
|
|
5102
5089
|
const Img = ImageComponent || require("react-native").Image;
|
|
5103
5090
|
const showImage = imageUrl && !imgFailed;
|
|
5104
|
-
return /* @__PURE__ */ (0,
|
|
5105
|
-
|
|
5091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5092
|
+
import_react_native18.TouchableOpacity,
|
|
5106
5093
|
{
|
|
5107
|
-
style: [
|
|
5094
|
+
style: [styles12.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5108
5095
|
onPress,
|
|
5109
5096
|
activeOpacity: 0.7,
|
|
5110
5097
|
children: [
|
|
5111
|
-
showImage ? /* @__PURE__ */ (0,
|
|
5112
|
-
/* @__PURE__ */ (0,
|
|
5113
|
-
/* @__PURE__ */ (0,
|
|
5098
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Img, { source: { uri: imageUrl }, style: styles12.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.teamLogo, styles12.teamLogoPlaceholder] }),
|
|
5099
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5100
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamOdds, { color }], children: [
|
|
5114
5101
|
odds,
|
|
5115
5102
|
"x"
|
|
5116
5103
|
] }),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5104
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamBets, { color: t.textMuted }], children: [
|
|
5118
5105
|
bets,
|
|
5119
5106
|
" ",
|
|
5120
5107
|
bets === 1 ? "bet" : "bets"
|
|
5121
5108
|
] }),
|
|
5122
|
-
selected && /* @__PURE__ */ (0,
|
|
5109
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.teamBadgeText, children: "Selected" }) })
|
|
5123
5110
|
]
|
|
5124
5111
|
}
|
|
5125
5112
|
);
|
|
5126
5113
|
}
|
|
5127
|
-
var
|
|
5114
|
+
var styles12 = import_react_native18.StyleSheet.create({
|
|
5128
5115
|
overlay: {
|
|
5129
|
-
...
|
|
5116
|
+
...import_react_native18.StyleSheet.absoluteFillObject,
|
|
5130
5117
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5131
5118
|
},
|
|
5132
5119
|
overlayTap: {
|
|
@@ -5276,8 +5263,8 @@ var styles11 = import_react_native17.StyleSheet.create({
|
|
|
5276
5263
|
|
|
5277
5264
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5278
5265
|
var import_react28 = require("react");
|
|
5279
|
-
var
|
|
5280
|
-
var
|
|
5266
|
+
var import_react_native19 = require("react-native");
|
|
5267
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5281
5268
|
var STATUS_LABELS4 = {
|
|
5282
5269
|
building: "Building transaction...",
|
|
5283
5270
|
signing: "Approve in wallet...",
|
|
@@ -5296,12 +5283,12 @@ function ClaimPrizeSheet({
|
|
|
5296
5283
|
const t = useDubsTheme();
|
|
5297
5284
|
const { wallet } = useDubs();
|
|
5298
5285
|
const mutation = useClaim();
|
|
5299
|
-
const overlayOpacity = (0, import_react28.useRef)(new
|
|
5300
|
-
const celebrationScale = (0, import_react28.useRef)(new
|
|
5301
|
-
const celebrationOpacity = (0, import_react28.useRef)(new
|
|
5286
|
+
const overlayOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5287
|
+
const celebrationScale = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5288
|
+
const celebrationOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5302
5289
|
const [showCelebration, setShowCelebration] = (0, import_react28.useState)(false);
|
|
5303
5290
|
(0, import_react28.useEffect)(() => {
|
|
5304
|
-
|
|
5291
|
+
import_react_native19.Animated.timing(overlayOpacity, {
|
|
5305
5292
|
toValue: visible ? 1 : 0,
|
|
5306
5293
|
duration: 250,
|
|
5307
5294
|
useNativeDriver: true
|
|
@@ -5318,14 +5305,14 @@ function ClaimPrizeSheet({
|
|
|
5318
5305
|
(0, import_react28.useEffect)(() => {
|
|
5319
5306
|
if (mutation.status === "success" && mutation.data) {
|
|
5320
5307
|
setShowCelebration(true);
|
|
5321
|
-
|
|
5322
|
-
|
|
5308
|
+
import_react_native19.Animated.parallel([
|
|
5309
|
+
import_react_native19.Animated.spring(celebrationScale, {
|
|
5323
5310
|
toValue: 1,
|
|
5324
5311
|
tension: 50,
|
|
5325
5312
|
friction: 6,
|
|
5326
5313
|
useNativeDriver: true
|
|
5327
5314
|
}),
|
|
5328
|
-
|
|
5315
|
+
import_react_native19.Animated.timing(celebrationOpacity, {
|
|
5329
5316
|
toValue: 1,
|
|
5330
5317
|
duration: 300,
|
|
5331
5318
|
useNativeDriver: true
|
|
@@ -5357,62 +5344,62 @@ function ClaimPrizeSheet({
|
|
|
5357
5344
|
}
|
|
5358
5345
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5359
5346
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5360
|
-
return /* @__PURE__ */ (0,
|
|
5361
|
-
|
|
5347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5348
|
+
import_react_native19.Modal,
|
|
5362
5349
|
{
|
|
5363
5350
|
visible,
|
|
5364
5351
|
animationType: "slide",
|
|
5365
5352
|
transparent: true,
|
|
5366
5353
|
onRequestClose: onDismiss,
|
|
5367
5354
|
children: [
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5370
|
-
|
|
5355
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Animated.View, { style: [styles13.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { style: styles13.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5356
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5357
|
+
import_react_native19.KeyboardAvoidingView,
|
|
5371
5358
|
{
|
|
5372
|
-
style:
|
|
5373
|
-
behavior:
|
|
5374
|
-
children: /* @__PURE__ */ (0,
|
|
5375
|
-
/* @__PURE__ */ (0,
|
|
5376
|
-
/* @__PURE__ */ (0,
|
|
5377
|
-
/* @__PURE__ */ (0,
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5359
|
+
style: styles13.keyboardView,
|
|
5360
|
+
behavior: import_react_native19.Platform.OS === "ios" ? "padding" : void 0,
|
|
5361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.sheet, { backgroundColor: t.background }], children: [
|
|
5362
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5363
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.header, children: [
|
|
5364
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
5365
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5379
5366
|
] }),
|
|
5380
|
-
showCelebration && /* @__PURE__ */ (0,
|
|
5381
|
-
|
|
5367
|
+
showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5368
|
+
import_react_native19.Animated.View,
|
|
5382
5369
|
{
|
|
5383
5370
|
style: [
|
|
5384
|
-
|
|
5371
|
+
styles13.celebrationContainer,
|
|
5385
5372
|
{
|
|
5386
5373
|
opacity: celebrationOpacity,
|
|
5387
5374
|
transform: [{ scale: celebrationScale }]
|
|
5388
5375
|
}
|
|
5389
5376
|
],
|
|
5390
5377
|
children: [
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
5392
|
-
/* @__PURE__ */ (0,
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5379
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.celebrationText, { color: t.success }], children: [
|
|
5393
5380
|
"+",
|
|
5394
5381
|
prizeAmount,
|
|
5395
5382
|
" SOL"
|
|
5396
5383
|
] }),
|
|
5397
|
-
/* @__PURE__ */ (0,
|
|
5384
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5398
5385
|
]
|
|
5399
5386
|
}
|
|
5400
5387
|
),
|
|
5401
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5402
|
-
/* @__PURE__ */ (0,
|
|
5403
|
-
/* @__PURE__ */ (0,
|
|
5404
|
-
/* @__PURE__ */ (0,
|
|
5388
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5390
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
5391
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.success }], children: [
|
|
5405
5392
|
prizeAmount,
|
|
5406
5393
|
" SOL"
|
|
5407
5394
|
] })
|
|
5408
5395
|
] }),
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5410
|
-
/* @__PURE__ */ (0,
|
|
5411
|
-
/* @__PURE__ */ (0,
|
|
5412
|
-
/* @__PURE__ */ (0,
|
|
5413
|
-
|
|
5396
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5397
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5398
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
5399
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5400
|
+
import_react_native19.Text,
|
|
5414
5401
|
{
|
|
5415
|
-
style: [
|
|
5402
|
+
style: [styles13.summaryValue, { color: t.text }],
|
|
5416
5403
|
numberOfLines: 1,
|
|
5417
5404
|
children: [
|
|
5418
5405
|
gameId.slice(0, 8),
|
|
@@ -5423,21 +5410,21 @@ function ClaimPrizeSheet({
|
|
|
5423
5410
|
)
|
|
5424
5411
|
] })
|
|
5425
5412
|
] }),
|
|
5426
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5427
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5428
|
-
|
|
5413
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5414
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5415
|
+
import_react_native19.TouchableOpacity,
|
|
5429
5416
|
{
|
|
5430
5417
|
style: [
|
|
5431
|
-
|
|
5418
|
+
styles13.ctaButton,
|
|
5432
5419
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5433
5420
|
],
|
|
5434
5421
|
disabled: !canClaim,
|
|
5435
5422
|
onPress: handleClaim,
|
|
5436
5423
|
activeOpacity: 0.8,
|
|
5437
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5438
|
-
/* @__PURE__ */ (0,
|
|
5439
|
-
/* @__PURE__ */ (0,
|
|
5440
|
-
] }) : /* @__PURE__ */ (0,
|
|
5424
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.ctaLoading, children: [
|
|
5425
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.ctaText, children: statusLabel })
|
|
5427
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
5441
5428
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5442
5429
|
" \u2014 ",
|
|
5443
5430
|
prizeAmount,
|
|
@@ -5445,7 +5432,7 @@ function ClaimPrizeSheet({
|
|
|
5445
5432
|
] })
|
|
5446
5433
|
}
|
|
5447
5434
|
),
|
|
5448
|
-
mutation.data?.explorerUrl && /* @__PURE__ */ (0,
|
|
5435
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5449
5436
|
] }) })
|
|
5450
5437
|
}
|
|
5451
5438
|
)
|
|
@@ -5453,9 +5440,9 @@ function ClaimPrizeSheet({
|
|
|
5453
5440
|
}
|
|
5454
5441
|
);
|
|
5455
5442
|
}
|
|
5456
|
-
var
|
|
5443
|
+
var styles13 = import_react_native19.StyleSheet.create({
|
|
5457
5444
|
overlay: {
|
|
5458
|
-
...
|
|
5445
|
+
...import_react_native19.StyleSheet.absoluteFillObject,
|
|
5459
5446
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5460
5447
|
},
|
|
5461
5448
|
overlayTap: {
|
|
@@ -5579,8 +5566,8 @@ var styles12 = import_react_native18.StyleSheet.create({
|
|
|
5579
5566
|
|
|
5580
5567
|
// src/ui/game/ClaimButton.tsx
|
|
5581
5568
|
var import_react29 = require("react");
|
|
5582
|
-
var
|
|
5583
|
-
var
|
|
5569
|
+
var import_react_native20 = require("react-native");
|
|
5570
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5584
5571
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5585
5572
|
const t = useDubsTheme();
|
|
5586
5573
|
const { wallet } = useDubs();
|
|
@@ -5610,13 +5597,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5610
5597
|
}
|
|
5611
5598
|
const label = isRefund ? "Refund" : "Prize";
|
|
5612
5599
|
if (claimStatus.hasClaimed) {
|
|
5613
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
-
|
|
5600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5601
|
+
import_react_native20.TouchableOpacity,
|
|
5615
5602
|
{
|
|
5616
|
-
style: [
|
|
5603
|
+
style: [styles14.badge, { borderColor: t.accent }, style],
|
|
5617
5604
|
activeOpacity: 1,
|
|
5618
5605
|
disabled: true,
|
|
5619
|
-
children: /* @__PURE__ */ (0,
|
|
5606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.badgeText, { color: t.accent }], children: [
|
|
5620
5607
|
label,
|
|
5621
5608
|
" Claimed!"
|
|
5622
5609
|
] })
|
|
@@ -5626,14 +5613,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5626
5613
|
if (!isEligible) {
|
|
5627
5614
|
return null;
|
|
5628
5615
|
}
|
|
5629
|
-
return /* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5631
|
-
|
|
5616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5617
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5618
|
+
import_react_native20.TouchableOpacity,
|
|
5632
5619
|
{
|
|
5633
|
-
style: [
|
|
5620
|
+
style: [styles14.button, { backgroundColor: t.accent }, style],
|
|
5634
5621
|
activeOpacity: 0.8,
|
|
5635
5622
|
onPress: () => setSheetVisible(true),
|
|
5636
|
-
children: /* @__PURE__ */ (0,
|
|
5623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: styles14.buttonText, children: [
|
|
5637
5624
|
"Claim ",
|
|
5638
5625
|
label,
|
|
5639
5626
|
" \u2014 ",
|
|
@@ -5642,7 +5629,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5642
5629
|
] })
|
|
5643
5630
|
}
|
|
5644
5631
|
),
|
|
5645
|
-
/* @__PURE__ */ (0,
|
|
5632
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5646
5633
|
ClaimPrizeSheet,
|
|
5647
5634
|
{
|
|
5648
5635
|
visible: sheetVisible,
|
|
@@ -5656,7 +5643,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5656
5643
|
)
|
|
5657
5644
|
] });
|
|
5658
5645
|
}
|
|
5659
|
-
var
|
|
5646
|
+
var styles14 = import_react_native20.StyleSheet.create({
|
|
5660
5647
|
button: {
|
|
5661
5648
|
height: 52,
|
|
5662
5649
|
borderRadius: 14,
|