@dubsdotapp/expo 0.2.77 → 0.2.78
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 +656 -671
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +638 -646
- 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 +18 -138
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)}`;
|
|
@@ -3641,7 +3710,7 @@ function UserProfileSheet({
|
|
|
3641
3710
|
const t = useDubsTheme();
|
|
3642
3711
|
const { client } = useDubs();
|
|
3643
3712
|
const push = usePushNotifications();
|
|
3644
|
-
const overlayOpacity = (0, import_react20.useRef)(new
|
|
3713
|
+
const overlayOpacity = (0, import_react20.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
3645
3714
|
const parsed = (0, import_react20.useMemo)(() => parseAvatarUrl(user.avatar), [user.avatar]);
|
|
3646
3715
|
const [avatarStyle, setAvatarStyle] = (0, import_react20.useState)(parsed.style);
|
|
3647
3716
|
const [avatarSeed, setAvatarSeed] = (0, import_react20.useState)(parsed.seed);
|
|
@@ -3655,7 +3724,7 @@ function UserProfileSheet({
|
|
|
3655
3724
|
setBgColor(p.bg);
|
|
3656
3725
|
}, [user.avatar]);
|
|
3657
3726
|
(0, import_react20.useEffect)(() => {
|
|
3658
|
-
|
|
3727
|
+
import_react_native11.Animated.timing(overlayOpacity, {
|
|
3659
3728
|
toValue: visible ? 1 : 0,
|
|
3660
3729
|
duration: 250,
|
|
3661
3730
|
useNativeDriver: true
|
|
@@ -3664,7 +3733,7 @@ function UserProfileSheet({
|
|
|
3664
3733
|
(0, import_react20.useEffect)(() => {
|
|
3665
3734
|
if (visible) setError(null);
|
|
3666
3735
|
}, [visible]);
|
|
3667
|
-
const currentAvatarUrl =
|
|
3736
|
+
const currentAvatarUrl = getAvatarUrl(avatarStyle, avatarSeed, bgColor);
|
|
3668
3737
|
const saveAvatar = (0, import_react20.useCallback)(async (newUrl) => {
|
|
3669
3738
|
setSaving(true);
|
|
3670
3739
|
setError(null);
|
|
@@ -3677,176 +3746,122 @@ function UserProfileSheet({
|
|
|
3677
3746
|
setSaving(false);
|
|
3678
3747
|
}
|
|
3679
3748
|
}, [client, onAvatarUpdated]);
|
|
3680
|
-
const
|
|
3681
|
-
(style)
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
},
|
|
3685
|
-
[avatarSeed, bgColor, saveAvatar]
|
|
3686
|
-
);
|
|
3749
|
+
const handleStyleChange = (0, import_react20.useCallback)((style) => {
|
|
3750
|
+
setAvatarStyle(style);
|
|
3751
|
+
saveAvatar(getAvatarUrl(style, avatarSeed, bgColor));
|
|
3752
|
+
}, [avatarSeed, bgColor, saveAvatar]);
|
|
3687
3753
|
const handleShuffle = (0, import_react20.useCallback)(() => {
|
|
3688
|
-
const newSeed =
|
|
3754
|
+
const newSeed = generateSeed();
|
|
3689
3755
|
setAvatarSeed(newSeed);
|
|
3690
|
-
saveAvatar(
|
|
3756
|
+
saveAvatar(getAvatarUrl(avatarStyle, newSeed, bgColor));
|
|
3691
3757
|
}, [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,
|
|
3758
|
+
const handleBgChange = (0, import_react20.useCallback)((color) => {
|
|
3759
|
+
setBgColor(color);
|
|
3760
|
+
saveAvatar(getAvatarUrl(avatarStyle, avatarSeed, color));
|
|
3761
|
+
}, [avatarStyle, avatarSeed, saveAvatar]);
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3763
|
+
import_react_native11.Modal,
|
|
3701
3764
|
{
|
|
3702
3765
|
visible,
|
|
3703
3766
|
animationType: "slide",
|
|
3704
3767
|
transparent: true,
|
|
3705
3768
|
onRequestClose: onDismiss,
|
|
3706
3769
|
children: [
|
|
3707
|
-
/* @__PURE__ */ (0,
|
|
3708
|
-
/* @__PURE__ */ (0,
|
|
3709
|
-
|
|
3770
|
+
/* @__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 }) }),
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3772
|
+
import_react_native11.KeyboardAvoidingView,
|
|
3710
3773
|
{
|
|
3711
|
-
style:
|
|
3712
|
-
behavior:
|
|
3713
|
-
children: /* @__PURE__ */ (0,
|
|
3714
|
-
/* @__PURE__ */ (0,
|
|
3715
|
-
/* @__PURE__ */ (0,
|
|
3716
|
-
/* @__PURE__ */ (0,
|
|
3717
|
-
/* @__PURE__ */ (0,
|
|
3774
|
+
style: styles5.keyboardView,
|
|
3775
|
+
behavior: import_react_native11.Platform.OS === "ios" ? "padding" : void 0,
|
|
3776
|
+
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: [
|
|
3777
|
+
/* @__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 }] }) }),
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.header, children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.headerTitle, { color: t.text }], children: "Profile" }),
|
|
3780
|
+
/* @__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
3781
|
] }),
|
|
3719
|
-
/* @__PURE__ */ (0,
|
|
3720
|
-
|
|
3782
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3783
|
+
import_react_native11.ScrollView,
|
|
3721
3784
|
{
|
|
3722
|
-
style:
|
|
3723
|
-
contentContainerStyle:
|
|
3785
|
+
style: styles5.scrollContent,
|
|
3786
|
+
contentContainerStyle: styles5.scrollContentInner,
|
|
3724
3787
|
showsVerticalScrollIndicator: false,
|
|
3725
3788
|
bounces: false,
|
|
3726
3789
|
children: [
|
|
3727
|
-
/* @__PURE__ */ (0,
|
|
3728
|
-
/* @__PURE__ */ (0,
|
|
3729
|
-
/* @__PURE__ */ (0,
|
|
3730
|
-
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.avatarSection, children: [
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.avatarContainer, { borderColor: t.border }], children: [
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3793
|
+
import_react_native11.Image,
|
|
3731
3794
|
{
|
|
3732
3795
|
source: { uri: currentAvatarUrl },
|
|
3733
|
-
style:
|
|
3796
|
+
style: styles5.avatar
|
|
3734
3797
|
}
|
|
3735
3798
|
),
|
|
3736
|
-
saving && /* @__PURE__ */ (0,
|
|
3799
|
+
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
3800
|
] }),
|
|
3738
|
-
user.username ? /* @__PURE__ */ (0,
|
|
3739
|
-
/* @__PURE__ */ (0,
|
|
3801
|
+
user.username ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.username, { color: t.text }], children: user.username }) : null,
|
|
3802
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.walletAddress, { color: t.textMuted }], children: truncateAddress3(user.walletAddress, 6) })
|
|
3740
3803
|
] }),
|
|
3741
|
-
/* @__PURE__ */ (0,
|
|
3742
|
-
/* @__PURE__ */ (0,
|
|
3743
|
-
/* @__PURE__ */ (0,
|
|
3744
|
-
/* @__PURE__ */ (0,
|
|
3745
|
-
|
|
3804
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.section, children: [
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.sectionHeaderRow, children: [
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.sectionLabel, { color: t.textSecondary }], children: "Change Avatar" }),
|
|
3807
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3808
|
+
import_react_native11.TouchableOpacity,
|
|
3746
3809
|
{
|
|
3747
|
-
style: [
|
|
3810
|
+
style: [styles5.shuffleButton, { borderColor: t.border }],
|
|
3748
3811
|
onPress: handleShuffle,
|
|
3749
3812
|
activeOpacity: 0.7,
|
|
3750
3813
|
disabled: saving,
|
|
3751
|
-
children: /* @__PURE__ */ (0,
|
|
3814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.shuffleText, { color: t.accent }], children: "Shuffle" })
|
|
3752
3815
|
}
|
|
3753
3816
|
)
|
|
3754
3817
|
] }),
|
|
3755
|
-
/* @__PURE__ */ (0,
|
|
3756
|
-
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3819
|
+
AvatarEditor,
|
|
3757
3820
|
{
|
|
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
|
-
})
|
|
3821
|
+
style: avatarStyle,
|
|
3822
|
+
seed: avatarSeed,
|
|
3823
|
+
bg: bgColor,
|
|
3824
|
+
onStyleChange: handleStyleChange,
|
|
3825
|
+
onSeedChange: setAvatarSeed,
|
|
3826
|
+
onBgChange: handleBgChange,
|
|
3827
|
+
disabled: saving
|
|
3813
3828
|
}
|
|
3814
3829
|
)
|
|
3815
3830
|
] }),
|
|
3816
|
-
error ? /* @__PURE__ */ (0,
|
|
3817
|
-
push.enabled && /* @__PURE__ */ (0,
|
|
3818
|
-
/* @__PURE__ */ (0,
|
|
3819
|
-
/* @__PURE__ */ (0,
|
|
3820
|
-
/* @__PURE__ */ (0,
|
|
3821
|
-
|
|
3831
|
+
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,
|
|
3832
|
+
push.enabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.notifRow, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3833
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.notifLeft, children: [
|
|
3834
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.notifLabel, { color: t.text }], children: "Push Notifications" }),
|
|
3835
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3836
|
+
import_react_native11.Text,
|
|
3822
3837
|
{
|
|
3823
3838
|
style: [
|
|
3824
|
-
|
|
3839
|
+
styles5.notifStatus,
|
|
3825
3840
|
{ color: push.hasPermission ? t.success : t.textMuted }
|
|
3826
3841
|
],
|
|
3827
3842
|
children: push.hasPermission ? "Enabled" : "Disabled"
|
|
3828
3843
|
}
|
|
3829
3844
|
)
|
|
3830
3845
|
] }),
|
|
3831
|
-
!push.hasPermission && /* @__PURE__ */ (0,
|
|
3832
|
-
|
|
3846
|
+
!push.hasPermission && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3847
|
+
import_react_native11.TouchableOpacity,
|
|
3833
3848
|
{
|
|
3834
|
-
style: [
|
|
3849
|
+
style: [styles5.enableButton, { backgroundColor: t.accent }],
|
|
3835
3850
|
onPress: push.register,
|
|
3836
3851
|
disabled: push.loading,
|
|
3837
3852
|
activeOpacity: 0.8,
|
|
3838
|
-
children: push.loading ? /* @__PURE__ */ (0,
|
|
3853
|
+
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
3854
|
}
|
|
3840
3855
|
)
|
|
3841
3856
|
] }),
|
|
3842
|
-
push.enabled && push.error ? /* @__PURE__ */ (0,
|
|
3843
|
-
onDisconnect ? /* @__PURE__ */ (0,
|
|
3844
|
-
|
|
3857
|
+
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,
|
|
3858
|
+
onDisconnect ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3859
|
+
import_react_native11.TouchableOpacity,
|
|
3845
3860
|
{
|
|
3846
|
-
style: [
|
|
3861
|
+
style: [styles5.disconnectButton, { borderColor: t.live }],
|
|
3847
3862
|
onPress: onDisconnect,
|
|
3848
3863
|
activeOpacity: 0.7,
|
|
3849
|
-
children: /* @__PURE__ */ (0,
|
|
3864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.disconnectText, { color: t.live }], children: "Disconnect Wallet" })
|
|
3850
3865
|
}
|
|
3851
3866
|
) : null
|
|
3852
3867
|
]
|
|
@@ -3859,9 +3874,9 @@ function UserProfileSheet({
|
|
|
3859
3874
|
}
|
|
3860
3875
|
);
|
|
3861
3876
|
}
|
|
3862
|
-
var
|
|
3877
|
+
var styles5 = import_react_native11.StyleSheet.create({
|
|
3863
3878
|
overlay: {
|
|
3864
|
-
...
|
|
3879
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3865
3880
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
3866
3881
|
},
|
|
3867
3882
|
overlayTap: {
|
|
@@ -3879,7 +3894,7 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3879
3894
|
borderTopRightRadius: 24,
|
|
3880
3895
|
paddingHorizontal: 20,
|
|
3881
3896
|
paddingBottom: 0,
|
|
3882
|
-
height:
|
|
3897
|
+
height: import_react_native11.Dimensions.get("window").height * 0.7
|
|
3883
3898
|
},
|
|
3884
3899
|
handleRow: {
|
|
3885
3900
|
alignItems: "center",
|
|
@@ -3912,7 +3927,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3912
3927
|
scrollContentInner: {
|
|
3913
3928
|
paddingBottom: 8
|
|
3914
3929
|
},
|
|
3915
|
-
// Avatar
|
|
3916
3930
|
avatarSection: {
|
|
3917
3931
|
alignItems: "center",
|
|
3918
3932
|
paddingTop: 8,
|
|
@@ -3928,11 +3942,10 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3928
3942
|
},
|
|
3929
3943
|
avatar: {
|
|
3930
3944
|
width: "100%",
|
|
3931
|
-
height: "100%"
|
|
3932
|
-
backgroundColor: "#1a1a2e"
|
|
3945
|
+
height: "100%"
|
|
3933
3946
|
},
|
|
3934
3947
|
avatarLoading: {
|
|
3935
|
-
...
|
|
3948
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3936
3949
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
3937
3950
|
justifyContent: "center",
|
|
3938
3951
|
alignItems: "center"
|
|
@@ -3945,7 +3958,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3945
3958
|
fontSize: 13,
|
|
3946
3959
|
fontFamily: "monospace"
|
|
3947
3960
|
},
|
|
3948
|
-
// Change Avatar
|
|
3949
3961
|
section: {
|
|
3950
3962
|
marginBottom: 20,
|
|
3951
3963
|
gap: 12
|
|
@@ -3969,31 +3981,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3969
3981
|
fontSize: 13,
|
|
3970
3982
|
fontWeight: "600"
|
|
3971
3983
|
},
|
|
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
3984
|
errorBox: {
|
|
3998
3985
|
marginBottom: 16,
|
|
3999
3986
|
borderRadius: 12,
|
|
@@ -4004,7 +3991,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4004
3991
|
fontSize: 13,
|
|
4005
3992
|
fontWeight: "500"
|
|
4006
3993
|
},
|
|
4007
|
-
// Push Notifications
|
|
4008
3994
|
notifRow: {
|
|
4009
3995
|
flexDirection: "row",
|
|
4010
3996
|
alignItems: "center",
|
|
@@ -4035,7 +4021,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4035
4021
|
fontSize: 14,
|
|
4036
4022
|
fontWeight: "700"
|
|
4037
4023
|
},
|
|
4038
|
-
// Disconnect
|
|
4039
4024
|
disconnectButton: {
|
|
4040
4025
|
height: 52,
|
|
4041
4026
|
borderRadius: 16,
|
|
@@ -4051,8 +4036,8 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
4051
4036
|
|
|
4052
4037
|
// src/ui/game/GamePoster.tsx
|
|
4053
4038
|
var import_react21 = require("react");
|
|
4054
|
-
var
|
|
4055
|
-
var
|
|
4039
|
+
var import_react_native12 = require("react-native");
|
|
4040
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4056
4041
|
function computeCountdown(lockTimestamp) {
|
|
4057
4042
|
if (!lockTimestamp) return "";
|
|
4058
4043
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -4073,27 +4058,27 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4073
4058
|
const away = opponents[1];
|
|
4074
4059
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
4075
4060
|
const isLive = countdown === "LIVE";
|
|
4076
|
-
return /* @__PURE__ */ (0,
|
|
4077
|
-
game.media?.poster ? /* @__PURE__ */ (0,
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.container, children: [
|
|
4062
|
+
game.media?.poster ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4078
4063
|
Img,
|
|
4079
4064
|
{
|
|
4080
4065
|
source: { uri: game.media.poster },
|
|
4081
|
-
style:
|
|
4066
|
+
style: styles6.image,
|
|
4082
4067
|
resizeMode: "cover"
|
|
4083
4068
|
}
|
|
4084
|
-
) : /* @__PURE__ */ (0,
|
|
4085
|
-
/* @__PURE__ */ (0,
|
|
4086
|
-
/* @__PURE__ */ (0,
|
|
4087
|
-
/* @__PURE__ */ (0,
|
|
4069
|
+
) : /* @__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: [
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: home?.imageUrl, size: 56, Img }),
|
|
4071
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.vs, children: "VS" }),
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: away?.imageUrl, size: 56, Img })
|
|
4088
4073
|
] }) }),
|
|
4089
|
-
/* @__PURE__ */ (0,
|
|
4090
|
-
/* @__PURE__ */ (0,
|
|
4091
|
-
/* @__PURE__ */ (0,
|
|
4092
|
-
/* @__PURE__ */ (0,
|
|
4093
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.overlay }),
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.teamNames, children: [
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: home?.name || "Home" }),
|
|
4077
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameVs, children: "vs" }),
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: away?.name || "Away" })
|
|
4094
4079
|
] }),
|
|
4095
|
-
countdown ? /* @__PURE__ */ (0,
|
|
4096
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
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,
|
|
4081
|
+
/* @__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
4082
|
game.totalPool || 0,
|
|
4098
4083
|
" SOL"
|
|
4099
4084
|
] }) })
|
|
@@ -4102,9 +4087,9 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4102
4087
|
function TeamLogoInternal({ url, size, Img }) {
|
|
4103
4088
|
const [failed, setFailed] = (0, import_react21.useState)(false);
|
|
4104
4089
|
if (!url || failed) {
|
|
4105
|
-
return /* @__PURE__ */ (0,
|
|
4090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
4106
4091
|
}
|
|
4107
|
-
return /* @__PURE__ */ (0,
|
|
4092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4108
4093
|
Img,
|
|
4109
4094
|
{
|
|
4110
4095
|
source: { uri: url },
|
|
@@ -4114,7 +4099,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
4114
4099
|
}
|
|
4115
4100
|
);
|
|
4116
4101
|
}
|
|
4117
|
-
var
|
|
4102
|
+
var styles6 = import_react_native12.StyleSheet.create({
|
|
4118
4103
|
container: {
|
|
4119
4104
|
height: 200,
|
|
4120
4105
|
borderRadius: 16,
|
|
@@ -4122,12 +4107,12 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4122
4107
|
position: "relative"
|
|
4123
4108
|
},
|
|
4124
4109
|
image: {
|
|
4125
|
-
...
|
|
4110
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4126
4111
|
justifyContent: "center",
|
|
4127
4112
|
alignItems: "center"
|
|
4128
4113
|
},
|
|
4129
4114
|
overlay: {
|
|
4130
|
-
...
|
|
4115
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4131
4116
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4132
4117
|
},
|
|
4133
4118
|
fallback: {
|
|
@@ -4202,8 +4187,8 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4202
4187
|
|
|
4203
4188
|
// src/ui/game/LivePoolsCard.tsx
|
|
4204
4189
|
var import_react22 = require("react");
|
|
4205
|
-
var
|
|
4206
|
-
var
|
|
4190
|
+
var import_react_native13 = require("react-native");
|
|
4191
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4207
4192
|
function LivePoolsCard({
|
|
4208
4193
|
game,
|
|
4209
4194
|
shortName,
|
|
@@ -4225,29 +4210,29 @@ function LivePoolsCard({
|
|
|
4225
4210
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4226
4211
|
};
|
|
4227
4212
|
}, [homePool, awayPool, totalPool]);
|
|
4228
|
-
return /* @__PURE__ */ (0,
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4230
|
-
/* @__PURE__ */ (0,
|
|
4213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: [styles7.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4214
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.title, { color: t.text }], children: "Live Pools" }),
|
|
4215
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.total, { color: t.accent }], children: [
|
|
4231
4216
|
totalPool,
|
|
4232
4217
|
" SOL total"
|
|
4233
4218
|
] }),
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4235
|
-
/* @__PURE__ */ (0,
|
|
4236
|
-
/* @__PURE__ */ (0,
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.bars, children: [
|
|
4220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: homeName, amount: homePool, percent: homePercent, color: homeColor, t }),
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: awayName, amount: awayPool, percent: awayPercent, color: awayColor, t })
|
|
4237
4222
|
] }),
|
|
4238
|
-
/* @__PURE__ */ (0,
|
|
4239
|
-
/* @__PURE__ */ (0,
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.oddsRow, children: [
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4240
4225
|
homeName,
|
|
4241
4226
|
": ",
|
|
4242
|
-
/* @__PURE__ */ (0,
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4243
4228
|
homeOdds,
|
|
4244
4229
|
"x"
|
|
4245
4230
|
] })
|
|
4246
4231
|
] }),
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4248
4233
|
awayName,
|
|
4249
4234
|
": ",
|
|
4250
|
-
/* @__PURE__ */ (0,
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4251
4236
|
awayOdds,
|
|
4252
4237
|
"x"
|
|
4253
4238
|
] })
|
|
@@ -4256,16 +4241,16 @@ function LivePoolsCard({
|
|
|
4256
4241
|
] });
|
|
4257
4242
|
}
|
|
4258
4243
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4259
|
-
return /* @__PURE__ */ (0,
|
|
4260
|
-
/* @__PURE__ */ (0,
|
|
4261
|
-
/* @__PURE__ */ (0,
|
|
4262
|
-
/* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.barRow, children: [
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.barLabel, { color: t.textSecondary }], numberOfLines: 1, children: name }),
|
|
4246
|
+
/* @__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 }] }) }),
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.barAmount, { color: t.text }], children: [
|
|
4263
4248
|
amount,
|
|
4264
4249
|
" SOL"
|
|
4265
4250
|
] })
|
|
4266
4251
|
] });
|
|
4267
4252
|
}
|
|
4268
|
-
var
|
|
4253
|
+
var styles7 = import_react_native13.StyleSheet.create({
|
|
4269
4254
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4270
4255
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4271
4256
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4281,8 +4266,8 @@ var styles6 = import_react_native12.StyleSheet.create({
|
|
|
4281
4266
|
|
|
4282
4267
|
// src/ui/game/PickWinnerCard.tsx
|
|
4283
4268
|
var import_react23 = require("react");
|
|
4284
|
-
var
|
|
4285
|
-
var
|
|
4269
|
+
var import_react_native14 = require("react-native");
|
|
4270
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4286
4271
|
function PickWinnerCard({
|
|
4287
4272
|
game,
|
|
4288
4273
|
selectedTeam,
|
|
@@ -4306,10 +4291,10 @@ function PickWinnerCard({
|
|
|
4306
4291
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4307
4292
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4308
4293
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4309
|
-
return /* @__PURE__ */ (0,
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
4311
|
-
/* @__PURE__ */ (0,
|
|
4312
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: [styles8.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.title, { color: t.text }], children: "Pick Your Winner" }),
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.row, children: [
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4313
4298
|
TeamOption,
|
|
4314
4299
|
{
|
|
4315
4300
|
name: homeName,
|
|
@@ -4323,7 +4308,7 @@ function PickWinnerCard({
|
|
|
4323
4308
|
t
|
|
4324
4309
|
}
|
|
4325
4310
|
),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4327
4312
|
TeamOption,
|
|
4328
4313
|
{
|
|
4329
4314
|
name: awayName,
|
|
@@ -4354,30 +4339,30 @@ function TeamOption({
|
|
|
4354
4339
|
const [imgFailed, setImgFailed] = (0, import_react23.useState)(false);
|
|
4355
4340
|
const Img = ImageComponent || require("react-native").Image;
|
|
4356
4341
|
const showImage = imageUrl && !imgFailed;
|
|
4357
|
-
return /* @__PURE__ */ (0,
|
|
4358
|
-
|
|
4342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4343
|
+
import_react_native14.TouchableOpacity,
|
|
4359
4344
|
{
|
|
4360
|
-
style: [
|
|
4345
|
+
style: [styles8.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4361
4346
|
onPress,
|
|
4362
4347
|
activeOpacity: 0.7,
|
|
4363
4348
|
children: [
|
|
4364
|
-
showImage ? /* @__PURE__ */ (0,
|
|
4365
|
-
/* @__PURE__ */ (0,
|
|
4366
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
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] }),
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.name, { color: t.text }], numberOfLines: 1, children: name }),
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.odds, { color }], children: [
|
|
4367
4352
|
odds,
|
|
4368
4353
|
"x"
|
|
4369
4354
|
] }),
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.bets, { color: t.textMuted }], children: [
|
|
4371
4356
|
bets,
|
|
4372
4357
|
" ",
|
|
4373
4358
|
bets === 1 ? "bet" : "bets"
|
|
4374
4359
|
] }),
|
|
4375
|
-
selected && /* @__PURE__ */ (0,
|
|
4360
|
+
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
4361
|
]
|
|
4377
4362
|
}
|
|
4378
4363
|
);
|
|
4379
4364
|
}
|
|
4380
|
-
var
|
|
4365
|
+
var styles8 = import_react_native14.StyleSheet.create({
|
|
4381
4366
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4382
4367
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4383
4368
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4393,8 +4378,8 @@ var styles7 = import_react_native13.StyleSheet.create({
|
|
|
4393
4378
|
|
|
4394
4379
|
// src/ui/game/PlayersCard.tsx
|
|
4395
4380
|
var import_react24 = require("react");
|
|
4396
|
-
var
|
|
4397
|
-
var
|
|
4381
|
+
var import_react_native15 = require("react-native");
|
|
4382
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4398
4383
|
function truncateWallet(addr, chars) {
|
|
4399
4384
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4400
4385
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4414,12 +4399,12 @@ function PlayersCard({
|
|
|
4414
4399
|
if (team === "away") return awayColor;
|
|
4415
4400
|
return drawColor;
|
|
4416
4401
|
};
|
|
4417
|
-
return /* @__PURE__ */ (0,
|
|
4418
|
-
/* @__PURE__ */ (0,
|
|
4402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.title, { color: t.text }], children: [
|
|
4419
4404
|
"Players",
|
|
4420
4405
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4421
4406
|
] }),
|
|
4422
|
-
bettors.length === 0 ? /* @__PURE__ */ (0,
|
|
4407
|
+
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
4408
|
BettorRow,
|
|
4424
4409
|
{
|
|
4425
4410
|
bettor: b,
|
|
@@ -4444,17 +4429,17 @@ function BettorRow({
|
|
|
4444
4429
|
const [imgFailed, setImgFailed] = (0, import_react24.useState)(false);
|
|
4445
4430
|
const Img = ImageComponent || require("react-native").Image;
|
|
4446
4431
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4447
|
-
return /* @__PURE__ */ (0,
|
|
4448
|
-
/* @__PURE__ */ (0,
|
|
4449
|
-
showAvatar ? /* @__PURE__ */ (0,
|
|
4450
|
-
/* @__PURE__ */ (0,
|
|
4451
|
-
/* @__PURE__ */ (0,
|
|
4432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4433
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.dot, { backgroundColor: dotColor }] }),
|
|
4434
|
+
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] }),
|
|
4435
|
+
/* @__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) }) }),
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.amount, { color: t.textSecondary }], children: [
|
|
4452
4437
|
bettor.amount,
|
|
4453
4438
|
" SOL"
|
|
4454
4439
|
] })
|
|
4455
4440
|
] });
|
|
4456
4441
|
}
|
|
4457
|
-
var
|
|
4442
|
+
var styles9 = import_react_native15.StyleSheet.create({
|
|
4458
4443
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4459
4444
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4460
4445
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4469,8 +4454,8 @@ var styles8 = import_react_native14.StyleSheet.create({
|
|
|
4469
4454
|
|
|
4470
4455
|
// src/ui/game/JoinGameButton.tsx
|
|
4471
4456
|
var import_react25 = require("react");
|
|
4472
|
-
var
|
|
4473
|
-
var
|
|
4457
|
+
var import_react_native16 = require("react-native");
|
|
4458
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4474
4459
|
var STATUS_LABELS = {
|
|
4475
4460
|
building: "Building transaction...",
|
|
4476
4461
|
signing: "Approve in wallet...",
|
|
@@ -4486,30 +4471,30 @@ function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
|
4486
4471
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4487
4472
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4488
4473
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4489
|
-
return /* @__PURE__ */ (0,
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4491
|
-
/* @__PURE__ */ (0,
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: [styles10.bar, { backgroundColor: t.background, borderTopColor: t.border }], children: [
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.buyInRow, children: [
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.buyInLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4477
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.Text, { style: [styles10.buyInValue, { color: t.text }], children: [
|
|
4493
4478
|
game.buyIn,
|
|
4494
4479
|
" SOL"
|
|
4495
4480
|
] })
|
|
4496
4481
|
] }),
|
|
4497
|
-
/* @__PURE__ */ (0,
|
|
4498
|
-
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4483
|
+
import_react_native16.TouchableOpacity,
|
|
4499
4484
|
{
|
|
4500
|
-
style: [
|
|
4485
|
+
style: [styles10.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4501
4486
|
disabled: !selectedTeam || isJoining,
|
|
4502
4487
|
onPress: onJoin,
|
|
4503
4488
|
activeOpacity: 0.8,
|
|
4504
|
-
children: isJoining ? /* @__PURE__ */ (0,
|
|
4505
|
-
/* @__PURE__ */ (0,
|
|
4506
|
-
/* @__PURE__ */ (0,
|
|
4507
|
-
] }) : /* @__PURE__ */ (0,
|
|
4489
|
+
children: isJoining ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.joiningRow, children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.ActivityIndicator, { size: "small", color: "#000" }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: styles10.buttonText, children: statusLabel })
|
|
4492
|
+
] }) : /* @__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
4493
|
}
|
|
4509
4494
|
)
|
|
4510
4495
|
] });
|
|
4511
4496
|
}
|
|
4512
|
-
var
|
|
4497
|
+
var styles10 = import_react_native16.StyleSheet.create({
|
|
4513
4498
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4514
4499
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4515
4500
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4521,8 +4506,8 @@ var styles9 = import_react_native15.StyleSheet.create({
|
|
|
4521
4506
|
|
|
4522
4507
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4523
4508
|
var import_react26 = require("react");
|
|
4524
|
-
var
|
|
4525
|
-
var
|
|
4509
|
+
var import_react_native17 = require("react-native");
|
|
4510
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4526
4511
|
var STATUS_LABELS2 = {
|
|
4527
4512
|
building: "Building transaction...",
|
|
4528
4513
|
signing: "Approve in wallet...",
|
|
@@ -4549,9 +4534,9 @@ function CreateCustomGameSheet({
|
|
|
4549
4534
|
const [selectedAmount, setSelectedAmount] = (0, import_react26.useState)(null);
|
|
4550
4535
|
const [customAmount, setCustomAmount] = (0, import_react26.useState)("");
|
|
4551
4536
|
const [isCustom, setIsCustom] = (0, import_react26.useState)(false);
|
|
4552
|
-
const overlayOpacity = (0, import_react26.useRef)(new
|
|
4537
|
+
const overlayOpacity = (0, import_react26.useRef)(new import_react_native17.Animated.Value(0)).current;
|
|
4553
4538
|
(0, import_react26.useEffect)(() => {
|
|
4554
|
-
|
|
4539
|
+
import_react_native17.Animated.timing(overlayOpacity, {
|
|
4555
4540
|
toValue: visible ? 1 : 0,
|
|
4556
4541
|
duration: 250,
|
|
4557
4542
|
useNativeDriver: true
|
|
@@ -4621,42 +4606,42 @@ function CreateCustomGameSheet({
|
|
|
4621
4606
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4622
4607
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4623
4608
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4624
|
-
return /* @__PURE__ */ (0,
|
|
4625
|
-
|
|
4609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4610
|
+
import_react_native17.Modal,
|
|
4626
4611
|
{
|
|
4627
4612
|
visible,
|
|
4628
4613
|
animationType: "slide",
|
|
4629
4614
|
transparent: true,
|
|
4630
4615
|
onRequestClose: onDismiss,
|
|
4631
4616
|
children: [
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4633
|
-
/* @__PURE__ */ (0,
|
|
4634
|
-
|
|
4617
|
+
/* @__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 }) }),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4619
|
+
import_react_native17.KeyboardAvoidingView,
|
|
4635
4620
|
{
|
|
4636
|
-
style:
|
|
4637
|
-
behavior:
|
|
4638
|
-
children: /* @__PURE__ */ (0,
|
|
4639
|
-
/* @__PURE__ */ (0,
|
|
4640
|
-
/* @__PURE__ */ (0,
|
|
4641
|
-
/* @__PURE__ */ (0,
|
|
4642
|
-
/* @__PURE__ */ (0,
|
|
4621
|
+
style: styles11.keyboardView,
|
|
4622
|
+
behavior: import_react_native17.Platform.OS === "ios" ? "padding" : void 0,
|
|
4623
|
+
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: [
|
|
4624
|
+
/* @__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 }] }) }),
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.header, children: [
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Create Pool" : "New Game" }),
|
|
4627
|
+
/* @__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
4628
|
] }),
|
|
4644
|
-
!isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4645
|
-
/* @__PURE__ */ (0,
|
|
4646
|
-
/* @__PURE__ */ (0,
|
|
4629
|
+
!isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.section, children: [
|
|
4630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.sectionLabel, { color: t.textSecondary }], children: "Buy-In Amount" }),
|
|
4631
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.chipsRow, children: [
|
|
4647
4632
|
presetAmounts.map((amount) => {
|
|
4648
4633
|
const active = !isCustom && selectedAmount === amount;
|
|
4649
|
-
return /* @__PURE__ */ (0,
|
|
4650
|
-
|
|
4634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4635
|
+
import_react_native17.TouchableOpacity,
|
|
4651
4636
|
{
|
|
4652
4637
|
style: [
|
|
4653
|
-
|
|
4638
|
+
styles11.chip,
|
|
4654
4639
|
{ borderColor: active ? t.accent : t.border },
|
|
4655
4640
|
active && { backgroundColor: t.accent }
|
|
4656
4641
|
],
|
|
4657
4642
|
onPress: () => handlePresetSelect(amount),
|
|
4658
4643
|
activeOpacity: 0.8,
|
|
4659
|
-
children: /* @__PURE__ */ (0,
|
|
4644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4660
4645
|
amount,
|
|
4661
4646
|
" SOL"
|
|
4662
4647
|
] })
|
|
@@ -4664,24 +4649,24 @@ function CreateCustomGameSheet({
|
|
|
4664
4649
|
amount
|
|
4665
4650
|
);
|
|
4666
4651
|
}),
|
|
4667
|
-
/* @__PURE__ */ (0,
|
|
4668
|
-
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4653
|
+
import_react_native17.TouchableOpacity,
|
|
4669
4654
|
{
|
|
4670
4655
|
style: [
|
|
4671
|
-
|
|
4656
|
+
styles11.chip,
|
|
4672
4657
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4673
4658
|
isCustom && { backgroundColor: t.accent }
|
|
4674
4659
|
],
|
|
4675
4660
|
onPress: handleCustomSelect,
|
|
4676
4661
|
activeOpacity: 0.8,
|
|
4677
|
-
children: /* @__PURE__ */ (0,
|
|
4662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4678
4663
|
}
|
|
4679
4664
|
)
|
|
4680
4665
|
] }),
|
|
4681
|
-
isCustom && /* @__PURE__ */ (0,
|
|
4682
|
-
|
|
4666
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4667
|
+
import_react_native17.TextInput,
|
|
4683
4668
|
{
|
|
4684
|
-
style: [
|
|
4669
|
+
style: [styles11.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4685
4670
|
placeholder: "Enter amount in SOL",
|
|
4686
4671
|
placeholderTextColor: t.textDim,
|
|
4687
4672
|
keyboardType: "decimal-pad",
|
|
@@ -4691,43 +4676,43 @@ function CreateCustomGameSheet({
|
|
|
4691
4676
|
}
|
|
4692
4677
|
)
|
|
4693
4678
|
] }),
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4695
|
-
/* @__PURE__ */ (0,
|
|
4696
|
-
/* @__PURE__ */ (0,
|
|
4697
|
-
/* @__PURE__ */ (0,
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: finalAmount ? `${finalAmount} SOL` : "\u2014" })
|
|
4698
4683
|
] }),
|
|
4699
|
-
/* @__PURE__ */ (0,
|
|
4700
|
-
/* @__PURE__ */ (0,
|
|
4701
|
-
/* @__PURE__ */ (0,
|
|
4702
|
-
/* @__PURE__ */ (0,
|
|
4684
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4685
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max players" : "Players" }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: isPoolModeEnabled ? playerCount : playersLabel })
|
|
4703
4688
|
] }),
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
4706
|
-
/* @__PURE__ */ (0,
|
|
4707
|
-
/* @__PURE__ */ (0,
|
|
4708
|
-
/* @__PURE__ */ (0,
|
|
4709
|
-
finalAmount ? /* @__PURE__ */ (0,
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max pot" : "Winner Takes" }),
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.winnerCol, children: [
|
|
4693
|
+
/* @__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" }),
|
|
4694
|
+
finalAmount ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.feeNote, { color: t.textDim }], children: [
|
|
4710
4695
|
fee,
|
|
4711
4696
|
"% platform fee"
|
|
4712
4697
|
] }) : null
|
|
4713
4698
|
] })
|
|
4714
4699
|
] })
|
|
4715
4700
|
] }),
|
|
4716
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
4717
|
-
/* @__PURE__ */ (0,
|
|
4718
|
-
|
|
4701
|
+
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 }) }),
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4703
|
+
import_react_native17.TouchableOpacity,
|
|
4719
4704
|
{
|
|
4720
4705
|
style: [
|
|
4721
|
-
|
|
4706
|
+
styles11.ctaButton,
|
|
4722
4707
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4723
4708
|
],
|
|
4724
4709
|
disabled: !canCreate,
|
|
4725
4710
|
onPress: handleCreate,
|
|
4726
4711
|
activeOpacity: 0.8,
|
|
4727
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
4728
|
-
/* @__PURE__ */ (0,
|
|
4729
|
-
/* @__PURE__ */ (0,
|
|
4730
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
4712
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.ctaLoading, children: [
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.ctaText, children: statusLabel })
|
|
4715
|
+
] }) : 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
4716
|
}
|
|
4732
4717
|
)
|
|
4733
4718
|
] }) })
|
|
@@ -4737,9 +4722,9 @@ function CreateCustomGameSheet({
|
|
|
4737
4722
|
}
|
|
4738
4723
|
);
|
|
4739
4724
|
}
|
|
4740
|
-
var
|
|
4725
|
+
var styles11 = import_react_native17.StyleSheet.create({
|
|
4741
4726
|
overlay: {
|
|
4742
|
-
...
|
|
4727
|
+
...import_react_native17.StyleSheet.absoluteFillObject,
|
|
4743
4728
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4744
4729
|
},
|
|
4745
4730
|
overlayTap: {
|
|
@@ -4875,8 +4860,8 @@ var styles10 = import_react_native16.StyleSheet.create({
|
|
|
4875
4860
|
|
|
4876
4861
|
// src/ui/game/JoinGameSheet.tsx
|
|
4877
4862
|
var import_react27 = require("react");
|
|
4878
|
-
var
|
|
4879
|
-
var
|
|
4863
|
+
var import_react_native18 = require("react-native");
|
|
4864
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4880
4865
|
var STATUS_LABELS3 = {
|
|
4881
4866
|
building: "Building transaction...",
|
|
4882
4867
|
signing: "Approve in wallet...",
|
|
@@ -4901,9 +4886,9 @@ function JoinGameSheet({
|
|
|
4901
4886
|
const mutation = useJoinGame();
|
|
4902
4887
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
4903
4888
|
const [selectedTeam, setSelectedTeam] = (0, import_react27.useState)(null);
|
|
4904
|
-
const overlayOpacity = (0, import_react27.useRef)(new
|
|
4889
|
+
const overlayOpacity = (0, import_react27.useRef)(new import_react_native18.Animated.Value(0)).current;
|
|
4905
4890
|
(0, import_react27.useEffect)(() => {
|
|
4906
|
-
|
|
4891
|
+
import_react_native18.Animated.timing(overlayOpacity, {
|
|
4907
4892
|
toValue: visible ? 1 : 0,
|
|
4908
4893
|
duration: 250,
|
|
4909
4894
|
useNativeDriver: true
|
|
@@ -4967,30 +4952,30 @@ function JoinGameSheet({
|
|
|
4967
4952
|
}
|
|
4968
4953
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4969
4954
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4970
|
-
return /* @__PURE__ */ (0,
|
|
4971
|
-
|
|
4955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4956
|
+
import_react_native18.Modal,
|
|
4972
4957
|
{
|
|
4973
4958
|
visible,
|
|
4974
4959
|
animationType: "slide",
|
|
4975
4960
|
transparent: true,
|
|
4976
4961
|
onRequestClose: onDismiss,
|
|
4977
4962
|
children: [
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
|
|
4963
|
+
/* @__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 }) }),
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4965
|
+
import_react_native18.KeyboardAvoidingView,
|
|
4981
4966
|
{
|
|
4982
|
-
style:
|
|
4983
|
-
behavior:
|
|
4984
|
-
children: /* @__PURE__ */ (0,
|
|
4985
|
-
/* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
4987
|
-
/* @__PURE__ */ (0,
|
|
4988
|
-
/* @__PURE__ */ (0,
|
|
4967
|
+
style: styles12.keyboardView,
|
|
4968
|
+
behavior: import_react_native18.Platform.OS === "ios" ? "padding" : void 0,
|
|
4969
|
+
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: [
|
|
4970
|
+
/* @__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 }] }) }),
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.header, children: [
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
4973
|
+
/* @__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
4974
|
] }),
|
|
4990
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4991
|
-
/* @__PURE__ */ (0,
|
|
4992
|
-
/* @__PURE__ */ (0,
|
|
4993
|
-
/* @__PURE__ */ (0,
|
|
4975
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.section, children: [
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.teamsRow, children: [
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4994
4979
|
TeamButton,
|
|
4995
4980
|
{
|
|
4996
4981
|
name: homeName,
|
|
@@ -5004,7 +4989,7 @@ function JoinGameSheet({
|
|
|
5004
4989
|
t
|
|
5005
4990
|
}
|
|
5006
4991
|
),
|
|
5007
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5008
4993
|
TeamButton,
|
|
5009
4994
|
{
|
|
5010
4995
|
name: awayName,
|
|
@@ -5020,64 +5005,64 @@ function JoinGameSheet({
|
|
|
5020
5005
|
)
|
|
5021
5006
|
] })
|
|
5022
5007
|
] }),
|
|
5023
|
-
/* @__PURE__ */ (0,
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5025
|
-
/* @__PURE__ */ (0,
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
5027
5012
|
buyIn,
|
|
5028
5013
|
" SOL"
|
|
5029
5014
|
] })
|
|
5030
5015
|
] }),
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5032
|
-
isPoolModeEnabled ? /* @__PURE__ */ (0,
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5035
|
-
/* @__PURE__ */ (0,
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5017
|
+
isPoolModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: bettors.length })
|
|
5036
5021
|
] }),
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: [
|
|
5041
5026
|
totalPool,
|
|
5042
5027
|
" SOL"
|
|
5043
5028
|
] })
|
|
5044
5029
|
] })
|
|
5045
|
-
] }) : /* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5047
|
-
/* @__PURE__ */ (0,
|
|
5048
|
-
/* @__PURE__ */ (0,
|
|
5030
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: selectedName })
|
|
5049
5034
|
] }),
|
|
5050
|
-
/* @__PURE__ */ (0,
|
|
5051
|
-
/* @__PURE__ */ (0,
|
|
5052
|
-
/* @__PURE__ */ (0,
|
|
5053
|
-
/* @__PURE__ */ (0,
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5036
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
5054
5039
|
poolAfterJoin,
|
|
5055
5040
|
" SOL"
|
|
5056
5041
|
] })
|
|
5057
5042
|
] }),
|
|
5058
|
-
/* @__PURE__ */ (0,
|
|
5059
|
-
/* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5044
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5062
5047
|
] })
|
|
5063
5048
|
] })
|
|
5064
5049
|
] }),
|
|
5065
|
-
alreadyJoined && /* @__PURE__ */ (0,
|
|
5066
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5067
|
-
/* @__PURE__ */ (0,
|
|
5068
|
-
|
|
5050
|
+
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." }) }),
|
|
5051
|
+
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 }) }),
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5053
|
+
import_react_native18.TouchableOpacity,
|
|
5069
5054
|
{
|
|
5070
5055
|
style: [
|
|
5071
|
-
|
|
5056
|
+
styles12.ctaButton,
|
|
5072
5057
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5073
5058
|
],
|
|
5074
5059
|
disabled: !canJoin,
|
|
5075
5060
|
onPress: handleJoin,
|
|
5076
5061
|
activeOpacity: 0.8,
|
|
5077
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5078
|
-
/* @__PURE__ */ (0,
|
|
5079
|
-
/* @__PURE__ */ (0,
|
|
5080
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5062
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.ctaLoading, children: [
|
|
5063
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5064
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: statusLabel })
|
|
5065
|
+
] }) : 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
5066
|
}
|
|
5082
5067
|
)
|
|
5083
5068
|
] }) })
|
|
@@ -5101,32 +5086,32 @@ function TeamButton({
|
|
|
5101
5086
|
const [imgFailed, setImgFailed] = (0, import_react27.useState)(false);
|
|
5102
5087
|
const Img = ImageComponent || require("react-native").Image;
|
|
5103
5088
|
const showImage = imageUrl && !imgFailed;
|
|
5104
|
-
return /* @__PURE__ */ (0,
|
|
5105
|
-
|
|
5089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5090
|
+
import_react_native18.TouchableOpacity,
|
|
5106
5091
|
{
|
|
5107
|
-
style: [
|
|
5092
|
+
style: [styles12.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5108
5093
|
onPress,
|
|
5109
5094
|
activeOpacity: 0.7,
|
|
5110
5095
|
children: [
|
|
5111
|
-
showImage ? /* @__PURE__ */ (0,
|
|
5112
|
-
/* @__PURE__ */ (0,
|
|
5113
|
-
/* @__PURE__ */ (0,
|
|
5096
|
+
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] }),
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamOdds, { color }], children: [
|
|
5114
5099
|
odds,
|
|
5115
5100
|
"x"
|
|
5116
5101
|
] }),
|
|
5117
|
-
/* @__PURE__ */ (0,
|
|
5102
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamBets, { color: t.textMuted }], children: [
|
|
5118
5103
|
bets,
|
|
5119
5104
|
" ",
|
|
5120
5105
|
bets === 1 ? "bet" : "bets"
|
|
5121
5106
|
] }),
|
|
5122
|
-
selected && /* @__PURE__ */ (0,
|
|
5107
|
+
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
5108
|
]
|
|
5124
5109
|
}
|
|
5125
5110
|
);
|
|
5126
5111
|
}
|
|
5127
|
-
var
|
|
5112
|
+
var styles12 = import_react_native18.StyleSheet.create({
|
|
5128
5113
|
overlay: {
|
|
5129
|
-
...
|
|
5114
|
+
...import_react_native18.StyleSheet.absoluteFillObject,
|
|
5130
5115
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5131
5116
|
},
|
|
5132
5117
|
overlayTap: {
|
|
@@ -5276,8 +5261,8 @@ var styles11 = import_react_native17.StyleSheet.create({
|
|
|
5276
5261
|
|
|
5277
5262
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5278
5263
|
var import_react28 = require("react");
|
|
5279
|
-
var
|
|
5280
|
-
var
|
|
5264
|
+
var import_react_native19 = require("react-native");
|
|
5265
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5281
5266
|
var STATUS_LABELS4 = {
|
|
5282
5267
|
building: "Building transaction...",
|
|
5283
5268
|
signing: "Approve in wallet...",
|
|
@@ -5296,12 +5281,12 @@ function ClaimPrizeSheet({
|
|
|
5296
5281
|
const t = useDubsTheme();
|
|
5297
5282
|
const { wallet } = useDubs();
|
|
5298
5283
|
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
|
|
5284
|
+
const overlayOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5285
|
+
const celebrationScale = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5286
|
+
const celebrationOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5302
5287
|
const [showCelebration, setShowCelebration] = (0, import_react28.useState)(false);
|
|
5303
5288
|
(0, import_react28.useEffect)(() => {
|
|
5304
|
-
|
|
5289
|
+
import_react_native19.Animated.timing(overlayOpacity, {
|
|
5305
5290
|
toValue: visible ? 1 : 0,
|
|
5306
5291
|
duration: 250,
|
|
5307
5292
|
useNativeDriver: true
|
|
@@ -5318,14 +5303,14 @@ function ClaimPrizeSheet({
|
|
|
5318
5303
|
(0, import_react28.useEffect)(() => {
|
|
5319
5304
|
if (mutation.status === "success" && mutation.data) {
|
|
5320
5305
|
setShowCelebration(true);
|
|
5321
|
-
|
|
5322
|
-
|
|
5306
|
+
import_react_native19.Animated.parallel([
|
|
5307
|
+
import_react_native19.Animated.spring(celebrationScale, {
|
|
5323
5308
|
toValue: 1,
|
|
5324
5309
|
tension: 50,
|
|
5325
5310
|
friction: 6,
|
|
5326
5311
|
useNativeDriver: true
|
|
5327
5312
|
}),
|
|
5328
|
-
|
|
5313
|
+
import_react_native19.Animated.timing(celebrationOpacity, {
|
|
5329
5314
|
toValue: 1,
|
|
5330
5315
|
duration: 300,
|
|
5331
5316
|
useNativeDriver: true
|
|
@@ -5357,62 +5342,62 @@ function ClaimPrizeSheet({
|
|
|
5357
5342
|
}
|
|
5358
5343
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5359
5344
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5360
|
-
return /* @__PURE__ */ (0,
|
|
5361
|
-
|
|
5345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5346
|
+
import_react_native19.Modal,
|
|
5362
5347
|
{
|
|
5363
5348
|
visible,
|
|
5364
5349
|
animationType: "slide",
|
|
5365
5350
|
transparent: true,
|
|
5366
5351
|
onRequestClose: onDismiss,
|
|
5367
5352
|
children: [
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
5369
|
-
/* @__PURE__ */ (0,
|
|
5370
|
-
|
|
5353
|
+
/* @__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 }) }),
|
|
5354
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5355
|
+
import_react_native19.KeyboardAvoidingView,
|
|
5371
5356
|
{
|
|
5372
|
-
style:
|
|
5373
|
-
behavior:
|
|
5374
|
-
children: /* @__PURE__ */ (0,
|
|
5375
|
-
/* @__PURE__ */ (0,
|
|
5376
|
-
/* @__PURE__ */ (0,
|
|
5377
|
-
/* @__PURE__ */ (0,
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5357
|
+
style: styles13.keyboardView,
|
|
5358
|
+
behavior: import_react_native19.Platform.OS === "ios" ? "padding" : void 0,
|
|
5359
|
+
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: [
|
|
5360
|
+
/* @__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 }] }) }),
|
|
5361
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.header, children: [
|
|
5362
|
+
/* @__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" }),
|
|
5363
|
+
/* @__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
5364
|
] }),
|
|
5380
|
-
showCelebration && /* @__PURE__ */ (0,
|
|
5381
|
-
|
|
5365
|
+
showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5366
|
+
import_react_native19.Animated.View,
|
|
5382
5367
|
{
|
|
5383
5368
|
style: [
|
|
5384
|
-
|
|
5369
|
+
styles13.celebrationContainer,
|
|
5385
5370
|
{
|
|
5386
5371
|
opacity: celebrationOpacity,
|
|
5387
5372
|
transform: [{ scale: celebrationScale }]
|
|
5388
5373
|
}
|
|
5389
5374
|
],
|
|
5390
5375
|
children: [
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
5392
|
-
/* @__PURE__ */ (0,
|
|
5376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.celebrationText, { color: t.success }], children: [
|
|
5393
5378
|
"+",
|
|
5394
5379
|
prizeAmount,
|
|
5395
5380
|
" SOL"
|
|
5396
5381
|
] }),
|
|
5397
|
-
/* @__PURE__ */ (0,
|
|
5382
|
+
/* @__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
5383
|
]
|
|
5399
5384
|
}
|
|
5400
5385
|
),
|
|
5401
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5402
|
-
/* @__PURE__ */ (0,
|
|
5403
|
-
/* @__PURE__ */ (0,
|
|
5404
|
-
/* @__PURE__ */ (0,
|
|
5386
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.success }], children: [
|
|
5405
5390
|
prizeAmount,
|
|
5406
5391
|
" SOL"
|
|
5407
5392
|
] })
|
|
5408
5393
|
] }),
|
|
5409
|
-
/* @__PURE__ */ (0,
|
|
5410
|
-
/* @__PURE__ */ (0,
|
|
5411
|
-
/* @__PURE__ */ (0,
|
|
5412
|
-
/* @__PURE__ */ (0,
|
|
5413
|
-
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5396
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
5397
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5398
|
+
import_react_native19.Text,
|
|
5414
5399
|
{
|
|
5415
|
-
style: [
|
|
5400
|
+
style: [styles13.summaryValue, { color: t.text }],
|
|
5416
5401
|
numberOfLines: 1,
|
|
5417
5402
|
children: [
|
|
5418
5403
|
gameId.slice(0, 8),
|
|
@@ -5423,21 +5408,21 @@ function ClaimPrizeSheet({
|
|
|
5423
5408
|
)
|
|
5424
5409
|
] })
|
|
5425
5410
|
] }),
|
|
5426
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5427
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5428
|
-
|
|
5411
|
+
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 }) }),
|
|
5412
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5413
|
+
import_react_native19.TouchableOpacity,
|
|
5429
5414
|
{
|
|
5430
5415
|
style: [
|
|
5431
|
-
|
|
5416
|
+
styles13.ctaButton,
|
|
5432
5417
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5433
5418
|
],
|
|
5434
5419
|
disabled: !canClaim,
|
|
5435
5420
|
onPress: handleClaim,
|
|
5436
5421
|
activeOpacity: 0.8,
|
|
5437
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5438
|
-
/* @__PURE__ */ (0,
|
|
5439
|
-
/* @__PURE__ */ (0,
|
|
5440
|
-
] }) : /* @__PURE__ */ (0,
|
|
5422
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.ctaLoading, children: [
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.ctaText, children: statusLabel })
|
|
5425
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
5441
5426
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5442
5427
|
" \u2014 ",
|
|
5443
5428
|
prizeAmount,
|
|
@@ -5445,7 +5430,7 @@ function ClaimPrizeSheet({
|
|
|
5445
5430
|
] })
|
|
5446
5431
|
}
|
|
5447
5432
|
),
|
|
5448
|
-
mutation.data?.explorerUrl && /* @__PURE__ */ (0,
|
|
5433
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5449
5434
|
] }) })
|
|
5450
5435
|
}
|
|
5451
5436
|
)
|
|
@@ -5453,9 +5438,9 @@ function ClaimPrizeSheet({
|
|
|
5453
5438
|
}
|
|
5454
5439
|
);
|
|
5455
5440
|
}
|
|
5456
|
-
var
|
|
5441
|
+
var styles13 = import_react_native19.StyleSheet.create({
|
|
5457
5442
|
overlay: {
|
|
5458
|
-
...
|
|
5443
|
+
...import_react_native19.StyleSheet.absoluteFillObject,
|
|
5459
5444
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5460
5445
|
},
|
|
5461
5446
|
overlayTap: {
|
|
@@ -5579,8 +5564,8 @@ var styles12 = import_react_native18.StyleSheet.create({
|
|
|
5579
5564
|
|
|
5580
5565
|
// src/ui/game/ClaimButton.tsx
|
|
5581
5566
|
var import_react29 = require("react");
|
|
5582
|
-
var
|
|
5583
|
-
var
|
|
5567
|
+
var import_react_native20 = require("react-native");
|
|
5568
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5584
5569
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5585
5570
|
const t = useDubsTheme();
|
|
5586
5571
|
const { wallet } = useDubs();
|
|
@@ -5610,13 +5595,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5610
5595
|
}
|
|
5611
5596
|
const label = isRefund ? "Refund" : "Prize";
|
|
5612
5597
|
if (claimStatus.hasClaimed) {
|
|
5613
|
-
return /* @__PURE__ */ (0,
|
|
5614
|
-
|
|
5598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5599
|
+
import_react_native20.TouchableOpacity,
|
|
5615
5600
|
{
|
|
5616
|
-
style: [
|
|
5601
|
+
style: [styles14.badge, { borderColor: t.accent }, style],
|
|
5617
5602
|
activeOpacity: 1,
|
|
5618
5603
|
disabled: true,
|
|
5619
|
-
children: /* @__PURE__ */ (0,
|
|
5604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.badgeText, { color: t.accent }], children: [
|
|
5620
5605
|
label,
|
|
5621
5606
|
" Claimed!"
|
|
5622
5607
|
] })
|
|
@@ -5626,14 +5611,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5626
5611
|
if (!isEligible) {
|
|
5627
5612
|
return null;
|
|
5628
5613
|
}
|
|
5629
|
-
return /* @__PURE__ */ (0,
|
|
5630
|
-
/* @__PURE__ */ (0,
|
|
5631
|
-
|
|
5614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5616
|
+
import_react_native20.TouchableOpacity,
|
|
5632
5617
|
{
|
|
5633
|
-
style: [
|
|
5618
|
+
style: [styles14.button, { backgroundColor: t.accent }, style],
|
|
5634
5619
|
activeOpacity: 0.8,
|
|
5635
5620
|
onPress: () => setSheetVisible(true),
|
|
5636
|
-
children: /* @__PURE__ */ (0,
|
|
5621
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: styles14.buttonText, children: [
|
|
5637
5622
|
"Claim ",
|
|
5638
5623
|
label,
|
|
5639
5624
|
" \u2014 ",
|
|
@@ -5642,7 +5627,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5642
5627
|
] })
|
|
5643
5628
|
}
|
|
5644
5629
|
),
|
|
5645
|
-
/* @__PURE__ */ (0,
|
|
5630
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5646
5631
|
ClaimPrizeSheet,
|
|
5647
5632
|
{
|
|
5648
5633
|
visible: sheetVisible,
|
|
@@ -5656,7 +5641,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5656
5641
|
)
|
|
5657
5642
|
] });
|
|
5658
5643
|
}
|
|
5659
|
-
var
|
|
5644
|
+
var styles14 = import_react_native20.StyleSheet.create({
|
|
5660
5645
|
button: {
|
|
5661
5646
|
height: 52,
|
|
5662
5647
|
borderRadius: 14,
|