@dubsdotapp/expo 0.2.76 → 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 +678 -612
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +660 -587
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/AuthGate.tsx +14 -31
- package/src/ui/AvatarEditor.tsx +159 -0
- package/src/ui/UserProfileSheet.tsx +31 -104
package/dist/index.mjs
CHANGED
|
@@ -1628,18 +1628,18 @@ function ManagedWalletProvider({
|
|
|
1628
1628
|
// src/ui/AuthGate.tsx
|
|
1629
1629
|
import React2, { useState as useState15, useEffect as useEffect10, useRef as useRef4, useCallback as useCallback14 } from "react";
|
|
1630
1630
|
import {
|
|
1631
|
-
View as
|
|
1632
|
-
Text as
|
|
1631
|
+
View as View3,
|
|
1632
|
+
Text as Text3,
|
|
1633
1633
|
TextInput,
|
|
1634
|
-
TouchableOpacity as
|
|
1634
|
+
TouchableOpacity as TouchableOpacity3,
|
|
1635
1635
|
ActivityIndicator as ActivityIndicator2,
|
|
1636
|
-
StyleSheet as
|
|
1636
|
+
StyleSheet as StyleSheet3,
|
|
1637
1637
|
Keyboard,
|
|
1638
1638
|
KeyboardAvoidingView,
|
|
1639
1639
|
Platform as Platform4,
|
|
1640
|
-
Image as
|
|
1640
|
+
Image as Image3,
|
|
1641
1641
|
Animated,
|
|
1642
|
-
ScrollView
|
|
1642
|
+
ScrollView as ScrollView2
|
|
1643
1643
|
} from "react-native";
|
|
1644
1644
|
|
|
1645
1645
|
// src/hooks/useEvents.ts
|
|
@@ -2471,8 +2471,16 @@ function usePushNotifications() {
|
|
|
2471
2471
|
};
|
|
2472
2472
|
}
|
|
2473
2473
|
|
|
2474
|
-
// src/ui/
|
|
2475
|
-
import {
|
|
2474
|
+
// src/ui/AvatarEditor.tsx
|
|
2475
|
+
import {
|
|
2476
|
+
View as View2,
|
|
2477
|
+
Text as Text2,
|
|
2478
|
+
TouchableOpacity as TouchableOpacity2,
|
|
2479
|
+
Image as Image2,
|
|
2480
|
+
ScrollView,
|
|
2481
|
+
StyleSheet as StyleSheet2
|
|
2482
|
+
} from "react-native";
|
|
2483
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2476
2484
|
var DICEBEAR_STYLES = [
|
|
2477
2485
|
"adventurer",
|
|
2478
2486
|
"avataaars",
|
|
@@ -2481,12 +2489,143 @@ var DICEBEAR_STYLES = [
|
|
|
2481
2489
|
"big-smile",
|
|
2482
2490
|
"thumbs"
|
|
2483
2491
|
];
|
|
2492
|
+
var BG_COLORS = [
|
|
2493
|
+
"1a1a2e",
|
|
2494
|
+
"f43f5e",
|
|
2495
|
+
"f97316",
|
|
2496
|
+
"eab308",
|
|
2497
|
+
"22c55e",
|
|
2498
|
+
"3b82f6",
|
|
2499
|
+
"8b5cf6",
|
|
2500
|
+
"ec4899",
|
|
2501
|
+
"06b6d4",
|
|
2502
|
+
"64748b"
|
|
2503
|
+
];
|
|
2484
2504
|
function generateSeed() {
|
|
2485
2505
|
return Math.random().toString(36).slice(2, 10);
|
|
2486
2506
|
}
|
|
2487
|
-
function getAvatarUrl(style, seed, size = 256) {
|
|
2488
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&size=${size}`;
|
|
2507
|
+
function getAvatarUrl(style, seed, bg = "1a1a2e", size = 256) {
|
|
2508
|
+
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
2509
|
+
}
|
|
2510
|
+
function parseAvatarUrl(url) {
|
|
2511
|
+
if (!url) return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2512
|
+
try {
|
|
2513
|
+
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
2514
|
+
if (match) {
|
|
2515
|
+
const bgMatch = url.match(/backgroundColor=([^&]+)/);
|
|
2516
|
+
return { style: match[1], seed: match[2], bg: bgMatch?.[1] || "1a1a2e" };
|
|
2517
|
+
}
|
|
2518
|
+
} catch {
|
|
2519
|
+
}
|
|
2520
|
+
return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2521
|
+
}
|
|
2522
|
+
function AvatarEditor({
|
|
2523
|
+
style: avatarStyle,
|
|
2524
|
+
seed: avatarSeed,
|
|
2525
|
+
bg: bgColor,
|
|
2526
|
+
onStyleChange,
|
|
2527
|
+
onSeedChange,
|
|
2528
|
+
onBgChange,
|
|
2529
|
+
disabled = false,
|
|
2530
|
+
accentColor
|
|
2531
|
+
}) {
|
|
2532
|
+
const t = useDubsTheme();
|
|
2533
|
+
const accent = accentColor || t.accent;
|
|
2534
|
+
return /* @__PURE__ */ jsxs2(View2, { style: styles2.container, children: [
|
|
2535
|
+
/* @__PURE__ */ jsx3(
|
|
2536
|
+
ScrollView,
|
|
2537
|
+
{
|
|
2538
|
+
horizontal: true,
|
|
2539
|
+
showsHorizontalScrollIndicator: false,
|
|
2540
|
+
contentContainerStyle: styles2.row,
|
|
2541
|
+
children: DICEBEAR_STYLES.map((st) => {
|
|
2542
|
+
const isSelected = st === avatarStyle;
|
|
2543
|
+
return /* @__PURE__ */ jsx3(
|
|
2544
|
+
TouchableOpacity2,
|
|
2545
|
+
{
|
|
2546
|
+
onPress: () => onStyleChange(st),
|
|
2547
|
+
activeOpacity: 0.7,
|
|
2548
|
+
disabled,
|
|
2549
|
+
style: [
|
|
2550
|
+
styles2.styleTile,
|
|
2551
|
+
{
|
|
2552
|
+
borderColor: isSelected ? accent : t.border,
|
|
2553
|
+
borderWidth: isSelected ? 2 : 1
|
|
2554
|
+
}
|
|
2555
|
+
],
|
|
2556
|
+
children: /* @__PURE__ */ jsx3(
|
|
2557
|
+
Image2,
|
|
2558
|
+
{
|
|
2559
|
+
source: { uri: getAvatarUrl(st, avatarSeed, bgColor, 80) },
|
|
2560
|
+
style: styles2.styleTileImage
|
|
2561
|
+
}
|
|
2562
|
+
)
|
|
2563
|
+
},
|
|
2564
|
+
st
|
|
2565
|
+
);
|
|
2566
|
+
})
|
|
2567
|
+
}
|
|
2568
|
+
),
|
|
2569
|
+
/* @__PURE__ */ jsx3(Text2, { style: [styles2.label, { color: t.textSecondary }], children: "Background Color" }),
|
|
2570
|
+
/* @__PURE__ */ jsx3(
|
|
2571
|
+
ScrollView,
|
|
2572
|
+
{
|
|
2573
|
+
horizontal: true,
|
|
2574
|
+
showsHorizontalScrollIndicator: false,
|
|
2575
|
+
contentContainerStyle: styles2.row,
|
|
2576
|
+
children: BG_COLORS.map((color) => {
|
|
2577
|
+
const isSelected = color === bgColor;
|
|
2578
|
+
return /* @__PURE__ */ jsx3(
|
|
2579
|
+
TouchableOpacity2,
|
|
2580
|
+
{
|
|
2581
|
+
onPress: () => onBgChange(color),
|
|
2582
|
+
activeOpacity: 0.7,
|
|
2583
|
+
disabled,
|
|
2584
|
+
style: [
|
|
2585
|
+
styles2.colorSwatch,
|
|
2586
|
+
{ backgroundColor: `#${color}` },
|
|
2587
|
+
isSelected && { borderColor: accent, borderWidth: 2.5 }
|
|
2588
|
+
]
|
|
2589
|
+
},
|
|
2590
|
+
color
|
|
2591
|
+
);
|
|
2592
|
+
})
|
|
2593
|
+
}
|
|
2594
|
+
)
|
|
2595
|
+
] });
|
|
2489
2596
|
}
|
|
2597
|
+
var styles2 = StyleSheet2.create({
|
|
2598
|
+
container: {
|
|
2599
|
+
gap: 10
|
|
2600
|
+
},
|
|
2601
|
+
row: {
|
|
2602
|
+
gap: 10
|
|
2603
|
+
},
|
|
2604
|
+
label: {
|
|
2605
|
+
fontSize: 14,
|
|
2606
|
+
fontWeight: "600"
|
|
2607
|
+
},
|
|
2608
|
+
styleTile: {
|
|
2609
|
+
width: 72,
|
|
2610
|
+
height: 72,
|
|
2611
|
+
borderRadius: 16,
|
|
2612
|
+
overflow: "hidden"
|
|
2613
|
+
},
|
|
2614
|
+
styleTileImage: {
|
|
2615
|
+
width: "100%",
|
|
2616
|
+
height: "100%"
|
|
2617
|
+
},
|
|
2618
|
+
colorSwatch: {
|
|
2619
|
+
width: 32,
|
|
2620
|
+
height: 32,
|
|
2621
|
+
borderRadius: 16,
|
|
2622
|
+
borderWidth: 1.5,
|
|
2623
|
+
borderColor: "rgba(255,255,255,0.15)"
|
|
2624
|
+
}
|
|
2625
|
+
});
|
|
2626
|
+
|
|
2627
|
+
// src/ui/AuthGate.tsx
|
|
2628
|
+
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
2490
2629
|
function AuthGate({
|
|
2491
2630
|
children,
|
|
2492
2631
|
onSaveToken,
|
|
@@ -2553,12 +2692,12 @@ function AuthGate({
|
|
|
2553
2692
|
[auth]
|
|
2554
2693
|
);
|
|
2555
2694
|
if (phase === "init") {
|
|
2556
|
-
if (renderLoading) return /* @__PURE__ */
|
|
2557
|
-
return /* @__PURE__ */
|
|
2695
|
+
if (renderLoading) return /* @__PURE__ */ jsx4(Fragment2, { children: renderLoading("authenticating") });
|
|
2696
|
+
return /* @__PURE__ */ jsx4(DefaultLoadingScreen, { status: "authenticating", appName, accentColor });
|
|
2558
2697
|
}
|
|
2559
2698
|
if (auth.status === "authenticated") {
|
|
2560
2699
|
if (showPushSetup) {
|
|
2561
|
-
return /* @__PURE__ */
|
|
2700
|
+
return /* @__PURE__ */ jsx4(
|
|
2562
2701
|
PushSetupScreen,
|
|
2563
2702
|
{
|
|
2564
2703
|
accentColor,
|
|
@@ -2567,8 +2706,8 @@ function AuthGate({
|
|
|
2567
2706
|
}
|
|
2568
2707
|
);
|
|
2569
2708
|
}
|
|
2570
|
-
return /* @__PURE__ */
|
|
2571
|
-
pushEnabled && /* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ jsxs3(AuthContext.Provider, { value: auth, children: [
|
|
2710
|
+
pushEnabled && /* @__PURE__ */ jsx4(PushTokenRestorer, {}),
|
|
2572
2711
|
children
|
|
2573
2712
|
] });
|
|
2574
2713
|
}
|
|
@@ -2576,9 +2715,9 @@ function AuthGate({
|
|
|
2576
2715
|
const isRegistering = auth.status === "registering";
|
|
2577
2716
|
const regError = auth.status === "error" ? auth.error : null;
|
|
2578
2717
|
if (renderRegistration) {
|
|
2579
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ jsx4(Fragment2, { children: renderRegistration({ onRegister: handleRegister, registering: isRegistering, error: regError, client }) });
|
|
2580
2719
|
}
|
|
2581
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx4(
|
|
2582
2721
|
DefaultRegistrationScreen,
|
|
2583
2722
|
{
|
|
2584
2723
|
onRegister: handleRegister,
|
|
@@ -2591,11 +2730,11 @@ function AuthGate({
|
|
|
2591
2730
|
);
|
|
2592
2731
|
}
|
|
2593
2732
|
if (auth.status === "error" && auth.error) {
|
|
2594
|
-
if (renderError) return /* @__PURE__ */
|
|
2595
|
-
return /* @__PURE__ */
|
|
2733
|
+
if (renderError) return /* @__PURE__ */ jsx4(Fragment2, { children: renderError(auth.error, retry) });
|
|
2734
|
+
return /* @__PURE__ */ jsx4(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
|
|
2596
2735
|
}
|
|
2597
|
-
if (renderLoading) return /* @__PURE__ */
|
|
2598
|
-
return /* @__PURE__ */
|
|
2736
|
+
if (renderLoading) return /* @__PURE__ */ jsx4(Fragment2, { children: renderLoading(auth.status) });
|
|
2737
|
+
return /* @__PURE__ */ jsx4(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
2599
2738
|
}
|
|
2600
2739
|
function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
2601
2740
|
const t = useDubsTheme();
|
|
@@ -2610,44 +2749,44 @@ function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
|
2610
2749
|
authenticated: "Ready!",
|
|
2611
2750
|
error: "Something went wrong"
|
|
2612
2751
|
};
|
|
2613
|
-
return /* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ jsx4(View3, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ jsxs3(View3, { style: s.centerContent, children: [
|
|
2753
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.brandingSection, children: [
|
|
2754
|
+
/* @__PURE__ */ jsx4(View3, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ jsx4(Text3, { style: s.logoText, children: "D" }) }),
|
|
2755
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2617
2756
|
] }),
|
|
2618
|
-
/* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.loadingSection, children: [
|
|
2758
|
+
/* @__PURE__ */ jsx4(ActivityIndicator2, { size: "large", color: accent }),
|
|
2759
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.statusText, { color: t.textMuted }], children: statusText[status] || "Loading..." })
|
|
2621
2760
|
] })
|
|
2622
2761
|
] }) });
|
|
2623
2762
|
}
|
|
2624
2763
|
function DefaultErrorScreen({ error, onRetry, appName, accentColor }) {
|
|
2625
2764
|
const t = useDubsTheme();
|
|
2626
2765
|
const accent = accentColor || t.accent;
|
|
2627
|
-
return /* @__PURE__ */
|
|
2628
|
-
/* @__PURE__ */
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2766
|
+
return /* @__PURE__ */ jsx4(View3, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ jsxs3(View3, { style: s.spreadContent, children: [
|
|
2767
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.brandingSection, children: [
|
|
2768
|
+
/* @__PURE__ */ jsx4(View3, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ jsx4(Text3, { style: s.logoText, children: "D" }) }),
|
|
2769
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2631
2770
|
] }),
|
|
2632
|
-
/* @__PURE__ */
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsxs3(View3, { style: { gap: 16 }, children: [
|
|
2772
|
+
/* @__PURE__ */ jsx4(View3, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx4(Text3, { style: [s.errorText, { color: t.errorText }], children: error.message }) }),
|
|
2773
|
+
/* @__PURE__ */ jsx4(TouchableOpacity3, { style: [s.primaryBtn, { backgroundColor: accent }], onPress: onRetry, activeOpacity: 0.8, children: /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Try Again" }) })
|
|
2635
2774
|
] })
|
|
2636
2775
|
] }) });
|
|
2637
2776
|
}
|
|
2638
2777
|
function StepIndicator({ currentStep }) {
|
|
2639
2778
|
const t = useDubsTheme();
|
|
2640
2779
|
const steps = [0, 1, 2, 3];
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
i > 0 && /* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2644
|
-
|
|
2780
|
+
return /* @__PURE__ */ jsx4(View3, { style: s.stepRow, children: steps.map((i) => /* @__PURE__ */ jsxs3(React2.Fragment, { children: [
|
|
2781
|
+
i > 0 && /* @__PURE__ */ jsx4(View3, { style: [s.stepLine, { backgroundColor: i <= currentStep ? t.success : t.border }] }),
|
|
2782
|
+
/* @__PURE__ */ jsx4(
|
|
2783
|
+
View3,
|
|
2645
2784
|
{
|
|
2646
2785
|
style: [
|
|
2647
2786
|
s.stepCircle,
|
|
2648
2787
|
i < currentStep ? { backgroundColor: t.success } : i === currentStep ? { backgroundColor: t.accent } : { backgroundColor: "transparent", borderWidth: 2, borderColor: t.border }
|
|
2649
2788
|
],
|
|
2650
|
-
children: i < currentStep ? /* @__PURE__ */
|
|
2789
|
+
children: i < currentStep ? /* @__PURE__ */ jsx4(Text3, { style: s.stepCheck, children: "\u2713" }) : /* @__PURE__ */ jsx4(Text3, { style: [s.stepNum, { color: i === currentStep ? "#FFF" : t.textMuted }], children: i + 1 })
|
|
2651
2790
|
}
|
|
2652
2791
|
)
|
|
2653
2792
|
] }, i)) });
|
|
@@ -2665,6 +2804,7 @@ function DefaultRegistrationScreen({
|
|
|
2665
2804
|
const [step, setStep] = useState15(0);
|
|
2666
2805
|
const [avatarSeed, setAvatarSeed] = useState15(generateSeed);
|
|
2667
2806
|
const [avatarStyle, setAvatarStyle] = useState15("adventurer");
|
|
2807
|
+
const [avatarBg, setAvatarBg] = useState15("1a1a2e");
|
|
2668
2808
|
const [showStyles, setShowStyles] = useState15(false);
|
|
2669
2809
|
const [username, setUsername] = useState15("");
|
|
2670
2810
|
const [referralCode, setReferralCode] = useState15("");
|
|
@@ -2673,7 +2813,7 @@ function DefaultRegistrationScreen({
|
|
|
2673
2813
|
const debounceRef = useRef4(null);
|
|
2674
2814
|
const fadeAnim = useRef4(new Animated.Value(1)).current;
|
|
2675
2815
|
const slideAnim = useRef4(new Animated.Value(0)).current;
|
|
2676
|
-
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed);
|
|
2816
|
+
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed, avatarBg);
|
|
2677
2817
|
useEffect10(() => {
|
|
2678
2818
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
2679
2819
|
const trimmed = username.trim();
|
|
@@ -2717,73 +2857,76 @@ function DefaultRegistrationScreen({
|
|
|
2717
2857
|
Keyboard.dismiss();
|
|
2718
2858
|
onRegister(username.trim(), referralCode.trim() || void 0, avatarUrl);
|
|
2719
2859
|
};
|
|
2720
|
-
const renderAvatarStep = () => /* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
/* @__PURE__ */
|
|
2860
|
+
const renderAvatarStep = () => /* @__PURE__ */ jsxs3(View3, { style: s.stepContainer, children: [
|
|
2861
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.stepTop, children: [
|
|
2862
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.title, { color: t.text }], children: "Choose Your Avatar" }),
|
|
2863
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.subtitle, { color: t.textMuted }], children: "Pick a look that represents you" }),
|
|
2864
|
+
/* @__PURE__ */ jsx4(StepIndicator, { currentStep: 0 }),
|
|
2865
|
+
/* @__PURE__ */ jsx4(View3, { style: s.avatarCenter, children: /* @__PURE__ */ jsxs3(View3, { style: [s.avatarFrame, { borderColor: accent }], children: [
|
|
2866
|
+
/* @__PURE__ */ jsx4(Image3, { source: { uri: avatarUrl }, style: s.avatarLarge }),
|
|
2867
|
+
/* @__PURE__ */ jsx4(View3, { style: [s.checkBadge, { backgroundColor: t.success }], children: /* @__PURE__ */ jsx4(Text3, { style: s.checkBadgeText, children: "\u2713" }) })
|
|
2728
2868
|
] }) }),
|
|
2729
|
-
/* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
|
|
2869
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.avatarActions, children: [
|
|
2870
|
+
/* @__PURE__ */ jsx4(
|
|
2871
|
+
TouchableOpacity3,
|
|
2732
2872
|
{
|
|
2733
2873
|
style: [s.outlineBtn, { borderColor: t.border }],
|
|
2734
2874
|
onPress: () => setAvatarSeed(generateSeed()),
|
|
2735
2875
|
activeOpacity: 0.7,
|
|
2736
|
-
children: /* @__PURE__ */
|
|
2876
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.outlineBtnText, { color: t.text }], children: "\u21BB Shuffle" })
|
|
2737
2877
|
}
|
|
2738
2878
|
),
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
|
|
2879
|
+
/* @__PURE__ */ jsx4(
|
|
2880
|
+
TouchableOpacity3,
|
|
2741
2881
|
{
|
|
2742
2882
|
style: [s.outlineBtn, { borderColor: accent, backgroundColor: accent + "15" }],
|
|
2743
2883
|
onPress: () => setShowStyles(!showStyles),
|
|
2744
2884
|
activeOpacity: 0.7,
|
|
2745
|
-
children: /* @__PURE__ */
|
|
2885
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.outlineBtnText, { color: accent }], children: "\u263A Customize" })
|
|
2746
2886
|
}
|
|
2747
2887
|
)
|
|
2748
2888
|
] }),
|
|
2749
|
-
showStyles && /* @__PURE__ */
|
|
2750
|
-
|
|
2889
|
+
showStyles && /* @__PURE__ */ jsx4(View3, { style: s.styleScroll, children: /* @__PURE__ */ jsx4(
|
|
2890
|
+
AvatarEditor,
|
|
2751
2891
|
{
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2892
|
+
style: avatarStyle,
|
|
2893
|
+
seed: avatarSeed,
|
|
2894
|
+
bg: avatarBg,
|
|
2895
|
+
onStyleChange: setAvatarStyle,
|
|
2896
|
+
onSeedChange: setAvatarSeed,
|
|
2897
|
+
onBgChange: setAvatarBg,
|
|
2898
|
+
accentColor: accent
|
|
2899
|
+
}
|
|
2900
|
+
) })
|
|
2758
2901
|
] }),
|
|
2759
|
-
/* @__PURE__ */
|
|
2760
|
-
|
|
2902
|
+
/* @__PURE__ */ jsx4(View3, { style: s.bottomRow, children: /* @__PURE__ */ jsx4(
|
|
2903
|
+
TouchableOpacity3,
|
|
2761
2904
|
{
|
|
2762
2905
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1 }],
|
|
2763
2906
|
onPress: () => animateToStep(1),
|
|
2764
2907
|
activeOpacity: 0.8,
|
|
2765
|
-
children: /* @__PURE__ */
|
|
2908
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2766
2909
|
}
|
|
2767
2910
|
) })
|
|
2768
2911
|
] });
|
|
2769
|
-
const renderUsernameStep = () => /* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2912
|
+
const renderUsernameStep = () => /* @__PURE__ */ jsxs3(View3, { style: s.stepContainer, children: [
|
|
2913
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.stepTop, children: [
|
|
2914
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.headerRow, children: [
|
|
2915
|
+
/* @__PURE__ */ jsx4(TouchableOpacity3, { onPress: () => animateToStep(0), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ jsx4(Text3, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
2916
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.titleInline, { color: t.text }], children: "Pick a Username" })
|
|
2774
2917
|
] }),
|
|
2775
|
-
/* @__PURE__ */
|
|
2776
|
-
/* @__PURE__ */
|
|
2777
|
-
/* @__PURE__ */
|
|
2778
|
-
/* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.subtitle, { color: t.textMuted }], children: "This is how others will see you" }),
|
|
2919
|
+
/* @__PURE__ */ jsx4(StepIndicator, { currentStep: 1 }),
|
|
2920
|
+
/* @__PURE__ */ jsx4(View3, { style: s.avatarCenter, children: /* @__PURE__ */ jsxs3(View3, { style: [s.avatarFrameSmall, { borderColor: accent }], children: [
|
|
2921
|
+
/* @__PURE__ */ jsx4(Image3, { source: { uri: avatarUrl }, style: s.avatarSmall }),
|
|
2922
|
+
/* @__PURE__ */ jsx4(View3, { style: [s.checkBadgeSm, { backgroundColor: t.success }], children: /* @__PURE__ */ jsx4(Text3, { style: s.checkBadgeTextSm, children: "\u2713" }) })
|
|
2780
2923
|
] }) }),
|
|
2781
|
-
/* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.inputGroup, children: [
|
|
2925
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2783
2926
|
"Username ",
|
|
2784
|
-
/* @__PURE__ */
|
|
2927
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: t.errorText }, children: "*" })
|
|
2785
2928
|
] }),
|
|
2786
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsx4(
|
|
2787
2930
|
TextInput,
|
|
2788
2931
|
{
|
|
2789
2932
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: accent }],
|
|
@@ -2796,62 +2939,62 @@ function DefaultRegistrationScreen({
|
|
|
2796
2939
|
autoFocus: true
|
|
2797
2940
|
}
|
|
2798
2941
|
),
|
|
2799
|
-
checking ? /* @__PURE__ */
|
|
2942
|
+
checking ? /* @__PURE__ */ jsx4(Text3, { style: [s.hint, { color: t.textDim }], children: "Checking..." }) : availability ? /* @__PURE__ */ jsx4(Text3, { 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__ */ jsx4(Text3, { style: [s.hint, { color: t.textDim }], children: "At least 3 characters" }) : null
|
|
2800
2943
|
] })
|
|
2801
2944
|
] }),
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
|
|
2945
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
2946
|
+
/* @__PURE__ */ jsx4(
|
|
2947
|
+
TouchableOpacity3,
|
|
2805
2948
|
{
|
|
2806
2949
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2807
2950
|
onPress: () => animateToStep(0),
|
|
2808
2951
|
activeOpacity: 0.7,
|
|
2809
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2810
2953
|
}
|
|
2811
2954
|
),
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
|
|
2955
|
+
/* @__PURE__ */ jsx4(
|
|
2956
|
+
TouchableOpacity3,
|
|
2814
2957
|
{
|
|
2815
2958
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: canContinueUsername ? 1 : 0.4 }],
|
|
2816
2959
|
onPress: () => animateToStep(2),
|
|
2817
2960
|
disabled: !canContinueUsername,
|
|
2818
2961
|
activeOpacity: 0.8,
|
|
2819
|
-
children: /* @__PURE__ */
|
|
2962
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2820
2963
|
}
|
|
2821
2964
|
)
|
|
2822
2965
|
] })
|
|
2823
2966
|
] });
|
|
2824
|
-
const renderReferralStep = () => /* @__PURE__ */
|
|
2825
|
-
/* @__PURE__ */
|
|
2826
|
-
/* @__PURE__ */
|
|
2827
|
-
/* @__PURE__ */
|
|
2828
|
-
/* @__PURE__ */
|
|
2967
|
+
const renderReferralStep = () => /* @__PURE__ */ jsxs3(View3, { style: s.stepContainer, children: [
|
|
2968
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.stepTop, children: [
|
|
2969
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.headerRow, children: [
|
|
2970
|
+
/* @__PURE__ */ jsx4(TouchableOpacity3, { onPress: () => animateToStep(1), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ jsx4(Text3, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
2971
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.titleInline, { color: t.text }], children: "Almost There!" })
|
|
2829
2972
|
] }),
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
/* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.subtitle, { color: t.textMuted }], children: "Got a referral code? (optional)" }),
|
|
2974
|
+
/* @__PURE__ */ jsx4(StepIndicator, { currentStep: 2 }),
|
|
2975
|
+
/* @__PURE__ */ jsxs3(View3, { style: [s.profileCard, { borderColor: t.border }], children: [
|
|
2976
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.profileLabel, { color: t.textMuted }], children: "Your Profile" }),
|
|
2977
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.profileRow, children: [
|
|
2978
|
+
/* @__PURE__ */ jsx4(Image3, { source: { uri: avatarUrl }, style: s.profileAvatar }),
|
|
2979
|
+
/* @__PURE__ */ jsxs3(View3, { style: { gap: 4 }, children: [
|
|
2980
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.profileUsername, { color: t.text }], children: [
|
|
2838
2981
|
"@",
|
|
2839
2982
|
username
|
|
2840
2983
|
] }),
|
|
2841
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.profileReady, { color: t.success }], children: [
|
|
2842
2985
|
"\u2713",
|
|
2843
2986
|
" Ready to go!"
|
|
2844
2987
|
] })
|
|
2845
2988
|
] })
|
|
2846
2989
|
] })
|
|
2847
2990
|
] }),
|
|
2848
|
-
error ? /* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2850
|
-
/* @__PURE__ */
|
|
2991
|
+
error ? /* @__PURE__ */ jsx4(View3, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx4(Text3, { style: [s.errorText, { color: t.errorText }], children: error.message }) }) : null,
|
|
2992
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.inputGroup, children: [
|
|
2993
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2851
2994
|
"Referral Code ",
|
|
2852
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: t.textMuted }, children: "(optional)" })
|
|
2853
2996
|
] }),
|
|
2854
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsx4(
|
|
2855
2998
|
TextInput,
|
|
2856
2999
|
{
|
|
2857
3000
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: t.border }],
|
|
@@ -2864,31 +3007,31 @@ function DefaultRegistrationScreen({
|
|
|
2864
3007
|
editable: !registering
|
|
2865
3008
|
}
|
|
2866
3009
|
),
|
|
2867
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.hint, { color: t.textMuted }], children: [
|
|
2868
3011
|
"\u{1F381}",
|
|
2869
3012
|
" If a friend invited you, enter their code to give them credit!"
|
|
2870
3013
|
] })
|
|
2871
3014
|
] })
|
|
2872
3015
|
] }),
|
|
2873
|
-
/* @__PURE__ */
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
|
|
3016
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
3017
|
+
/* @__PURE__ */ jsx4(
|
|
3018
|
+
TouchableOpacity3,
|
|
2876
3019
|
{
|
|
2877
3020
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2878
3021
|
onPress: () => animateToStep(1),
|
|
2879
3022
|
disabled: registering,
|
|
2880
3023
|
activeOpacity: 0.7,
|
|
2881
|
-
children: /* @__PURE__ */
|
|
3024
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2882
3025
|
}
|
|
2883
3026
|
),
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
|
|
3027
|
+
/* @__PURE__ */ jsx4(
|
|
3028
|
+
TouchableOpacity3,
|
|
2886
3029
|
{
|
|
2887
3030
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: registering ? 0.7 : 1 }],
|
|
2888
3031
|
onPress: handleSubmit,
|
|
2889
3032
|
disabled: registering,
|
|
2890
3033
|
activeOpacity: 0.8,
|
|
2891
|
-
children: registering ? /* @__PURE__ */
|
|
3034
|
+
children: registering ? /* @__PURE__ */ jsx4(ActivityIndicator2, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Create Account" })
|
|
2892
3035
|
}
|
|
2893
3036
|
)
|
|
2894
3037
|
] })
|
|
@@ -2905,18 +3048,18 @@ function DefaultRegistrationScreen({
|
|
|
2905
3048
|
return null;
|
|
2906
3049
|
}
|
|
2907
3050
|
};
|
|
2908
|
-
return /* @__PURE__ */
|
|
3051
|
+
return /* @__PURE__ */ jsx4(
|
|
2909
3052
|
KeyboardAvoidingView,
|
|
2910
3053
|
{
|
|
2911
3054
|
style: [s.container, { backgroundColor: t.background }],
|
|
2912
3055
|
behavior: Platform4.OS === "ios" ? "padding" : void 0,
|
|
2913
|
-
children: /* @__PURE__ */
|
|
2914
|
-
|
|
3056
|
+
children: /* @__PURE__ */ jsx4(
|
|
3057
|
+
ScrollView2,
|
|
2915
3058
|
{
|
|
2916
3059
|
contentContainerStyle: { flexGrow: 1 },
|
|
2917
3060
|
keyboardShouldPersistTaps: "handled",
|
|
2918
3061
|
bounces: false,
|
|
2919
|
-
children: /* @__PURE__ */
|
|
3062
|
+
children: /* @__PURE__ */ jsx4(
|
|
2920
3063
|
Animated.View,
|
|
2921
3064
|
{
|
|
2922
3065
|
style: [
|
|
@@ -2966,7 +3109,7 @@ function PushSetupScreen({
|
|
|
2966
3109
|
"Your pick wins or loses",
|
|
2967
3110
|
"Final results and rankings"
|
|
2968
3111
|
];
|
|
2969
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx4(View3, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ jsxs3(
|
|
2970
3113
|
Animated.View,
|
|
2971
3114
|
{
|
|
2972
3115
|
style: [
|
|
@@ -2974,37 +3117,37 @@ function PushSetupScreen({
|
|
|
2974
3117
|
{ opacity: fadeAnim, transform: [{ translateY: slideAnim }] }
|
|
2975
3118
|
],
|
|
2976
3119
|
children: [
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
/* @__PURE__ */
|
|
2980
|
-
/* @__PURE__ */
|
|
2981
|
-
/* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2984
|
-
benefits.map((item, i) => /* @__PURE__ */
|
|
2985
|
-
/* @__PURE__ */
|
|
2986
|
-
/* @__PURE__ */
|
|
3120
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.stepTop, children: [
|
|
3121
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.title, { color: t.text }], children: "Enable Notifications" }),
|
|
3122
|
+
/* @__PURE__ */ jsx4(Text3, { style: [s.subtitle, { color: t.textMuted }], children: "Stay in the loop with real-time updates" }),
|
|
3123
|
+
/* @__PURE__ */ jsx4(StepIndicator, { currentStep: 3 }),
|
|
3124
|
+
/* @__PURE__ */ jsx4(View3, { style: pushStyles.iconContainer, children: /* @__PURE__ */ jsx4(View3, { style: [pushStyles.bellCircle, { backgroundColor: accent + "20" }], children: /* @__PURE__ */ jsx4(Text3, { style: [pushStyles.bellIcon, { color: accent }], children: "\u{1F514}" }) }) }),
|
|
3125
|
+
/* @__PURE__ */ jsxs3(View3, { style: pushStyles.benefitsList, children: [
|
|
3126
|
+
/* @__PURE__ */ jsx4(Text3, { style: [pushStyles.benefitsHeader, { color: t.text }], children: "Get real-time updates when:" }),
|
|
3127
|
+
benefits.map((item, i) => /* @__PURE__ */ jsxs3(View3, { style: pushStyles.benefitRow, children: [
|
|
3128
|
+
/* @__PURE__ */ jsx4(View3, { style: [pushStyles.bulletDot, { backgroundColor: accent }] }),
|
|
3129
|
+
/* @__PURE__ */ jsx4(Text3, { style: [pushStyles.benefitText, { color: t.textMuted }], children: item })
|
|
2987
3130
|
] }, i))
|
|
2988
3131
|
] })
|
|
2989
3132
|
] }),
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
/* @__PURE__ */
|
|
2992
|
-
|
|
3133
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
3134
|
+
/* @__PURE__ */ jsx4(
|
|
3135
|
+
TouchableOpacity3,
|
|
2993
3136
|
{
|
|
2994
3137
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2995
3138
|
onPress: onComplete,
|
|
2996
3139
|
activeOpacity: 0.7,
|
|
2997
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.textMuted }], children: "Maybe Later" })
|
|
2998
3141
|
}
|
|
2999
3142
|
),
|
|
3000
|
-
/* @__PURE__ */
|
|
3001
|
-
|
|
3143
|
+
/* @__PURE__ */ jsx4(
|
|
3144
|
+
TouchableOpacity3,
|
|
3002
3145
|
{
|
|
3003
3146
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: push.loading ? 0.7 : 1 }],
|
|
3004
3147
|
onPress: handleEnable,
|
|
3005
3148
|
disabled: push.loading,
|
|
3006
3149
|
activeOpacity: 0.8,
|
|
3007
|
-
children: push.loading ? /* @__PURE__ */
|
|
3150
|
+
children: push.loading ? /* @__PURE__ */ jsx4(ActivityIndicator2, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Enable Notifications" })
|
|
3008
3151
|
}
|
|
3009
3152
|
)
|
|
3010
3153
|
] })
|
|
@@ -3012,7 +3155,7 @@ function PushSetupScreen({
|
|
|
3012
3155
|
}
|
|
3013
3156
|
) });
|
|
3014
3157
|
}
|
|
3015
|
-
var pushStyles =
|
|
3158
|
+
var pushStyles = StyleSheet3.create({
|
|
3016
3159
|
iconContainer: { alignItems: "center", marginVertical: 24 },
|
|
3017
3160
|
bellCircle: { width: 100, height: 100, borderRadius: 50, justifyContent: "center", alignItems: "center" },
|
|
3018
3161
|
bellIcon: { fontSize: 48 },
|
|
@@ -3022,7 +3165,7 @@ var pushStyles = StyleSheet2.create({
|
|
|
3022
3165
|
bulletDot: { width: 8, height: 8, borderRadius: 4 },
|
|
3023
3166
|
benefitText: { fontSize: 16, flex: 1 }
|
|
3024
3167
|
});
|
|
3025
|
-
var s =
|
|
3168
|
+
var s = StyleSheet3.create({
|
|
3026
3169
|
container: { flex: 1 },
|
|
3027
3170
|
// Loading / Error
|
|
3028
3171
|
centerContent: { flex: 1, justifyContent: "center", alignItems: "center", paddingHorizontal: 32, gap: 48 },
|
|
@@ -3086,7 +3229,7 @@ var s = StyleSheet2.create({
|
|
|
3086
3229
|
});
|
|
3087
3230
|
|
|
3088
3231
|
// src/provider.tsx
|
|
3089
|
-
import { jsx as
|
|
3232
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3090
3233
|
var DubsContext = createContext4(null);
|
|
3091
3234
|
function DubsProvider({
|
|
3092
3235
|
apiKey,
|
|
@@ -3136,7 +3279,7 @@ function DubsProvider({
|
|
|
3136
3279
|
themeOverrides.accent = uiConfig.accentColor;
|
|
3137
3280
|
}
|
|
3138
3281
|
if (externalWallet) {
|
|
3139
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx5(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ jsx5(
|
|
3140
3283
|
ExternalWalletProvider,
|
|
3141
3284
|
{
|
|
3142
3285
|
client,
|
|
@@ -3156,7 +3299,7 @@ function DubsProvider({
|
|
|
3156
3299
|
}
|
|
3157
3300
|
) });
|
|
3158
3301
|
}
|
|
3159
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx5(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ jsx5(
|
|
3160
3303
|
ManagedWalletProvider,
|
|
3161
3304
|
{
|
|
3162
3305
|
appName: uiConfig.appName || appName,
|
|
@@ -3168,7 +3311,7 @@ function DubsProvider({
|
|
|
3168
3311
|
tagline: uiConfig.tagline,
|
|
3169
3312
|
redirectUri,
|
|
3170
3313
|
appUrl: appUrl || uiConfig.appUrl,
|
|
3171
|
-
children: (adapter) => /* @__PURE__ */
|
|
3314
|
+
children: (adapter) => /* @__PURE__ */ jsx5(
|
|
3172
3315
|
ManagedInner,
|
|
3173
3316
|
{
|
|
3174
3317
|
client,
|
|
@@ -3213,7 +3356,7 @@ function ManagedInner({
|
|
|
3213
3356
|
() => ({ client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled }),
|
|
3214
3357
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3215
3358
|
);
|
|
3216
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children: /* @__PURE__ */ jsx5(
|
|
3217
3360
|
AuthGate,
|
|
3218
3361
|
{
|
|
3219
3362
|
onSaveToken: (token) => {
|
|
@@ -3257,9 +3400,9 @@ function ExternalWalletProvider({
|
|
|
3257
3400
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3258
3401
|
);
|
|
3259
3402
|
if (!managed) {
|
|
3260
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children });
|
|
3261
3404
|
}
|
|
3262
|
-
return /* @__PURE__ */
|
|
3405
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children: /* @__PURE__ */ jsx5(
|
|
3263
3406
|
AuthGate,
|
|
3264
3407
|
{
|
|
3265
3408
|
onSaveToken: (token) => {
|
|
@@ -3290,8 +3433,8 @@ function useAppConfig() {
|
|
|
3290
3433
|
|
|
3291
3434
|
// src/ui/UserProfileCard.tsx
|
|
3292
3435
|
import { useMemo as useMemo3 } from "react";
|
|
3293
|
-
import { View as
|
|
3294
|
-
import { jsx as
|
|
3436
|
+
import { View as View4, Text as Text4, Image as Image4, StyleSheet as StyleSheet4 } from "react-native";
|
|
3437
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3295
3438
|
function truncateAddress(address, chars = 4) {
|
|
3296
3439
|
if (address.length <= chars * 2 + 3) return address;
|
|
3297
3440
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3313,16 +3456,16 @@ function UserProfileCard({
|
|
|
3313
3456
|
() => ensurePngAvatar(avatarUrl) || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3314
3457
|
[avatarUrl, walletAddress]
|
|
3315
3458
|
);
|
|
3316
|
-
return /* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
username ? /* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
memberSince ? /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ jsxs4(View4, { style: [styles3.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3460
|
+
/* @__PURE__ */ jsx6(Image4, { source: { uri: imageUri }, style: styles3.avatar }),
|
|
3461
|
+
/* @__PURE__ */ jsxs4(View4, { style: styles3.info, children: [
|
|
3462
|
+
username ? /* @__PURE__ */ jsx6(Text4, { style: [styles3.username, { color: t.text }], children: username }) : null,
|
|
3463
|
+
/* @__PURE__ */ jsx6(Text4, { style: [styles3.address, { color: t.textMuted }], children: truncateAddress(walletAddress) }),
|
|
3464
|
+
memberSince ? /* @__PURE__ */ jsx6(Text4, { style: [styles3.memberSince, { color: t.textDim }], children: formatMemberSince(memberSince) }) : null
|
|
3322
3465
|
] })
|
|
3323
3466
|
] });
|
|
3324
3467
|
}
|
|
3325
|
-
var
|
|
3468
|
+
var styles3 = StyleSheet4.create({
|
|
3326
3469
|
card: {
|
|
3327
3470
|
flexDirection: "row",
|
|
3328
3471
|
alignItems: "center",
|
|
@@ -3357,14 +3500,14 @@ var styles2 = StyleSheet3.create({
|
|
|
3357
3500
|
|
|
3358
3501
|
// src/ui/SettingsSheet.tsx
|
|
3359
3502
|
import {
|
|
3360
|
-
View as
|
|
3361
|
-
Text as
|
|
3362
|
-
ScrollView as
|
|
3363
|
-
TouchableOpacity as
|
|
3503
|
+
View as View5,
|
|
3504
|
+
Text as Text5,
|
|
3505
|
+
ScrollView as ScrollView3,
|
|
3506
|
+
TouchableOpacity as TouchableOpacity4,
|
|
3364
3507
|
ActivityIndicator as ActivityIndicator3,
|
|
3365
|
-
StyleSheet as
|
|
3508
|
+
StyleSheet as StyleSheet5
|
|
3366
3509
|
} from "react-native";
|
|
3367
|
-
import { Fragment as Fragment3, jsx as
|
|
3510
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3368
3511
|
function truncateAddress2(address, chars = 4) {
|
|
3369
3512
|
if (address.length <= chars * 2 + 3) return address;
|
|
3370
3513
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3381,13 +3524,13 @@ function SettingsSheet({
|
|
|
3381
3524
|
loggingOut = false
|
|
3382
3525
|
}) {
|
|
3383
3526
|
const t = useDubsTheme();
|
|
3384
|
-
return /* @__PURE__ */
|
|
3385
|
-
|
|
3527
|
+
return /* @__PURE__ */ jsxs5(
|
|
3528
|
+
ScrollView3,
|
|
3386
3529
|
{
|
|
3387
|
-
style: [
|
|
3388
|
-
contentContainerStyle:
|
|
3530
|
+
style: [styles4.container, { backgroundColor: t.background }],
|
|
3531
|
+
contentContainerStyle: styles4.content,
|
|
3389
3532
|
children: [
|
|
3390
|
-
/* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ jsx7(
|
|
3391
3534
|
UserProfileCard,
|
|
3392
3535
|
{
|
|
3393
3536
|
walletAddress,
|
|
@@ -3396,49 +3539,49 @@ function SettingsSheet({
|
|
|
3396
3539
|
memberSince
|
|
3397
3540
|
}
|
|
3398
3541
|
),
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
onCopyAddress ? /* @__PURE__ */
|
|
3401
|
-
|
|
3542
|
+
/* @__PURE__ */ jsxs5(View5, { style: [styles4.actionsCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3543
|
+
onCopyAddress ? /* @__PURE__ */ jsxs5(
|
|
3544
|
+
TouchableOpacity4,
|
|
3402
3545
|
{
|
|
3403
|
-
style:
|
|
3546
|
+
style: styles4.actionRow,
|
|
3404
3547
|
onPress: onCopyAddress,
|
|
3405
3548
|
activeOpacity: 0.7,
|
|
3406
3549
|
children: [
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3550
|
+
/* @__PURE__ */ jsxs5(View5, { style: styles4.actionRowLeft, children: [
|
|
3551
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.actionLabel, { color: t.text }], children: "Wallet Address" }),
|
|
3552
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.actionValue, { color: t.textMuted }], children: truncateAddress2(walletAddress) })
|
|
3410
3553
|
] }),
|
|
3411
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.copyLabel, { color: t.accent }], children: "Copy" })
|
|
3412
3555
|
]
|
|
3413
3556
|
}
|
|
3414
3557
|
) : null,
|
|
3415
|
-
onSupport ? /* @__PURE__ */
|
|
3416
|
-
onCopyAddress ? /* @__PURE__ */
|
|
3417
|
-
/* @__PURE__ */
|
|
3418
|
-
|
|
3558
|
+
onSupport ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3559
|
+
onCopyAddress ? /* @__PURE__ */ jsx7(View5, { style: [styles4.separator, { backgroundColor: t.border }] }) : null,
|
|
3560
|
+
/* @__PURE__ */ jsxs5(
|
|
3561
|
+
TouchableOpacity4,
|
|
3419
3562
|
{
|
|
3420
|
-
style:
|
|
3563
|
+
style: styles4.actionRow,
|
|
3421
3564
|
onPress: onSupport,
|
|
3422
3565
|
activeOpacity: 0.7,
|
|
3423
3566
|
children: [
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
/* @__PURE__ */
|
|
3567
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.actionLabel, { color: t.text }], children: "Help & Support" }),
|
|
3568
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.chevron, { color: t.textMuted }], children: "\u203A" })
|
|
3426
3569
|
]
|
|
3427
3570
|
}
|
|
3428
3571
|
)
|
|
3429
3572
|
] }) : null
|
|
3430
3573
|
] }),
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
|
|
3574
|
+
/* @__PURE__ */ jsx7(
|
|
3575
|
+
TouchableOpacity4,
|
|
3433
3576
|
{
|
|
3434
|
-
style: [
|
|
3577
|
+
style: [styles4.logoutButton, { borderColor: t.live }],
|
|
3435
3578
|
onPress: onLogout,
|
|
3436
3579
|
disabled: loggingOut,
|
|
3437
3580
|
activeOpacity: 0.7,
|
|
3438
|
-
children: loggingOut ? /* @__PURE__ */
|
|
3581
|
+
children: loggingOut ? /* @__PURE__ */ jsx7(ActivityIndicator3, { color: t.live, size: "small" }) : /* @__PURE__ */ jsx7(Text5, { style: [styles4.logoutText, { color: t.live }], children: "Log Out" })
|
|
3439
3582
|
}
|
|
3440
3583
|
),
|
|
3441
|
-
appVersion ? /* @__PURE__ */
|
|
3584
|
+
appVersion ? /* @__PURE__ */ jsxs5(Text5, { style: [styles4.version, { color: t.textDim }], children: [
|
|
3442
3585
|
"v",
|
|
3443
3586
|
appVersion
|
|
3444
3587
|
] }) : null
|
|
@@ -3446,7 +3589,7 @@ function SettingsSheet({
|
|
|
3446
3589
|
}
|
|
3447
3590
|
);
|
|
3448
3591
|
}
|
|
3449
|
-
var
|
|
3592
|
+
var styles4 = StyleSheet5.create({
|
|
3450
3593
|
container: {
|
|
3451
3594
|
flex: 1
|
|
3452
3595
|
},
|
|
@@ -3511,43 +3654,20 @@ var styles3 = StyleSheet4.create({
|
|
|
3511
3654
|
// src/ui/UserProfileSheet.tsx
|
|
3512
3655
|
import { useState as useState17, useEffect as useEffect12, useRef as useRef5, useCallback as useCallback16, useMemo as useMemo4 } from "react";
|
|
3513
3656
|
import {
|
|
3514
|
-
View as
|
|
3515
|
-
Text as
|
|
3516
|
-
TouchableOpacity as
|
|
3657
|
+
View as View6,
|
|
3658
|
+
Text as Text6,
|
|
3659
|
+
TouchableOpacity as TouchableOpacity5,
|
|
3517
3660
|
ActivityIndicator as ActivityIndicator4,
|
|
3518
3661
|
Modal,
|
|
3519
3662
|
Animated as Animated2,
|
|
3520
|
-
StyleSheet as
|
|
3663
|
+
StyleSheet as StyleSheet6,
|
|
3521
3664
|
KeyboardAvoidingView as KeyboardAvoidingView2,
|
|
3522
3665
|
Platform as Platform5,
|
|
3523
|
-
Image as
|
|
3524
|
-
ScrollView as
|
|
3666
|
+
Image as Image5,
|
|
3667
|
+
ScrollView as ScrollView4,
|
|
3525
3668
|
Dimensions
|
|
3526
3669
|
} from "react-native";
|
|
3527
|
-
import { jsx as
|
|
3528
|
-
var DICEBEAR_STYLES2 = [
|
|
3529
|
-
"adventurer",
|
|
3530
|
-
"avataaars",
|
|
3531
|
-
"fun-emoji",
|
|
3532
|
-
"bottts",
|
|
3533
|
-
"big-smile",
|
|
3534
|
-
"thumbs"
|
|
3535
|
-
];
|
|
3536
|
-
function generateSeed2() {
|
|
3537
|
-
return Math.random().toString(36).slice(2, 10);
|
|
3538
|
-
}
|
|
3539
|
-
function getAvatarUrl2(style, seed, size = 256) {
|
|
3540
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&size=${size}`;
|
|
3541
|
-
}
|
|
3542
|
-
function parseAvatarUrl(url) {
|
|
3543
|
-
if (!url) return { style: "adventurer", seed: generateSeed2() };
|
|
3544
|
-
try {
|
|
3545
|
-
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
3546
|
-
if (match) return { style: match[1], seed: match[2] };
|
|
3547
|
-
} catch {
|
|
3548
|
-
}
|
|
3549
|
-
return { style: "adventurer", seed: generateSeed2() };
|
|
3550
|
-
}
|
|
3670
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3551
3671
|
function truncateAddress3(address, chars = 4) {
|
|
3552
3672
|
if (address.length <= chars * 2 + 3) return address;
|
|
3553
3673
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3566,12 +3686,14 @@ function UserProfileSheet({
|
|
|
3566
3686
|
const parsed = useMemo4(() => parseAvatarUrl(user.avatar), [user.avatar]);
|
|
3567
3687
|
const [avatarStyle, setAvatarStyle] = useState17(parsed.style);
|
|
3568
3688
|
const [avatarSeed, setAvatarSeed] = useState17(parsed.seed);
|
|
3689
|
+
const [bgColor, setBgColor] = useState17(parsed.bg);
|
|
3569
3690
|
const [saving, setSaving] = useState17(false);
|
|
3570
3691
|
const [error, setError] = useState17(null);
|
|
3571
3692
|
useEffect12(() => {
|
|
3572
3693
|
const p = parseAvatarUrl(user.avatar);
|
|
3573
3694
|
setAvatarStyle(p.style);
|
|
3574
3695
|
setAvatarSeed(p.seed);
|
|
3696
|
+
setBgColor(p.bg);
|
|
3575
3697
|
}, [user.avatar]);
|
|
3576
3698
|
useEffect12(() => {
|
|
3577
3699
|
Animated2.timing(overlayOpacity, {
|
|
@@ -3583,28 +3705,8 @@ function UserProfileSheet({
|
|
|
3583
3705
|
useEffect12(() => {
|
|
3584
3706
|
if (visible) setError(null);
|
|
3585
3707
|
}, [visible]);
|
|
3586
|
-
const currentAvatarUrl =
|
|
3587
|
-
const
|
|
3588
|
-
async (style) => {
|
|
3589
|
-
const newUrl = getAvatarUrl2(style, avatarSeed);
|
|
3590
|
-
setAvatarStyle(style);
|
|
3591
|
-
setSaving(true);
|
|
3592
|
-
setError(null);
|
|
3593
|
-
try {
|
|
3594
|
-
await client.updateProfile({ avatar: newUrl });
|
|
3595
|
-
onAvatarUpdated?.(newUrl);
|
|
3596
|
-
} catch (err) {
|
|
3597
|
-
setError(err instanceof Error ? err.message : "Failed to update avatar");
|
|
3598
|
-
} finally {
|
|
3599
|
-
setSaving(false);
|
|
3600
|
-
}
|
|
3601
|
-
},
|
|
3602
|
-
[avatarSeed, client, onAvatarUpdated]
|
|
3603
|
-
);
|
|
3604
|
-
const handleShuffle = useCallback16(async () => {
|
|
3605
|
-
const newSeed = generateSeed2();
|
|
3606
|
-
const newUrl = getAvatarUrl2(avatarStyle, newSeed);
|
|
3607
|
-
setAvatarSeed(newSeed);
|
|
3708
|
+
const currentAvatarUrl = getAvatarUrl(avatarStyle, avatarSeed, bgColor);
|
|
3709
|
+
const saveAvatar = useCallback16(async (newUrl) => {
|
|
3608
3710
|
setSaving(true);
|
|
3609
3711
|
setError(null);
|
|
3610
3712
|
try {
|
|
@@ -3615,8 +3717,21 @@ function UserProfileSheet({
|
|
|
3615
3717
|
} finally {
|
|
3616
3718
|
setSaving(false);
|
|
3617
3719
|
}
|
|
3618
|
-
}, [
|
|
3619
|
-
|
|
3720
|
+
}, [client, onAvatarUpdated]);
|
|
3721
|
+
const handleStyleChange = useCallback16((style) => {
|
|
3722
|
+
setAvatarStyle(style);
|
|
3723
|
+
saveAvatar(getAvatarUrl(style, avatarSeed, bgColor));
|
|
3724
|
+
}, [avatarSeed, bgColor, saveAvatar]);
|
|
3725
|
+
const handleShuffle = useCallback16(() => {
|
|
3726
|
+
const newSeed = generateSeed();
|
|
3727
|
+
setAvatarSeed(newSeed);
|
|
3728
|
+
saveAvatar(getAvatarUrl(avatarStyle, newSeed, bgColor));
|
|
3729
|
+
}, [avatarStyle, bgColor, saveAvatar]);
|
|
3730
|
+
const handleBgChange = useCallback16((color) => {
|
|
3731
|
+
setBgColor(color);
|
|
3732
|
+
saveAvatar(getAvatarUrl(avatarStyle, avatarSeed, color));
|
|
3733
|
+
}, [avatarStyle, avatarSeed, saveAvatar]);
|
|
3734
|
+
return /* @__PURE__ */ jsxs6(
|
|
3620
3735
|
Modal,
|
|
3621
3736
|
{
|
|
3622
3737
|
visible,
|
|
@@ -3624,123 +3739,101 @@ function UserProfileSheet({
|
|
|
3624
3739
|
transparent: true,
|
|
3625
3740
|
onRequestClose: onDismiss,
|
|
3626
3741
|
children: [
|
|
3627
|
-
/* @__PURE__ */
|
|
3628
|
-
/* @__PURE__ */
|
|
3742
|
+
/* @__PURE__ */ jsx8(Animated2.View, { style: [styles5.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx8(TouchableOpacity5, { style: styles5.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
3743
|
+
/* @__PURE__ */ jsx8(
|
|
3629
3744
|
KeyboardAvoidingView2,
|
|
3630
3745
|
{
|
|
3631
|
-
style:
|
|
3746
|
+
style: styles5.keyboardView,
|
|
3632
3747
|
behavior: Platform5.OS === "ios" ? "padding" : void 0,
|
|
3633
|
-
children: /* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
/* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3637
|
-
/* @__PURE__ */
|
|
3748
|
+
children: /* @__PURE__ */ jsx8(View6, { style: styles5.sheetPositioner, children: /* @__PURE__ */ jsxs6(View6, { style: [styles5.sheet, { backgroundColor: t.background }], children: [
|
|
3749
|
+
/* @__PURE__ */ jsx8(View6, { style: styles5.handleRow, children: /* @__PURE__ */ jsx8(View6, { style: [styles5.handle, { backgroundColor: t.textMuted }] }) }),
|
|
3750
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.header, children: [
|
|
3751
|
+
/* @__PURE__ */ jsx8(Text6, { style: [styles5.headerTitle, { color: t.text }], children: "Profile" }),
|
|
3752
|
+
/* @__PURE__ */ jsx8(TouchableOpacity5, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
3638
3753
|
] }),
|
|
3639
|
-
/* @__PURE__ */
|
|
3640
|
-
|
|
3754
|
+
/* @__PURE__ */ jsxs6(
|
|
3755
|
+
ScrollView4,
|
|
3641
3756
|
{
|
|
3642
|
-
style:
|
|
3643
|
-
contentContainerStyle:
|
|
3757
|
+
style: styles5.scrollContent,
|
|
3758
|
+
contentContainerStyle: styles5.scrollContentInner,
|
|
3644
3759
|
showsVerticalScrollIndicator: false,
|
|
3645
3760
|
bounces: false,
|
|
3646
3761
|
children: [
|
|
3647
|
-
/* @__PURE__ */
|
|
3648
|
-
/* @__PURE__ */
|
|
3649
|
-
/* @__PURE__ */
|
|
3650
|
-
|
|
3762
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.avatarSection, children: [
|
|
3763
|
+
/* @__PURE__ */ jsxs6(View6, { style: [styles5.avatarContainer, { borderColor: t.border }], children: [
|
|
3764
|
+
/* @__PURE__ */ jsx8(
|
|
3765
|
+
Image5,
|
|
3651
3766
|
{
|
|
3652
3767
|
source: { uri: currentAvatarUrl },
|
|
3653
|
-
style:
|
|
3768
|
+
style: styles5.avatar
|
|
3654
3769
|
}
|
|
3655
3770
|
),
|
|
3656
|
-
saving && /* @__PURE__ */
|
|
3771
|
+
saving && /* @__PURE__ */ jsx8(View6, { style: styles5.avatarLoading, children: /* @__PURE__ */ jsx8(ActivityIndicator4, { size: "small", color: "#FFFFFF" }) })
|
|
3657
3772
|
] }),
|
|
3658
|
-
user.username ? /* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3773
|
+
user.username ? /* @__PURE__ */ jsx8(Text6, { style: [styles5.username, { color: t.text }], children: user.username }) : null,
|
|
3774
|
+
/* @__PURE__ */ jsx8(Text6, { style: [styles5.walletAddress, { color: t.textMuted }], children: truncateAddress3(user.walletAddress, 6) })
|
|
3660
3775
|
] }),
|
|
3661
|
-
/* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3665
|
-
|
|
3776
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.section, children: [
|
|
3777
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.sectionHeaderRow, children: [
|
|
3778
|
+
/* @__PURE__ */ jsx8(Text6, { style: [styles5.sectionLabel, { color: t.textSecondary }], children: "Change Avatar" }),
|
|
3779
|
+
/* @__PURE__ */ jsx8(
|
|
3780
|
+
TouchableOpacity5,
|
|
3666
3781
|
{
|
|
3667
|
-
style: [
|
|
3782
|
+
style: [styles5.shuffleButton, { borderColor: t.border }],
|
|
3668
3783
|
onPress: handleShuffle,
|
|
3669
3784
|
activeOpacity: 0.7,
|
|
3670
3785
|
disabled: saving,
|
|
3671
|
-
children: /* @__PURE__ */
|
|
3786
|
+
children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.shuffleText, { color: t.accent }], children: "Shuffle" })
|
|
3672
3787
|
}
|
|
3673
3788
|
)
|
|
3674
3789
|
] }),
|
|
3675
|
-
/* @__PURE__ */
|
|
3676
|
-
|
|
3790
|
+
/* @__PURE__ */ jsx8(
|
|
3791
|
+
AvatarEditor,
|
|
3677
3792
|
{
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
{
|
|
3686
|
-
onPress: () => handleSelectStyle(style),
|
|
3687
|
-
activeOpacity: 0.7,
|
|
3688
|
-
disabled: saving,
|
|
3689
|
-
style: [
|
|
3690
|
-
styles4.styleTile,
|
|
3691
|
-
{
|
|
3692
|
-
borderColor: isSelected ? t.accent : t.border,
|
|
3693
|
-
borderWidth: isSelected ? 2 : 1
|
|
3694
|
-
}
|
|
3695
|
-
],
|
|
3696
|
-
children: /* @__PURE__ */ jsx7(
|
|
3697
|
-
Image4,
|
|
3698
|
-
{
|
|
3699
|
-
source: { uri: getAvatarUrl2(style, avatarSeed, 80) },
|
|
3700
|
-
style: styles4.styleTileImage
|
|
3701
|
-
}
|
|
3702
|
-
)
|
|
3703
|
-
},
|
|
3704
|
-
style
|
|
3705
|
-
);
|
|
3706
|
-
})
|
|
3793
|
+
style: avatarStyle,
|
|
3794
|
+
seed: avatarSeed,
|
|
3795
|
+
bg: bgColor,
|
|
3796
|
+
onStyleChange: handleStyleChange,
|
|
3797
|
+
onSeedChange: setAvatarSeed,
|
|
3798
|
+
onBgChange: handleBgChange,
|
|
3799
|
+
disabled: saving
|
|
3707
3800
|
}
|
|
3708
3801
|
)
|
|
3709
3802
|
] }),
|
|
3710
|
-
error ? /* @__PURE__ */
|
|
3711
|
-
push.enabled && /* @__PURE__ */
|
|
3712
|
-
/* @__PURE__ */
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
|
|
3803
|
+
error ? /* @__PURE__ */ jsx8(View6, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.errorText, { color: t.errorText }], children: error }) }) : null,
|
|
3804
|
+
push.enabled && /* @__PURE__ */ jsxs6(View6, { style: [styles5.notifRow, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3805
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.notifLeft, children: [
|
|
3806
|
+
/* @__PURE__ */ jsx8(Text6, { style: [styles5.notifLabel, { color: t.text }], children: "Push Notifications" }),
|
|
3807
|
+
/* @__PURE__ */ jsx8(
|
|
3808
|
+
Text6,
|
|
3716
3809
|
{
|
|
3717
3810
|
style: [
|
|
3718
|
-
|
|
3811
|
+
styles5.notifStatus,
|
|
3719
3812
|
{ color: push.hasPermission ? t.success : t.textMuted }
|
|
3720
3813
|
],
|
|
3721
3814
|
children: push.hasPermission ? "Enabled" : "Disabled"
|
|
3722
3815
|
}
|
|
3723
3816
|
)
|
|
3724
3817
|
] }),
|
|
3725
|
-
!push.hasPermission && /* @__PURE__ */
|
|
3726
|
-
|
|
3818
|
+
!push.hasPermission && /* @__PURE__ */ jsx8(
|
|
3819
|
+
TouchableOpacity5,
|
|
3727
3820
|
{
|
|
3728
|
-
style: [
|
|
3821
|
+
style: [styles5.enableButton, { backgroundColor: t.accent }],
|
|
3729
3822
|
onPress: push.register,
|
|
3730
3823
|
disabled: push.loading,
|
|
3731
3824
|
activeOpacity: 0.8,
|
|
3732
|
-
children: push.loading ? /* @__PURE__ */
|
|
3825
|
+
children: push.loading ? /* @__PURE__ */ jsx8(ActivityIndicator4, { size: "small", color: "#FFFFFF" }) : /* @__PURE__ */ jsx8(Text6, { style: styles5.enableText, children: "Enable" })
|
|
3733
3826
|
}
|
|
3734
3827
|
)
|
|
3735
3828
|
] }),
|
|
3736
|
-
push.enabled && push.error ? /* @__PURE__ */
|
|
3737
|
-
onDisconnect ? /* @__PURE__ */
|
|
3738
|
-
|
|
3829
|
+
push.enabled && push.error ? /* @__PURE__ */ jsx8(View6, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.errorText, { color: t.errorText }], children: push.error.message }) }) : null,
|
|
3830
|
+
onDisconnect ? /* @__PURE__ */ jsx8(
|
|
3831
|
+
TouchableOpacity5,
|
|
3739
3832
|
{
|
|
3740
|
-
style: [
|
|
3833
|
+
style: [styles5.disconnectButton, { borderColor: t.live }],
|
|
3741
3834
|
onPress: onDisconnect,
|
|
3742
3835
|
activeOpacity: 0.7,
|
|
3743
|
-
children: /* @__PURE__ */
|
|
3836
|
+
children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.disconnectText, { color: t.live }], children: "Disconnect Wallet" })
|
|
3744
3837
|
}
|
|
3745
3838
|
) : null
|
|
3746
3839
|
]
|
|
@@ -3753,9 +3846,9 @@ function UserProfileSheet({
|
|
|
3753
3846
|
}
|
|
3754
3847
|
);
|
|
3755
3848
|
}
|
|
3756
|
-
var
|
|
3849
|
+
var styles5 = StyleSheet6.create({
|
|
3757
3850
|
overlay: {
|
|
3758
|
-
...
|
|
3851
|
+
...StyleSheet6.absoluteFillObject,
|
|
3759
3852
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
3760
3853
|
},
|
|
3761
3854
|
overlayTap: {
|
|
@@ -3806,7 +3899,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3806
3899
|
scrollContentInner: {
|
|
3807
3900
|
paddingBottom: 8
|
|
3808
3901
|
},
|
|
3809
|
-
// Avatar
|
|
3810
3902
|
avatarSection: {
|
|
3811
3903
|
alignItems: "center",
|
|
3812
3904
|
paddingTop: 8,
|
|
@@ -3822,11 +3914,10 @@ var styles4 = StyleSheet5.create({
|
|
|
3822
3914
|
},
|
|
3823
3915
|
avatar: {
|
|
3824
3916
|
width: "100%",
|
|
3825
|
-
height: "100%"
|
|
3826
|
-
backgroundColor: "#1a1a2e"
|
|
3917
|
+
height: "100%"
|
|
3827
3918
|
},
|
|
3828
3919
|
avatarLoading: {
|
|
3829
|
-
...
|
|
3920
|
+
...StyleSheet6.absoluteFillObject,
|
|
3830
3921
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
3831
3922
|
justifyContent: "center",
|
|
3832
3923
|
alignItems: "center"
|
|
@@ -3839,7 +3930,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3839
3930
|
fontSize: 13,
|
|
3840
3931
|
fontFamily: "monospace"
|
|
3841
3932
|
},
|
|
3842
|
-
// Change Avatar
|
|
3843
3933
|
section: {
|
|
3844
3934
|
marginBottom: 20,
|
|
3845
3935
|
gap: 12
|
|
@@ -3863,21 +3953,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3863
3953
|
fontSize: 13,
|
|
3864
3954
|
fontWeight: "600"
|
|
3865
3955
|
},
|
|
3866
|
-
stylePickerContent: {
|
|
3867
|
-
gap: 10
|
|
3868
|
-
},
|
|
3869
|
-
styleTile: {
|
|
3870
|
-
width: 72,
|
|
3871
|
-
height: 72,
|
|
3872
|
-
borderRadius: 16,
|
|
3873
|
-
overflow: "hidden"
|
|
3874
|
-
},
|
|
3875
|
-
styleTileImage: {
|
|
3876
|
-
width: "100%",
|
|
3877
|
-
height: "100%",
|
|
3878
|
-
backgroundColor: "#1a1a2e"
|
|
3879
|
-
},
|
|
3880
|
-
// Error
|
|
3881
3956
|
errorBox: {
|
|
3882
3957
|
marginBottom: 16,
|
|
3883
3958
|
borderRadius: 12,
|
|
@@ -3888,7 +3963,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3888
3963
|
fontSize: 13,
|
|
3889
3964
|
fontWeight: "500"
|
|
3890
3965
|
},
|
|
3891
|
-
// Push Notifications
|
|
3892
3966
|
notifRow: {
|
|
3893
3967
|
flexDirection: "row",
|
|
3894
3968
|
alignItems: "center",
|
|
@@ -3919,7 +3993,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3919
3993
|
fontSize: 14,
|
|
3920
3994
|
fontWeight: "700"
|
|
3921
3995
|
},
|
|
3922
|
-
// Disconnect
|
|
3923
3996
|
disconnectButton: {
|
|
3924
3997
|
height: 52,
|
|
3925
3998
|
borderRadius: 16,
|
|
@@ -3935,8 +4008,8 @@ var styles4 = StyleSheet5.create({
|
|
|
3935
4008
|
|
|
3936
4009
|
// src/ui/game/GamePoster.tsx
|
|
3937
4010
|
import { useState as useState18 } from "react";
|
|
3938
|
-
import { StyleSheet as
|
|
3939
|
-
import { jsx as
|
|
4011
|
+
import { StyleSheet as StyleSheet7, View as View7, Text as Text7 } from "react-native";
|
|
4012
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3940
4013
|
function computeCountdown(lockTimestamp) {
|
|
3941
4014
|
if (!lockTimestamp) return "";
|
|
3942
4015
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -3957,27 +4030,27 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
3957
4030
|
const away = opponents[1];
|
|
3958
4031
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
3959
4032
|
const isLive = countdown === "LIVE";
|
|
3960
|
-
return /* @__PURE__ */
|
|
3961
|
-
game.media?.poster ? /* @__PURE__ */
|
|
4033
|
+
return /* @__PURE__ */ jsxs7(View7, { style: styles6.container, children: [
|
|
4034
|
+
game.media?.poster ? /* @__PURE__ */ jsx9(
|
|
3962
4035
|
Img,
|
|
3963
4036
|
{
|
|
3964
4037
|
source: { uri: game.media.poster },
|
|
3965
|
-
style:
|
|
4038
|
+
style: styles6.image,
|
|
3966
4039
|
resizeMode: "cover"
|
|
3967
4040
|
}
|
|
3968
|
-
) : /* @__PURE__ */
|
|
3969
|
-
/* @__PURE__ */
|
|
3970
|
-
/* @__PURE__ */
|
|
3971
|
-
/* @__PURE__ */
|
|
4041
|
+
) : /* @__PURE__ */ jsx9(View7, { style: [styles6.image, { backgroundColor: t.surface }], children: /* @__PURE__ */ jsxs7(View7, { style: styles6.fallback, children: [
|
|
4042
|
+
/* @__PURE__ */ jsx9(TeamLogoInternal, { url: home?.imageUrl, size: 56, Img }),
|
|
4043
|
+
/* @__PURE__ */ jsx9(Text7, { style: styles6.vs, children: "VS" }),
|
|
4044
|
+
/* @__PURE__ */ jsx9(TeamLogoInternal, { url: away?.imageUrl, size: 56, Img })
|
|
3972
4045
|
] }) }),
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
3976
|
-
/* @__PURE__ */
|
|
3977
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__PURE__ */ jsx9(View7, { style: styles6.overlay }),
|
|
4047
|
+
/* @__PURE__ */ jsxs7(View7, { style: styles6.teamNames, children: [
|
|
4048
|
+
/* @__PURE__ */ jsx9(Text7, { style: styles6.teamNameText, numberOfLines: 1, children: home?.name || "Home" }),
|
|
4049
|
+
/* @__PURE__ */ jsx9(Text7, { style: styles6.teamNameVs, children: "vs" }),
|
|
4050
|
+
/* @__PURE__ */ jsx9(Text7, { style: styles6.teamNameText, numberOfLines: 1, children: away?.name || "Away" })
|
|
3978
4051
|
] }),
|
|
3979
|
-
countdown ? /* @__PURE__ */
|
|
3980
|
-
/* @__PURE__ */
|
|
4052
|
+
countdown ? /* @__PURE__ */ jsx9(View7, { style: styles6.countdownPill, children: /* @__PURE__ */ jsx9(Text7, { style: [styles6.countdownText, isLive && styles6.countdownLive], children: countdown }) }) : null,
|
|
4053
|
+
/* @__PURE__ */ jsx9(View7, { style: styles6.poolPill, children: /* @__PURE__ */ jsxs7(Text7, { style: styles6.poolText, children: [
|
|
3981
4054
|
game.totalPool || 0,
|
|
3982
4055
|
" SOL"
|
|
3983
4056
|
] }) })
|
|
@@ -3986,9 +4059,9 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
3986
4059
|
function TeamLogoInternal({ url, size, Img }) {
|
|
3987
4060
|
const [failed, setFailed] = useState18(false);
|
|
3988
4061
|
if (!url || failed) {
|
|
3989
|
-
return /* @__PURE__ */
|
|
4062
|
+
return /* @__PURE__ */ jsx9(View7, { style: [styles6.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
3990
4063
|
}
|
|
3991
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsx9(
|
|
3992
4065
|
Img,
|
|
3993
4066
|
{
|
|
3994
4067
|
source: { uri: url },
|
|
@@ -3998,7 +4071,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
3998
4071
|
}
|
|
3999
4072
|
);
|
|
4000
4073
|
}
|
|
4001
|
-
var
|
|
4074
|
+
var styles6 = StyleSheet7.create({
|
|
4002
4075
|
container: {
|
|
4003
4076
|
height: 200,
|
|
4004
4077
|
borderRadius: 16,
|
|
@@ -4006,12 +4079,12 @@ var styles5 = StyleSheet6.create({
|
|
|
4006
4079
|
position: "relative"
|
|
4007
4080
|
},
|
|
4008
4081
|
image: {
|
|
4009
|
-
...
|
|
4082
|
+
...StyleSheet7.absoluteFillObject,
|
|
4010
4083
|
justifyContent: "center",
|
|
4011
4084
|
alignItems: "center"
|
|
4012
4085
|
},
|
|
4013
4086
|
overlay: {
|
|
4014
|
-
...
|
|
4087
|
+
...StyleSheet7.absoluteFillObject,
|
|
4015
4088
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4016
4089
|
},
|
|
4017
4090
|
fallback: {
|
|
@@ -4086,8 +4159,8 @@ var styles5 = StyleSheet6.create({
|
|
|
4086
4159
|
|
|
4087
4160
|
// src/ui/game/LivePoolsCard.tsx
|
|
4088
4161
|
import { useMemo as useMemo5 } from "react";
|
|
4089
|
-
import { StyleSheet as
|
|
4090
|
-
import { jsx as
|
|
4162
|
+
import { StyleSheet as StyleSheet8, View as View8, Text as Text8 } from "react-native";
|
|
4163
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
4091
4164
|
function LivePoolsCard({
|
|
4092
4165
|
game,
|
|
4093
4166
|
shortName,
|
|
@@ -4109,29 +4182,29 @@ function LivePoolsCard({
|
|
|
4109
4182
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4110
4183
|
};
|
|
4111
4184
|
}, [homePool, awayPool, totalPool]);
|
|
4112
|
-
return /* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
/* @__PURE__ */
|
|
4185
|
+
return /* @__PURE__ */ jsxs8(View8, { style: [styles7.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4186
|
+
/* @__PURE__ */ jsx10(Text8, { style: [styles7.title, { color: t.text }], children: "Live Pools" }),
|
|
4187
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.total, { color: t.accent }], children: [
|
|
4115
4188
|
totalPool,
|
|
4116
4189
|
" SOL total"
|
|
4117
4190
|
] }),
|
|
4118
|
-
/* @__PURE__ */
|
|
4119
|
-
/* @__PURE__ */
|
|
4120
|
-
/* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ jsxs8(View8, { style: styles7.bars, children: [
|
|
4192
|
+
/* @__PURE__ */ jsx10(PoolBar, { name: homeName, amount: homePool, percent: homePercent, color: homeColor, t }),
|
|
4193
|
+
/* @__PURE__ */ jsx10(PoolBar, { name: awayName, amount: awayPool, percent: awayPercent, color: awayColor, t })
|
|
4121
4194
|
] }),
|
|
4122
|
-
/* @__PURE__ */
|
|
4123
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ jsxs8(View8, { style: styles7.oddsRow, children: [
|
|
4196
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4124
4197
|
homeName,
|
|
4125
4198
|
": ",
|
|
4126
|
-
/* @__PURE__ */
|
|
4199
|
+
/* @__PURE__ */ jsxs8(Text8, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4127
4200
|
homeOdds,
|
|
4128
4201
|
"x"
|
|
4129
4202
|
] })
|
|
4130
4203
|
] }),
|
|
4131
|
-
/* @__PURE__ */
|
|
4204
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4132
4205
|
awayName,
|
|
4133
4206
|
": ",
|
|
4134
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsxs8(Text8, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4135
4208
|
awayOdds,
|
|
4136
4209
|
"x"
|
|
4137
4210
|
] })
|
|
@@ -4140,16 +4213,16 @@ function LivePoolsCard({
|
|
|
4140
4213
|
] });
|
|
4141
4214
|
}
|
|
4142
4215
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4143
|
-
return /* @__PURE__ */
|
|
4144
|
-
/* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4146
|
-
/* @__PURE__ */
|
|
4216
|
+
return /* @__PURE__ */ jsxs8(View8, { style: styles7.barRow, children: [
|
|
4217
|
+
/* @__PURE__ */ jsx10(Text8, { style: [styles7.barLabel, { color: t.textSecondary }], numberOfLines: 1, children: name }),
|
|
4218
|
+
/* @__PURE__ */ jsx10(View8, { style: [styles7.barTrack, { backgroundColor: t.border }], children: /* @__PURE__ */ jsx10(View8, { style: [styles7.barFill, { width: `${Math.max(percent, 2)}%`, backgroundColor: color }] }) }),
|
|
4219
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.barAmount, { color: t.text }], children: [
|
|
4147
4220
|
amount,
|
|
4148
4221
|
" SOL"
|
|
4149
4222
|
] })
|
|
4150
4223
|
] });
|
|
4151
4224
|
}
|
|
4152
|
-
var
|
|
4225
|
+
var styles7 = StyleSheet8.create({
|
|
4153
4226
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4154
4227
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4155
4228
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4165,8 +4238,8 @@ var styles6 = StyleSheet7.create({
|
|
|
4165
4238
|
|
|
4166
4239
|
// src/ui/game/PickWinnerCard.tsx
|
|
4167
4240
|
import { useState as useState19, useMemo as useMemo6 } from "react";
|
|
4168
|
-
import { StyleSheet as
|
|
4169
|
-
import { jsx as
|
|
4241
|
+
import { StyleSheet as StyleSheet9, View as View9, Text as Text9, TouchableOpacity as TouchableOpacity6 } from "react-native";
|
|
4242
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
4170
4243
|
function PickWinnerCard({
|
|
4171
4244
|
game,
|
|
4172
4245
|
selectedTeam,
|
|
@@ -4190,10 +4263,10 @@ function PickWinnerCard({
|
|
|
4190
4263
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4191
4264
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4192
4265
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4193
|
-
return /* @__PURE__ */
|
|
4194
|
-
/* @__PURE__ */
|
|
4195
|
-
/* @__PURE__ */
|
|
4196
|
-
/* @__PURE__ */
|
|
4266
|
+
return /* @__PURE__ */ jsxs9(View9, { style: [styles8.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4267
|
+
/* @__PURE__ */ jsx11(Text9, { style: [styles8.title, { color: t.text }], children: "Pick Your Winner" }),
|
|
4268
|
+
/* @__PURE__ */ jsxs9(View9, { style: styles8.row, children: [
|
|
4269
|
+
/* @__PURE__ */ jsx11(
|
|
4197
4270
|
TeamOption,
|
|
4198
4271
|
{
|
|
4199
4272
|
name: homeName,
|
|
@@ -4207,7 +4280,7 @@ function PickWinnerCard({
|
|
|
4207
4280
|
t
|
|
4208
4281
|
}
|
|
4209
4282
|
),
|
|
4210
|
-
/* @__PURE__ */
|
|
4283
|
+
/* @__PURE__ */ jsx11(
|
|
4211
4284
|
TeamOption,
|
|
4212
4285
|
{
|
|
4213
4286
|
name: awayName,
|
|
@@ -4238,30 +4311,30 @@ function TeamOption({
|
|
|
4238
4311
|
const [imgFailed, setImgFailed] = useState19(false);
|
|
4239
4312
|
const Img = ImageComponent || __require("react-native").Image;
|
|
4240
4313
|
const showImage = imageUrl && !imgFailed;
|
|
4241
|
-
return /* @__PURE__ */
|
|
4242
|
-
|
|
4314
|
+
return /* @__PURE__ */ jsxs9(
|
|
4315
|
+
TouchableOpacity6,
|
|
4243
4316
|
{
|
|
4244
|
-
style: [
|
|
4317
|
+
style: [styles8.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4245
4318
|
onPress,
|
|
4246
4319
|
activeOpacity: 0.7,
|
|
4247
4320
|
children: [
|
|
4248
|
-
showImage ? /* @__PURE__ */
|
|
4249
|
-
/* @__PURE__ */
|
|
4250
|
-
/* @__PURE__ */
|
|
4321
|
+
showImage ? /* @__PURE__ */ jsx11(Img, { source: { uri: imageUrl }, style: styles8.logo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx11(View9, { style: [styles8.logo, styles8.logoPlaceholder] }),
|
|
4322
|
+
/* @__PURE__ */ jsx11(Text9, { style: [styles8.name, { color: t.text }], numberOfLines: 1, children: name }),
|
|
4323
|
+
/* @__PURE__ */ jsxs9(Text9, { style: [styles8.odds, { color }], children: [
|
|
4251
4324
|
odds,
|
|
4252
4325
|
"x"
|
|
4253
4326
|
] }),
|
|
4254
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ jsxs9(Text9, { style: [styles8.bets, { color: t.textMuted }], children: [
|
|
4255
4328
|
bets,
|
|
4256
4329
|
" ",
|
|
4257
4330
|
bets === 1 ? "bet" : "bets"
|
|
4258
4331
|
] }),
|
|
4259
|
-
selected && /* @__PURE__ */
|
|
4332
|
+
selected && /* @__PURE__ */ jsx11(View9, { style: [styles8.badge, { backgroundColor: color }], children: /* @__PURE__ */ jsx11(Text9, { style: styles8.badgeText, children: "Selected" }) })
|
|
4260
4333
|
]
|
|
4261
4334
|
}
|
|
4262
4335
|
);
|
|
4263
4336
|
}
|
|
4264
|
-
var
|
|
4337
|
+
var styles8 = StyleSheet9.create({
|
|
4265
4338
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4266
4339
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4267
4340
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4277,8 +4350,8 @@ var styles7 = StyleSheet8.create({
|
|
|
4277
4350
|
|
|
4278
4351
|
// src/ui/game/PlayersCard.tsx
|
|
4279
4352
|
import { useState as useState20 } from "react";
|
|
4280
|
-
import { StyleSheet as
|
|
4281
|
-
import { jsx as
|
|
4353
|
+
import { StyleSheet as StyleSheet10, View as View10, Text as Text10 } from "react-native";
|
|
4354
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
4282
4355
|
function truncateWallet(addr, chars) {
|
|
4283
4356
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4284
4357
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4298,12 +4371,12 @@ function PlayersCard({
|
|
|
4298
4371
|
if (team === "away") return awayColor;
|
|
4299
4372
|
return drawColor;
|
|
4300
4373
|
};
|
|
4301
|
-
return /* @__PURE__ */
|
|
4302
|
-
/* @__PURE__ */
|
|
4374
|
+
return /* @__PURE__ */ jsxs10(View10, { style: [styles9.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4375
|
+
/* @__PURE__ */ jsxs10(Text10, { style: [styles9.title, { color: t.text }], children: [
|
|
4303
4376
|
"Players",
|
|
4304
4377
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4305
4378
|
] }),
|
|
4306
|
-
bettors.length === 0 ? /* @__PURE__ */
|
|
4379
|
+
bettors.length === 0 ? /* @__PURE__ */ jsx12(Text10, { style: [styles9.empty, { color: t.textMuted }], children: "No players yet \u2014 be the first!" }) : bettors.map((b, i) => /* @__PURE__ */ jsx12(
|
|
4307
4380
|
BettorRow,
|
|
4308
4381
|
{
|
|
4309
4382
|
bettor: b,
|
|
@@ -4328,17 +4401,17 @@ function BettorRow({
|
|
|
4328
4401
|
const [imgFailed, setImgFailed] = useState20(false);
|
|
4329
4402
|
const Img = ImageComponent || __require("react-native").Image;
|
|
4330
4403
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4331
|
-
return /* @__PURE__ */
|
|
4332
|
-
/* @__PURE__ */
|
|
4333
|
-
showAvatar ? /* @__PURE__ */
|
|
4334
|
-
/* @__PURE__ */
|
|
4335
|
-
/* @__PURE__ */
|
|
4404
|
+
return /* @__PURE__ */ jsxs10(View10, { style: [styles9.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4405
|
+
/* @__PURE__ */ jsx12(View10, { style: [styles9.dot, { backgroundColor: dotColor }] }),
|
|
4406
|
+
showAvatar ? /* @__PURE__ */ jsx12(Img, { source: { uri: ensurePngAvatar(bettor.avatar) }, style: styles9.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx12(View10, { style: [styles9.avatar, styles9.avatarPlaceholder] }),
|
|
4407
|
+
/* @__PURE__ */ jsx12(View10, { style: styles9.nameCol, children: /* @__PURE__ */ jsx12(Text10, { style: [styles9.username, { color: t.text }], numberOfLines: 1, children: bettor.username || truncateWallet(bettor.wallet, truncateChars) }) }),
|
|
4408
|
+
/* @__PURE__ */ jsxs10(Text10, { style: [styles9.amount, { color: t.textSecondary }], children: [
|
|
4336
4409
|
bettor.amount,
|
|
4337
4410
|
" SOL"
|
|
4338
4411
|
] })
|
|
4339
4412
|
] });
|
|
4340
4413
|
}
|
|
4341
|
-
var
|
|
4414
|
+
var styles9 = StyleSheet10.create({
|
|
4342
4415
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4343
4416
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4344
4417
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4353,8 +4426,8 @@ var styles8 = StyleSheet9.create({
|
|
|
4353
4426
|
|
|
4354
4427
|
// src/ui/game/JoinGameButton.tsx
|
|
4355
4428
|
import { useMemo as useMemo7 } from "react";
|
|
4356
|
-
import { StyleSheet as
|
|
4357
|
-
import { jsx as
|
|
4429
|
+
import { StyleSheet as StyleSheet11, View as View11, Text as Text11, TouchableOpacity as TouchableOpacity7, ActivityIndicator as ActivityIndicator5 } from "react-native";
|
|
4430
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4358
4431
|
var STATUS_LABELS = {
|
|
4359
4432
|
building: "Building transaction...",
|
|
4360
4433
|
signing: "Approve in wallet...",
|
|
@@ -4370,30 +4443,30 @@ function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
|
4370
4443
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4371
4444
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4372
4445
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4373
|
-
return /* @__PURE__ */
|
|
4374
|
-
/* @__PURE__ */
|
|
4375
|
-
/* @__PURE__ */
|
|
4376
|
-
/* @__PURE__ */
|
|
4446
|
+
return /* @__PURE__ */ jsxs11(View11, { style: [styles10.bar, { backgroundColor: t.background, borderTopColor: t.border }], children: [
|
|
4447
|
+
/* @__PURE__ */ jsxs11(View11, { style: styles10.buyInRow, children: [
|
|
4448
|
+
/* @__PURE__ */ jsx13(Text11, { style: [styles10.buyInLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4449
|
+
/* @__PURE__ */ jsxs11(Text11, { style: [styles10.buyInValue, { color: t.text }], children: [
|
|
4377
4450
|
game.buyIn,
|
|
4378
4451
|
" SOL"
|
|
4379
4452
|
] })
|
|
4380
4453
|
] }),
|
|
4381
|
-
/* @__PURE__ */
|
|
4382
|
-
|
|
4454
|
+
/* @__PURE__ */ jsx13(
|
|
4455
|
+
TouchableOpacity7,
|
|
4383
4456
|
{
|
|
4384
|
-
style: [
|
|
4457
|
+
style: [styles10.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4385
4458
|
disabled: !selectedTeam || isJoining,
|
|
4386
4459
|
onPress: onJoin,
|
|
4387
4460
|
activeOpacity: 0.8,
|
|
4388
|
-
children: isJoining ? /* @__PURE__ */
|
|
4389
|
-
/* @__PURE__ */
|
|
4390
|
-
/* @__PURE__ */
|
|
4391
|
-
] }) : /* @__PURE__ */
|
|
4461
|
+
children: isJoining ? /* @__PURE__ */ jsxs11(View11, { style: styles10.joiningRow, children: [
|
|
4462
|
+
/* @__PURE__ */ jsx13(ActivityIndicator5, { size: "small", color: "#000" }),
|
|
4463
|
+
/* @__PURE__ */ jsx13(Text11, { style: styles10.buttonText, children: statusLabel })
|
|
4464
|
+
] }) : /* @__PURE__ */ jsx13(Text11, { style: [styles10.buttonText, !selectedTeam && { color: t.textMuted }], children: selectedTeam ? `Join Bet \u2014 ${game.buyIn} SOL` : "Pick a team to bet" })
|
|
4392
4465
|
}
|
|
4393
4466
|
)
|
|
4394
4467
|
] });
|
|
4395
4468
|
}
|
|
4396
|
-
var
|
|
4469
|
+
var styles10 = StyleSheet11.create({
|
|
4397
4470
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4398
4471
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4399
4472
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4406,18 +4479,18 @@ var styles9 = StyleSheet10.create({
|
|
|
4406
4479
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4407
4480
|
import { useState as useState21, useEffect as useEffect13, useRef as useRef6, useCallback as useCallback17 } from "react";
|
|
4408
4481
|
import {
|
|
4409
|
-
View as
|
|
4410
|
-
Text as
|
|
4482
|
+
View as View12,
|
|
4483
|
+
Text as Text12,
|
|
4411
4484
|
TextInput as TextInput2,
|
|
4412
|
-
TouchableOpacity as
|
|
4485
|
+
TouchableOpacity as TouchableOpacity8,
|
|
4413
4486
|
ActivityIndicator as ActivityIndicator6,
|
|
4414
4487
|
Modal as Modal2,
|
|
4415
4488
|
Animated as Animated3,
|
|
4416
|
-
StyleSheet as
|
|
4489
|
+
StyleSheet as StyleSheet12,
|
|
4417
4490
|
KeyboardAvoidingView as KeyboardAvoidingView3,
|
|
4418
4491
|
Platform as Platform6
|
|
4419
4492
|
} from "react-native";
|
|
4420
|
-
import { jsx as
|
|
4493
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4421
4494
|
var STATUS_LABELS2 = {
|
|
4422
4495
|
building: "Building transaction...",
|
|
4423
4496
|
signing: "Approve in wallet...",
|
|
@@ -4516,7 +4589,7 @@ function CreateCustomGameSheet({
|
|
|
4516
4589
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4517
4590
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4518
4591
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4519
|
-
return /* @__PURE__ */
|
|
4592
|
+
return /* @__PURE__ */ jsxs12(
|
|
4520
4593
|
Modal2,
|
|
4521
4594
|
{
|
|
4522
4595
|
visible,
|
|
@@ -4524,34 +4597,34 @@ function CreateCustomGameSheet({
|
|
|
4524
4597
|
transparent: true,
|
|
4525
4598
|
onRequestClose: onDismiss,
|
|
4526
4599
|
children: [
|
|
4527
|
-
/* @__PURE__ */
|
|
4528
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx14(Animated3.View, { style: [styles11.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx14(TouchableOpacity8, { style: styles11.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4601
|
+
/* @__PURE__ */ jsx14(
|
|
4529
4602
|
KeyboardAvoidingView3,
|
|
4530
4603
|
{
|
|
4531
|
-
style:
|
|
4604
|
+
style: styles11.keyboardView,
|
|
4532
4605
|
behavior: Platform6.OS === "ios" ? "padding" : void 0,
|
|
4533
|
-
children: /* @__PURE__ */
|
|
4534
|
-
/* @__PURE__ */
|
|
4535
|
-
/* @__PURE__ */
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
/* @__PURE__ */
|
|
4606
|
+
children: /* @__PURE__ */ jsx14(View12, { style: styles11.sheetPositioner, children: /* @__PURE__ */ jsxs12(View12, { style: [styles11.sheet, { backgroundColor: t.background }], children: [
|
|
4607
|
+
/* @__PURE__ */ jsx14(View12, { style: styles11.handleRow, children: /* @__PURE__ */ jsx14(View12, { style: [styles11.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4608
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.header, children: [
|
|
4609
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Create Pool" : "New Game" }),
|
|
4610
|
+
/* @__PURE__ */ jsx14(TouchableOpacity8, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx14(Text12, { style: [styles11.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4538
4611
|
] }),
|
|
4539
|
-
!isPoolModeEnabled && /* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4541
|
-
/* @__PURE__ */
|
|
4612
|
+
!isPoolModeEnabled && /* @__PURE__ */ jsxs12(View12, { style: styles11.section, children: [
|
|
4613
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.sectionLabel, { color: t.textSecondary }], children: "Buy-In Amount" }),
|
|
4614
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.chipsRow, children: [
|
|
4542
4615
|
presetAmounts.map((amount) => {
|
|
4543
4616
|
const active = !isCustom && selectedAmount === amount;
|
|
4544
|
-
return /* @__PURE__ */
|
|
4545
|
-
|
|
4617
|
+
return /* @__PURE__ */ jsx14(
|
|
4618
|
+
TouchableOpacity8,
|
|
4546
4619
|
{
|
|
4547
4620
|
style: [
|
|
4548
|
-
|
|
4621
|
+
styles11.chip,
|
|
4549
4622
|
{ borderColor: active ? t.accent : t.border },
|
|
4550
4623
|
active && { backgroundColor: t.accent }
|
|
4551
4624
|
],
|
|
4552
4625
|
onPress: () => handlePresetSelect(amount),
|
|
4553
4626
|
activeOpacity: 0.8,
|
|
4554
|
-
children: /* @__PURE__ */
|
|
4627
|
+
children: /* @__PURE__ */ jsxs12(Text12, { style: [styles11.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4555
4628
|
amount,
|
|
4556
4629
|
" SOL"
|
|
4557
4630
|
] })
|
|
@@ -4559,24 +4632,24 @@ function CreateCustomGameSheet({
|
|
|
4559
4632
|
amount
|
|
4560
4633
|
);
|
|
4561
4634
|
}),
|
|
4562
|
-
/* @__PURE__ */
|
|
4563
|
-
|
|
4635
|
+
/* @__PURE__ */ jsx14(
|
|
4636
|
+
TouchableOpacity8,
|
|
4564
4637
|
{
|
|
4565
4638
|
style: [
|
|
4566
|
-
|
|
4639
|
+
styles11.chip,
|
|
4567
4640
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4568
4641
|
isCustom && { backgroundColor: t.accent }
|
|
4569
4642
|
],
|
|
4570
4643
|
onPress: handleCustomSelect,
|
|
4571
4644
|
activeOpacity: 0.8,
|
|
4572
|
-
children: /* @__PURE__ */
|
|
4645
|
+
children: /* @__PURE__ */ jsx14(Text12, { style: [styles11.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4573
4646
|
}
|
|
4574
4647
|
)
|
|
4575
4648
|
] }),
|
|
4576
|
-
isCustom && /* @__PURE__ */
|
|
4649
|
+
isCustom && /* @__PURE__ */ jsx14(
|
|
4577
4650
|
TextInput2,
|
|
4578
4651
|
{
|
|
4579
|
-
style: [
|
|
4652
|
+
style: [styles11.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4580
4653
|
placeholder: "Enter amount in SOL",
|
|
4581
4654
|
placeholderTextColor: t.textDim,
|
|
4582
4655
|
keyboardType: "decimal-pad",
|
|
@@ -4586,43 +4659,43 @@ function CreateCustomGameSheet({
|
|
|
4586
4659
|
}
|
|
4587
4660
|
)
|
|
4588
4661
|
] }),
|
|
4589
|
-
/* @__PURE__ */
|
|
4590
|
-
/* @__PURE__ */
|
|
4591
|
-
/* @__PURE__ */
|
|
4592
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ jsxs12(View12, { style: [styles11.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4663
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.summaryRow, children: [
|
|
4664
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4665
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryValue, { color: t.text }], children: finalAmount ? `${finalAmount} SOL` : "\u2014" })
|
|
4593
4666
|
] }),
|
|
4594
|
-
/* @__PURE__ */
|
|
4595
|
-
/* @__PURE__ */
|
|
4596
|
-
/* @__PURE__ */
|
|
4597
|
-
/* @__PURE__ */
|
|
4667
|
+
/* @__PURE__ */ jsx14(View12, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4668
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.summaryRow, children: [
|
|
4669
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max players" : "Players" }),
|
|
4670
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryValue, { color: t.text }], children: isPoolModeEnabled ? playerCount : playersLabel })
|
|
4598
4671
|
] }),
|
|
4599
|
-
/* @__PURE__ */
|
|
4600
|
-
/* @__PURE__ */
|
|
4601
|
-
/* @__PURE__ */
|
|
4602
|
-
/* @__PURE__ */
|
|
4603
|
-
/* @__PURE__ */
|
|
4604
|
-
finalAmount ? /* @__PURE__ */
|
|
4672
|
+
/* @__PURE__ */ jsx14(View12, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4673
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.summaryRow, children: [
|
|
4674
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max pot" : "Winner Takes" }),
|
|
4675
|
+
/* @__PURE__ */ jsxs12(View12, { style: styles11.winnerCol, children: [
|
|
4676
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryValue, { color: t.success }], children: finalAmount ? `${(finalAmount * playerCount * (1 - fee / 100)).toFixed(4)} SOL` : "\u2014" }),
|
|
4677
|
+
finalAmount ? /* @__PURE__ */ jsxs12(Text12, { style: [styles11.feeNote, { color: t.textDim }], children: [
|
|
4605
4678
|
fee,
|
|
4606
4679
|
"% platform fee"
|
|
4607
4680
|
] }) : null
|
|
4608
4681
|
] })
|
|
4609
4682
|
] })
|
|
4610
4683
|
] }),
|
|
4611
|
-
mutation.error && /* @__PURE__ */
|
|
4612
|
-
/* @__PURE__ */
|
|
4613
|
-
|
|
4684
|
+
mutation.error && /* @__PURE__ */ jsx14(View12, { style: [styles11.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx14(Text12, { style: [styles11.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
4685
|
+
/* @__PURE__ */ jsx14(
|
|
4686
|
+
TouchableOpacity8,
|
|
4614
4687
|
{
|
|
4615
4688
|
style: [
|
|
4616
|
-
|
|
4689
|
+
styles11.ctaButton,
|
|
4617
4690
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4618
4691
|
],
|
|
4619
4692
|
disabled: !canCreate,
|
|
4620
4693
|
onPress: handleCreate,
|
|
4621
4694
|
activeOpacity: 0.8,
|
|
4622
|
-
children: isMutating ? /* @__PURE__ */
|
|
4623
|
-
/* @__PURE__ */
|
|
4624
|
-
/* @__PURE__ */
|
|
4625
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
4695
|
+
children: isMutating ? /* @__PURE__ */ jsxs12(View12, { style: styles11.ctaLoading, children: [
|
|
4696
|
+
/* @__PURE__ */ jsx14(ActivityIndicator6, { size: "small", color: "#FFFFFF" }),
|
|
4697
|
+
/* @__PURE__ */ jsx14(Text12, { style: styles11.ctaText, children: statusLabel })
|
|
4698
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx14(Text12, { style: styles11.ctaText, children: isPoolModeEnabled ? "Pool Created!" : STATUS_LABELS2.success }) : /* @__PURE__ */ jsx14(Text12, { style: [styles11.ctaText, !canCreate && { opacity: 0.5 }], children: isPoolModeEnabled ? `Create Pool \u2014 ${finalAmount} SOL` : effectiveAmount ? `Create Game \u2014 ${effectiveAmount} SOL` : "Select buy-in amount" })
|
|
4626
4699
|
}
|
|
4627
4700
|
)
|
|
4628
4701
|
] }) })
|
|
@@ -4632,9 +4705,9 @@ function CreateCustomGameSheet({
|
|
|
4632
4705
|
}
|
|
4633
4706
|
);
|
|
4634
4707
|
}
|
|
4635
|
-
var
|
|
4708
|
+
var styles11 = StyleSheet12.create({
|
|
4636
4709
|
overlay: {
|
|
4637
|
-
...
|
|
4710
|
+
...StyleSheet12.absoluteFillObject,
|
|
4638
4711
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4639
4712
|
},
|
|
4640
4713
|
overlayTap: {
|
|
@@ -4771,17 +4844,17 @@ var styles10 = StyleSheet11.create({
|
|
|
4771
4844
|
// src/ui/game/JoinGameSheet.tsx
|
|
4772
4845
|
import { useState as useState22, useEffect as useEffect14, useRef as useRef7, useCallback as useCallback18, useMemo as useMemo8 } from "react";
|
|
4773
4846
|
import {
|
|
4774
|
-
View as
|
|
4775
|
-
Text as
|
|
4776
|
-
TouchableOpacity as
|
|
4847
|
+
View as View13,
|
|
4848
|
+
Text as Text13,
|
|
4849
|
+
TouchableOpacity as TouchableOpacity9,
|
|
4777
4850
|
ActivityIndicator as ActivityIndicator7,
|
|
4778
4851
|
Modal as Modal3,
|
|
4779
4852
|
Animated as Animated4,
|
|
4780
|
-
StyleSheet as
|
|
4853
|
+
StyleSheet as StyleSheet13,
|
|
4781
4854
|
KeyboardAvoidingView as KeyboardAvoidingView4,
|
|
4782
4855
|
Platform as Platform7
|
|
4783
4856
|
} from "react-native";
|
|
4784
|
-
import { Fragment as Fragment4, jsx as
|
|
4857
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4785
4858
|
var STATUS_LABELS3 = {
|
|
4786
4859
|
building: "Building transaction...",
|
|
4787
4860
|
signing: "Approve in wallet...",
|
|
@@ -4872,7 +4945,7 @@ function JoinGameSheet({
|
|
|
4872
4945
|
}
|
|
4873
4946
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4874
4947
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4875
|
-
return /* @__PURE__ */
|
|
4948
|
+
return /* @__PURE__ */ jsxs13(
|
|
4876
4949
|
Modal3,
|
|
4877
4950
|
{
|
|
4878
4951
|
visible,
|
|
@@ -4880,22 +4953,22 @@ function JoinGameSheet({
|
|
|
4880
4953
|
transparent: true,
|
|
4881
4954
|
onRequestClose: onDismiss,
|
|
4882
4955
|
children: [
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
/* @__PURE__ */
|
|
4956
|
+
/* @__PURE__ */ jsx15(Animated4.View, { style: [styles12.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx15(TouchableOpacity9, { style: styles12.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4957
|
+
/* @__PURE__ */ jsx15(
|
|
4885
4958
|
KeyboardAvoidingView4,
|
|
4886
4959
|
{
|
|
4887
|
-
style:
|
|
4960
|
+
style: styles12.keyboardView,
|
|
4888
4961
|
behavior: Platform7.OS === "ios" ? "padding" : void 0,
|
|
4889
|
-
children: /* @__PURE__ */
|
|
4890
|
-
/* @__PURE__ */
|
|
4891
|
-
/* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
4962
|
+
children: /* @__PURE__ */ jsx15(View13, { style: styles12.sheetPositioner, children: /* @__PURE__ */ jsxs13(View13, { style: [styles12.sheet, { backgroundColor: t.background }], children: [
|
|
4963
|
+
/* @__PURE__ */ jsx15(View13, { style: styles12.handleRow, children: /* @__PURE__ */ jsx15(View13, { style: [styles12.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4964
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.header, children: [
|
|
4965
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
4966
|
+
/* @__PURE__ */ jsx15(TouchableOpacity9, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx15(Text13, { style: [styles12.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4894
4967
|
] }),
|
|
4895
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */
|
|
4896
|
-
/* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
4898
|
-
/* @__PURE__ */
|
|
4968
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ jsxs13(View13, { style: styles12.section, children: [
|
|
4969
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
4970
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.teamsRow, children: [
|
|
4971
|
+
/* @__PURE__ */ jsx15(
|
|
4899
4972
|
TeamButton,
|
|
4900
4973
|
{
|
|
4901
4974
|
name: homeName,
|
|
@@ -4909,7 +4982,7 @@ function JoinGameSheet({
|
|
|
4909
4982
|
t
|
|
4910
4983
|
}
|
|
4911
4984
|
),
|
|
4912
|
-
/* @__PURE__ */
|
|
4985
|
+
/* @__PURE__ */ jsx15(
|
|
4913
4986
|
TeamButton,
|
|
4914
4987
|
{
|
|
4915
4988
|
name: awayName,
|
|
@@ -4925,64 +4998,64 @@ function JoinGameSheet({
|
|
|
4925
4998
|
)
|
|
4926
4999
|
] })
|
|
4927
5000
|
] }),
|
|
4928
|
-
/* @__PURE__ */
|
|
4929
|
-
/* @__PURE__ */
|
|
4930
|
-
/* @__PURE__ */
|
|
4931
|
-
/* @__PURE__ */
|
|
5001
|
+
/* @__PURE__ */ jsxs13(View13, { style: [styles12.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5002
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5003
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5004
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
4932
5005
|
buyIn,
|
|
4933
5006
|
" SOL"
|
|
4934
5007
|
] })
|
|
4935
5008
|
] }),
|
|
4936
|
-
/* @__PURE__ */
|
|
4937
|
-
isPoolModeEnabled ? /* @__PURE__ */
|
|
4938
|
-
/* @__PURE__ */
|
|
4939
|
-
/* @__PURE__ */
|
|
4940
|
-
/* @__PURE__ */
|
|
5009
|
+
/* @__PURE__ */ jsx15(View13, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5010
|
+
isPoolModeEnabled ? /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5011
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5012
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5013
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryValue, { color: t.text }], children: bettors.length })
|
|
4941
5014
|
] }),
|
|
4942
|
-
/* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
4944
|
-
/* @__PURE__ */
|
|
4945
|
-
/* @__PURE__ */
|
|
5015
|
+
/* @__PURE__ */ jsx15(View13, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5016
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5017
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5018
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.summaryValue, { color: t.success }], children: [
|
|
4946
5019
|
totalPool,
|
|
4947
5020
|
" SOL"
|
|
4948
5021
|
] })
|
|
4949
5022
|
] })
|
|
4950
|
-
] }) : /* @__PURE__ */
|
|
4951
|
-
/* @__PURE__ */
|
|
4952
|
-
/* @__PURE__ */
|
|
4953
|
-
/* @__PURE__ */
|
|
5023
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
5024
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5025
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5026
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryValue, { color: t.text }], children: selectedName })
|
|
4954
5027
|
] }),
|
|
4955
|
-
/* @__PURE__ */
|
|
4956
|
-
/* @__PURE__ */
|
|
4957
|
-
/* @__PURE__ */
|
|
4958
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsx15(View13, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5029
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5030
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5031
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
4959
5032
|
poolAfterJoin,
|
|
4960
5033
|
" SOL"
|
|
4961
5034
|
] })
|
|
4962
5035
|
] }),
|
|
4963
|
-
/* @__PURE__ */
|
|
4964
|
-
/* @__PURE__ */
|
|
4965
|
-
/* @__PURE__ */
|
|
4966
|
-
/* @__PURE__ */
|
|
5036
|
+
/* @__PURE__ */ jsx15(View13, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5037
|
+
/* @__PURE__ */ jsxs13(View13, { style: styles12.summaryRow, children: [
|
|
5038
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5039
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
4967
5040
|
] })
|
|
4968
5041
|
] })
|
|
4969
5042
|
] }),
|
|
4970
|
-
alreadyJoined && /* @__PURE__ */
|
|
4971
|
-
mutation.error && /* @__PURE__ */
|
|
4972
|
-
/* @__PURE__ */
|
|
4973
|
-
|
|
5043
|
+
alreadyJoined && /* @__PURE__ */ jsx15(View13, { style: [styles12.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ jsx15(Text13, { style: [styles12.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5044
|
+
mutation.error && /* @__PURE__ */ jsx15(View13, { style: [styles12.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx15(Text13, { style: [styles12.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5045
|
+
/* @__PURE__ */ jsx15(
|
|
5046
|
+
TouchableOpacity9,
|
|
4974
5047
|
{
|
|
4975
5048
|
style: [
|
|
4976
|
-
|
|
5049
|
+
styles12.ctaButton,
|
|
4977
5050
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
4978
5051
|
],
|
|
4979
5052
|
disabled: !canJoin,
|
|
4980
5053
|
onPress: handleJoin,
|
|
4981
5054
|
activeOpacity: 0.8,
|
|
4982
|
-
children: isMutating ? /* @__PURE__ */
|
|
4983
|
-
/* @__PURE__ */
|
|
4984
|
-
/* @__PURE__ */
|
|
4985
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
5055
|
+
children: isMutating ? /* @__PURE__ */ jsxs13(View13, { style: styles12.ctaLoading, children: [
|
|
5056
|
+
/* @__PURE__ */ jsx15(ActivityIndicator7, { size: "small", color: "#FFFFFF" }),
|
|
5057
|
+
/* @__PURE__ */ jsx15(Text13, { style: styles12.ctaText, children: statusLabel })
|
|
5058
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx15(Text13, { style: styles12.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ jsx15(Text13, { 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" })
|
|
4986
5059
|
}
|
|
4987
5060
|
)
|
|
4988
5061
|
] }) })
|
|
@@ -5006,32 +5079,32 @@ function TeamButton({
|
|
|
5006
5079
|
const [imgFailed, setImgFailed] = useState22(false);
|
|
5007
5080
|
const Img = ImageComponent || __require("react-native").Image;
|
|
5008
5081
|
const showImage = imageUrl && !imgFailed;
|
|
5009
|
-
return /* @__PURE__ */
|
|
5010
|
-
|
|
5082
|
+
return /* @__PURE__ */ jsxs13(
|
|
5083
|
+
TouchableOpacity9,
|
|
5011
5084
|
{
|
|
5012
|
-
style: [
|
|
5085
|
+
style: [styles12.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5013
5086
|
onPress,
|
|
5014
5087
|
activeOpacity: 0.7,
|
|
5015
5088
|
children: [
|
|
5016
|
-
showImage ? /* @__PURE__ */
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5089
|
+
showImage ? /* @__PURE__ */ jsx15(Img, { source: { uri: imageUrl }, style: styles12.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx15(View13, { style: [styles12.teamLogo, styles12.teamLogoPlaceholder] }),
|
|
5090
|
+
/* @__PURE__ */ jsx15(Text13, { style: [styles12.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5091
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.teamOdds, { color }], children: [
|
|
5019
5092
|
odds,
|
|
5020
5093
|
"x"
|
|
5021
5094
|
] }),
|
|
5022
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.teamBets, { color: t.textMuted }], children: [
|
|
5023
5096
|
bets,
|
|
5024
5097
|
" ",
|
|
5025
5098
|
bets === 1 ? "bet" : "bets"
|
|
5026
5099
|
] }),
|
|
5027
|
-
selected && /* @__PURE__ */
|
|
5100
|
+
selected && /* @__PURE__ */ jsx15(View13, { style: [styles12.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ jsx15(Text13, { style: styles12.teamBadgeText, children: "Selected" }) })
|
|
5028
5101
|
]
|
|
5029
5102
|
}
|
|
5030
5103
|
);
|
|
5031
5104
|
}
|
|
5032
|
-
var
|
|
5105
|
+
var styles12 = StyleSheet13.create({
|
|
5033
5106
|
overlay: {
|
|
5034
|
-
...
|
|
5107
|
+
...StyleSheet13.absoluteFillObject,
|
|
5035
5108
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5036
5109
|
},
|
|
5037
5110
|
overlayTap: {
|
|
@@ -5182,17 +5255,17 @@ var styles11 = StyleSheet12.create({
|
|
|
5182
5255
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5183
5256
|
import { useState as useState23, useEffect as useEffect15, useRef as useRef8, useCallback as useCallback19 } from "react";
|
|
5184
5257
|
import {
|
|
5185
|
-
View as
|
|
5186
|
-
Text as
|
|
5187
|
-
TouchableOpacity as
|
|
5258
|
+
View as View14,
|
|
5259
|
+
Text as Text14,
|
|
5260
|
+
TouchableOpacity as TouchableOpacity10,
|
|
5188
5261
|
ActivityIndicator as ActivityIndicator8,
|
|
5189
5262
|
Modal as Modal4,
|
|
5190
5263
|
Animated as Animated5,
|
|
5191
|
-
StyleSheet as
|
|
5264
|
+
StyleSheet as StyleSheet14,
|
|
5192
5265
|
KeyboardAvoidingView as KeyboardAvoidingView5,
|
|
5193
5266
|
Platform as Platform8
|
|
5194
5267
|
} from "react-native";
|
|
5195
|
-
import { jsx as
|
|
5268
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5196
5269
|
var STATUS_LABELS4 = {
|
|
5197
5270
|
building: "Building transaction...",
|
|
5198
5271
|
signing: "Approve in wallet...",
|
|
@@ -5272,7 +5345,7 @@ function ClaimPrizeSheet({
|
|
|
5272
5345
|
}
|
|
5273
5346
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5274
5347
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5275
|
-
return /* @__PURE__ */
|
|
5348
|
+
return /* @__PURE__ */ jsxs14(
|
|
5276
5349
|
Modal4,
|
|
5277
5350
|
{
|
|
5278
5351
|
visible,
|
|
@@ -5280,54 +5353,54 @@ function ClaimPrizeSheet({
|
|
|
5280
5353
|
transparent: true,
|
|
5281
5354
|
onRequestClose: onDismiss,
|
|
5282
5355
|
children: [
|
|
5283
|
-
/* @__PURE__ */
|
|
5284
|
-
/* @__PURE__ */
|
|
5356
|
+
/* @__PURE__ */ jsx16(Animated5.View, { style: [styles13.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx16(TouchableOpacity10, { style: styles13.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5357
|
+
/* @__PURE__ */ jsx16(
|
|
5285
5358
|
KeyboardAvoidingView5,
|
|
5286
5359
|
{
|
|
5287
|
-
style:
|
|
5360
|
+
style: styles13.keyboardView,
|
|
5288
5361
|
behavior: Platform8.OS === "ios" ? "padding" : void 0,
|
|
5289
|
-
children: /* @__PURE__ */
|
|
5290
|
-
/* @__PURE__ */
|
|
5291
|
-
/* @__PURE__ */
|
|
5292
|
-
/* @__PURE__ */
|
|
5293
|
-
/* @__PURE__ */
|
|
5362
|
+
children: /* @__PURE__ */ jsx16(View14, { style: styles13.sheetPositioner, children: /* @__PURE__ */ jsxs14(View14, { style: [styles13.sheet, { backgroundColor: t.background }], children: [
|
|
5363
|
+
/* @__PURE__ */ jsx16(View14, { style: styles13.handleRow, children: /* @__PURE__ */ jsx16(View14, { style: [styles13.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5364
|
+
/* @__PURE__ */ jsxs14(View14, { style: styles13.header, children: [
|
|
5365
|
+
/* @__PURE__ */ jsx16(Text14, { style: [styles13.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
5366
|
+
/* @__PURE__ */ jsx16(TouchableOpacity10, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx16(Text14, { style: [styles13.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5294
5367
|
] }),
|
|
5295
|
-
showCelebration && /* @__PURE__ */
|
|
5368
|
+
showCelebration && /* @__PURE__ */ jsxs14(
|
|
5296
5369
|
Animated5.View,
|
|
5297
5370
|
{
|
|
5298
5371
|
style: [
|
|
5299
|
-
|
|
5372
|
+
styles13.celebrationContainer,
|
|
5300
5373
|
{
|
|
5301
5374
|
opacity: celebrationOpacity,
|
|
5302
5375
|
transform: [{ scale: celebrationScale }]
|
|
5303
5376
|
}
|
|
5304
5377
|
],
|
|
5305
5378
|
children: [
|
|
5306
|
-
/* @__PURE__ */
|
|
5307
|
-
/* @__PURE__ */
|
|
5379
|
+
/* @__PURE__ */ jsx16(Text14, { style: styles13.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5380
|
+
/* @__PURE__ */ jsxs14(Text14, { style: [styles13.celebrationText, { color: t.success }], children: [
|
|
5308
5381
|
"+",
|
|
5309
5382
|
prizeAmount,
|
|
5310
5383
|
" SOL"
|
|
5311
5384
|
] }),
|
|
5312
|
-
/* @__PURE__ */
|
|
5385
|
+
/* @__PURE__ */ jsx16(Text14, { style: [styles13.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5313
5386
|
]
|
|
5314
5387
|
}
|
|
5315
5388
|
),
|
|
5316
|
-
!showCelebration && /* @__PURE__ */
|
|
5317
|
-
/* @__PURE__ */
|
|
5318
|
-
/* @__PURE__ */
|
|
5319
|
-
/* @__PURE__ */
|
|
5389
|
+
!showCelebration && /* @__PURE__ */ jsxs14(View14, { style: [styles13.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5390
|
+
/* @__PURE__ */ jsxs14(View14, { style: styles13.summaryRow, children: [
|
|
5391
|
+
/* @__PURE__ */ jsx16(Text14, { style: [styles13.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
5392
|
+
/* @__PURE__ */ jsxs14(Text14, { style: [styles13.summaryValue, { color: t.success }], children: [
|
|
5320
5393
|
prizeAmount,
|
|
5321
5394
|
" SOL"
|
|
5322
5395
|
] })
|
|
5323
5396
|
] }),
|
|
5324
|
-
/* @__PURE__ */
|
|
5325
|
-
/* @__PURE__ */
|
|
5326
|
-
/* @__PURE__ */
|
|
5327
|
-
/* @__PURE__ */
|
|
5328
|
-
|
|
5397
|
+
/* @__PURE__ */ jsx16(View14, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5398
|
+
/* @__PURE__ */ jsxs14(View14, { style: styles13.summaryRow, children: [
|
|
5399
|
+
/* @__PURE__ */ jsx16(Text14, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
5400
|
+
/* @__PURE__ */ jsxs14(
|
|
5401
|
+
Text14,
|
|
5329
5402
|
{
|
|
5330
|
-
style: [
|
|
5403
|
+
style: [styles13.summaryValue, { color: t.text }],
|
|
5331
5404
|
numberOfLines: 1,
|
|
5332
5405
|
children: [
|
|
5333
5406
|
gameId.slice(0, 8),
|
|
@@ -5338,21 +5411,21 @@ function ClaimPrizeSheet({
|
|
|
5338
5411
|
)
|
|
5339
5412
|
] })
|
|
5340
5413
|
] }),
|
|
5341
|
-
mutation.error && /* @__PURE__ */
|
|
5342
|
-
!showCelebration && /* @__PURE__ */
|
|
5343
|
-
|
|
5414
|
+
mutation.error && /* @__PURE__ */ jsx16(View14, { style: [styles13.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx16(Text14, { style: [styles13.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5415
|
+
!showCelebration && /* @__PURE__ */ jsx16(
|
|
5416
|
+
TouchableOpacity10,
|
|
5344
5417
|
{
|
|
5345
5418
|
style: [
|
|
5346
|
-
|
|
5419
|
+
styles13.ctaButton,
|
|
5347
5420
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5348
5421
|
],
|
|
5349
5422
|
disabled: !canClaim,
|
|
5350
5423
|
onPress: handleClaim,
|
|
5351
5424
|
activeOpacity: 0.8,
|
|
5352
|
-
children: isMutating ? /* @__PURE__ */
|
|
5353
|
-
/* @__PURE__ */
|
|
5354
|
-
/* @__PURE__ */
|
|
5355
|
-
] }) : /* @__PURE__ */
|
|
5425
|
+
children: isMutating ? /* @__PURE__ */ jsxs14(View14, { style: styles13.ctaLoading, children: [
|
|
5426
|
+
/* @__PURE__ */ jsx16(ActivityIndicator8, { size: "small", color: "#FFFFFF" }),
|
|
5427
|
+
/* @__PURE__ */ jsx16(Text14, { style: styles13.ctaText, children: statusLabel })
|
|
5428
|
+
] }) : /* @__PURE__ */ jsxs14(Text14, { style: [styles13.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
5356
5429
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5357
5430
|
" \u2014 ",
|
|
5358
5431
|
prizeAmount,
|
|
@@ -5360,7 +5433,7 @@ function ClaimPrizeSheet({
|
|
|
5360
5433
|
] })
|
|
5361
5434
|
}
|
|
5362
5435
|
),
|
|
5363
|
-
mutation.data?.explorerUrl && /* @__PURE__ */
|
|
5436
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ jsx16(Text14, { style: [styles13.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5364
5437
|
] }) })
|
|
5365
5438
|
}
|
|
5366
5439
|
)
|
|
@@ -5368,9 +5441,9 @@ function ClaimPrizeSheet({
|
|
|
5368
5441
|
}
|
|
5369
5442
|
);
|
|
5370
5443
|
}
|
|
5371
|
-
var
|
|
5444
|
+
var styles13 = StyleSheet14.create({
|
|
5372
5445
|
overlay: {
|
|
5373
|
-
...
|
|
5446
|
+
...StyleSheet14.absoluteFillObject,
|
|
5374
5447
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5375
5448
|
},
|
|
5376
5449
|
overlayTap: {
|
|
@@ -5494,8 +5567,8 @@ var styles12 = StyleSheet13.create({
|
|
|
5494
5567
|
|
|
5495
5568
|
// src/ui/game/ClaimButton.tsx
|
|
5496
5569
|
import { useState as useState24, useMemo as useMemo9, useCallback as useCallback20 } from "react";
|
|
5497
|
-
import { StyleSheet as
|
|
5498
|
-
import { Fragment as Fragment5, jsx as
|
|
5570
|
+
import { StyleSheet as StyleSheet15, Text as Text15, TouchableOpacity as TouchableOpacity11 } from "react-native";
|
|
5571
|
+
import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5499
5572
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5500
5573
|
const t = useDubsTheme();
|
|
5501
5574
|
const { wallet } = useDubs();
|
|
@@ -5525,13 +5598,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5525
5598
|
}
|
|
5526
5599
|
const label = isRefund ? "Refund" : "Prize";
|
|
5527
5600
|
if (claimStatus.hasClaimed) {
|
|
5528
|
-
return /* @__PURE__ */
|
|
5529
|
-
|
|
5601
|
+
return /* @__PURE__ */ jsx17(
|
|
5602
|
+
TouchableOpacity11,
|
|
5530
5603
|
{
|
|
5531
|
-
style: [
|
|
5604
|
+
style: [styles14.badge, { borderColor: t.accent }, style],
|
|
5532
5605
|
activeOpacity: 1,
|
|
5533
5606
|
disabled: true,
|
|
5534
|
-
children: /* @__PURE__ */
|
|
5607
|
+
children: /* @__PURE__ */ jsxs15(Text15, { style: [styles14.badgeText, { color: t.accent }], children: [
|
|
5535
5608
|
label,
|
|
5536
5609
|
" Claimed!"
|
|
5537
5610
|
] })
|
|
@@ -5541,14 +5614,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5541
5614
|
if (!isEligible) {
|
|
5542
5615
|
return null;
|
|
5543
5616
|
}
|
|
5544
|
-
return /* @__PURE__ */
|
|
5545
|
-
/* @__PURE__ */
|
|
5546
|
-
|
|
5617
|
+
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
5618
|
+
/* @__PURE__ */ jsx17(
|
|
5619
|
+
TouchableOpacity11,
|
|
5547
5620
|
{
|
|
5548
|
-
style: [
|
|
5621
|
+
style: [styles14.button, { backgroundColor: t.accent }, style],
|
|
5549
5622
|
activeOpacity: 0.8,
|
|
5550
5623
|
onPress: () => setSheetVisible(true),
|
|
5551
|
-
children: /* @__PURE__ */
|
|
5624
|
+
children: /* @__PURE__ */ jsxs15(Text15, { style: styles14.buttonText, children: [
|
|
5552
5625
|
"Claim ",
|
|
5553
5626
|
label,
|
|
5554
5627
|
" \u2014 ",
|
|
@@ -5557,7 +5630,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5557
5630
|
] })
|
|
5558
5631
|
}
|
|
5559
5632
|
),
|
|
5560
|
-
/* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsx17(
|
|
5561
5634
|
ClaimPrizeSheet,
|
|
5562
5635
|
{
|
|
5563
5636
|
visible: sheetVisible,
|
|
@@ -5571,7 +5644,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5571
5644
|
)
|
|
5572
5645
|
] });
|
|
5573
5646
|
}
|
|
5574
|
-
var
|
|
5647
|
+
var styles14 = StyleSheet15.create({
|
|
5575
5648
|
button: {
|
|
5576
5649
|
height: 52,
|
|
5577
5650
|
borderRadius: 14,
|