@dubsdotapp/expo 0.2.77 → 0.2.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +656 -671
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +638 -646
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/AuthGate.tsx +12 -52
- package/src/ui/AvatarEditor.tsx +159 -0
- package/src/ui/UserProfileSheet.tsx +18 -138
package/dist/index.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",
|
|
@@ -2499,6 +2507,125 @@ function generateSeed() {
|
|
|
2499
2507
|
function getAvatarUrl(style, seed, bg = "1a1a2e", size = 256) {
|
|
2500
2508
|
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
2501
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
|
+
] });
|
|
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";
|
|
2502
2629
|
function AuthGate({
|
|
2503
2630
|
children,
|
|
2504
2631
|
onSaveToken,
|
|
@@ -2565,12 +2692,12 @@ function AuthGate({
|
|
|
2565
2692
|
[auth]
|
|
2566
2693
|
);
|
|
2567
2694
|
if (phase === "init") {
|
|
2568
|
-
if (renderLoading) return /* @__PURE__ */
|
|
2569
|
-
return /* @__PURE__ */
|
|
2695
|
+
if (renderLoading) return /* @__PURE__ */ jsx4(Fragment2, { children: renderLoading("authenticating") });
|
|
2696
|
+
return /* @__PURE__ */ jsx4(DefaultLoadingScreen, { status: "authenticating", appName, accentColor });
|
|
2570
2697
|
}
|
|
2571
2698
|
if (auth.status === "authenticated") {
|
|
2572
2699
|
if (showPushSetup) {
|
|
2573
|
-
return /* @__PURE__ */
|
|
2700
|
+
return /* @__PURE__ */ jsx4(
|
|
2574
2701
|
PushSetupScreen,
|
|
2575
2702
|
{
|
|
2576
2703
|
accentColor,
|
|
@@ -2579,8 +2706,8 @@ function AuthGate({
|
|
|
2579
2706
|
}
|
|
2580
2707
|
);
|
|
2581
2708
|
}
|
|
2582
|
-
return /* @__PURE__ */
|
|
2583
|
-
pushEnabled && /* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ jsxs3(AuthContext.Provider, { value: auth, children: [
|
|
2710
|
+
pushEnabled && /* @__PURE__ */ jsx4(PushTokenRestorer, {}),
|
|
2584
2711
|
children
|
|
2585
2712
|
] });
|
|
2586
2713
|
}
|
|
@@ -2588,9 +2715,9 @@ function AuthGate({
|
|
|
2588
2715
|
const isRegistering = auth.status === "registering";
|
|
2589
2716
|
const regError = auth.status === "error" ? auth.error : null;
|
|
2590
2717
|
if (renderRegistration) {
|
|
2591
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ jsx4(Fragment2, { children: renderRegistration({ onRegister: handleRegister, registering: isRegistering, error: regError, client }) });
|
|
2592
2719
|
}
|
|
2593
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx4(
|
|
2594
2721
|
DefaultRegistrationScreen,
|
|
2595
2722
|
{
|
|
2596
2723
|
onRegister: handleRegister,
|
|
@@ -2603,11 +2730,11 @@ function AuthGate({
|
|
|
2603
2730
|
);
|
|
2604
2731
|
}
|
|
2605
2732
|
if (auth.status === "error" && auth.error) {
|
|
2606
|
-
if (renderError) return /* @__PURE__ */
|
|
2607
|
-
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 });
|
|
2608
2735
|
}
|
|
2609
|
-
if (renderLoading) return /* @__PURE__ */
|
|
2610
|
-
return /* @__PURE__ */
|
|
2736
|
+
if (renderLoading) return /* @__PURE__ */ jsx4(Fragment2, { children: renderLoading(auth.status) });
|
|
2737
|
+
return /* @__PURE__ */ jsx4(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
2611
2738
|
}
|
|
2612
2739
|
function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
2613
2740
|
const t = useDubsTheme();
|
|
@@ -2622,44 +2749,44 @@ function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
|
2622
2749
|
authenticated: "Ready!",
|
|
2623
2750
|
error: "Something went wrong"
|
|
2624
2751
|
};
|
|
2625
|
-
return /* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2628
|
-
/* @__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 })
|
|
2629
2756
|
] }),
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__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..." })
|
|
2633
2760
|
] })
|
|
2634
2761
|
] }) });
|
|
2635
2762
|
}
|
|
2636
2763
|
function DefaultErrorScreen({ error, onRetry, appName, accentColor }) {
|
|
2637
2764
|
const t = useDubsTheme();
|
|
2638
2765
|
const accent = accentColor || t.accent;
|
|
2639
|
-
return /* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2642
|
-
/* @__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 })
|
|
2643
2770
|
] }),
|
|
2644
|
-
/* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
/* @__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" }) })
|
|
2647
2774
|
] })
|
|
2648
2775
|
] }) });
|
|
2649
2776
|
}
|
|
2650
2777
|
function StepIndicator({ currentStep }) {
|
|
2651
2778
|
const t = useDubsTheme();
|
|
2652
2779
|
const steps = [0, 1, 2, 3];
|
|
2653
|
-
return /* @__PURE__ */
|
|
2654
|
-
i > 0 && /* @__PURE__ */
|
|
2655
|
-
/* @__PURE__ */
|
|
2656
|
-
|
|
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,
|
|
2657
2784
|
{
|
|
2658
2785
|
style: [
|
|
2659
2786
|
s.stepCircle,
|
|
2660
2787
|
i < currentStep ? { backgroundColor: t.success } : i === currentStep ? { backgroundColor: t.accent } : { backgroundColor: "transparent", borderWidth: 2, borderColor: t.border }
|
|
2661
2788
|
],
|
|
2662
|
-
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 })
|
|
2663
2790
|
}
|
|
2664
2791
|
)
|
|
2665
2792
|
] }, i)) });
|
|
@@ -2730,88 +2857,76 @@ function DefaultRegistrationScreen({
|
|
|
2730
2857
|
Keyboard.dismiss();
|
|
2731
2858
|
onRegister(username.trim(), referralCode.trim() || void 0, avatarUrl);
|
|
2732
2859
|
};
|
|
2733
|
-
const renderAvatarStep = () => /* @__PURE__ */
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
-
/* @__PURE__ */
|
|
2736
|
-
/* @__PURE__ */
|
|
2737
|
-
/* @__PURE__ */
|
|
2738
|
-
/* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
/* @__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" }) })
|
|
2741
2868
|
] }) }),
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
|
|
2869
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.avatarActions, children: [
|
|
2870
|
+
/* @__PURE__ */ jsx4(
|
|
2871
|
+
TouchableOpacity3,
|
|
2745
2872
|
{
|
|
2746
2873
|
style: [s.outlineBtn, { borderColor: t.border }],
|
|
2747
2874
|
onPress: () => setAvatarSeed(generateSeed()),
|
|
2748
2875
|
activeOpacity: 0.7,
|
|
2749
|
-
children: /* @__PURE__ */
|
|
2876
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.outlineBtnText, { color: t.text }], children: "\u21BB Shuffle" })
|
|
2750
2877
|
}
|
|
2751
2878
|
),
|
|
2752
|
-
/* @__PURE__ */
|
|
2753
|
-
|
|
2879
|
+
/* @__PURE__ */ jsx4(
|
|
2880
|
+
TouchableOpacity3,
|
|
2754
2881
|
{
|
|
2755
2882
|
style: [s.outlineBtn, { borderColor: accent, backgroundColor: accent + "15" }],
|
|
2756
2883
|
onPress: () => setShowStyles(!showStyles),
|
|
2757
2884
|
activeOpacity: 0.7,
|
|
2758
|
-
children: /* @__PURE__ */
|
|
2885
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.outlineBtnText, { color: accent }], children: "\u263A Customize" })
|
|
2759
2886
|
}
|
|
2760
2887
|
)
|
|
2761
2888
|
] }),
|
|
2762
|
-
showStyles && /* @__PURE__ */
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
TouchableOpacity2,
|
|
2775
|
-
{
|
|
2776
|
-
onPress: () => setAvatarBg(color),
|
|
2777
|
-
style: [
|
|
2778
|
-
s.colorSwatch,
|
|
2779
|
-
{ backgroundColor: `#${color}` },
|
|
2780
|
-
color === avatarBg && { borderColor: accent, borderWidth: 2.5 }
|
|
2781
|
-
]
|
|
2782
|
-
},
|
|
2783
|
-
color
|
|
2784
|
-
)) })
|
|
2785
|
-
] })
|
|
2889
|
+
showStyles && /* @__PURE__ */ jsx4(View3, { style: s.styleScroll, children: /* @__PURE__ */ jsx4(
|
|
2890
|
+
AvatarEditor,
|
|
2891
|
+
{
|
|
2892
|
+
style: avatarStyle,
|
|
2893
|
+
seed: avatarSeed,
|
|
2894
|
+
bg: avatarBg,
|
|
2895
|
+
onStyleChange: setAvatarStyle,
|
|
2896
|
+
onSeedChange: setAvatarSeed,
|
|
2897
|
+
onBgChange: setAvatarBg,
|
|
2898
|
+
accentColor: accent
|
|
2899
|
+
}
|
|
2900
|
+
) })
|
|
2786
2901
|
] }),
|
|
2787
|
-
/* @__PURE__ */
|
|
2788
|
-
|
|
2902
|
+
/* @__PURE__ */ jsx4(View3, { style: s.bottomRow, children: /* @__PURE__ */ jsx4(
|
|
2903
|
+
TouchableOpacity3,
|
|
2789
2904
|
{
|
|
2790
2905
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1 }],
|
|
2791
2906
|
onPress: () => animateToStep(1),
|
|
2792
2907
|
activeOpacity: 0.8,
|
|
2793
|
-
children: /* @__PURE__ */
|
|
2908
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2794
2909
|
}
|
|
2795
2910
|
) })
|
|
2796
2911
|
] });
|
|
2797
|
-
const renderUsernameStep = () => /* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2800
|
-
/* @__PURE__ */
|
|
2801
|
-
/* @__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" })
|
|
2802
2917
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */
|
|
2806
|
-
/* @__PURE__ */
|
|
2807
|
-
/* @__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" }) })
|
|
2808
2923
|
] }) }),
|
|
2809
|
-
/* @__PURE__ */
|
|
2810
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.inputGroup, children: [
|
|
2925
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2811
2926
|
"Username ",
|
|
2812
|
-
/* @__PURE__ */
|
|
2927
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: t.errorText }, children: "*" })
|
|
2813
2928
|
] }),
|
|
2814
|
-
/* @__PURE__ */
|
|
2929
|
+
/* @__PURE__ */ jsx4(
|
|
2815
2930
|
TextInput,
|
|
2816
2931
|
{
|
|
2817
2932
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: accent }],
|
|
@@ -2824,62 +2939,62 @@ function DefaultRegistrationScreen({
|
|
|
2824
2939
|
autoFocus: true
|
|
2825
2940
|
}
|
|
2826
2941
|
),
|
|
2827
|
-
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
|
|
2828
2943
|
] })
|
|
2829
2944
|
] }),
|
|
2830
|
-
/* @__PURE__ */
|
|
2831
|
-
/* @__PURE__ */
|
|
2832
|
-
|
|
2945
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
2946
|
+
/* @__PURE__ */ jsx4(
|
|
2947
|
+
TouchableOpacity3,
|
|
2833
2948
|
{
|
|
2834
2949
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2835
2950
|
onPress: () => animateToStep(0),
|
|
2836
2951
|
activeOpacity: 0.7,
|
|
2837
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2838
2953
|
}
|
|
2839
2954
|
),
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
|
|
2955
|
+
/* @__PURE__ */ jsx4(
|
|
2956
|
+
TouchableOpacity3,
|
|
2842
2957
|
{
|
|
2843
2958
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: canContinueUsername ? 1 : 0.4 }],
|
|
2844
2959
|
onPress: () => animateToStep(2),
|
|
2845
2960
|
disabled: !canContinueUsername,
|
|
2846
2961
|
activeOpacity: 0.8,
|
|
2847
|
-
children: /* @__PURE__ */
|
|
2962
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2848
2963
|
}
|
|
2849
2964
|
)
|
|
2850
2965
|
] })
|
|
2851
2966
|
] });
|
|
2852
|
-
const renderReferralStep = () => /* @__PURE__ */
|
|
2853
|
-
/* @__PURE__ */
|
|
2854
|
-
/* @__PURE__ */
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
/* @__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!" })
|
|
2857
2972
|
] }),
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2861
|
-
/* @__PURE__ */
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
2865
|
-
/* @__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: [
|
|
2866
2981
|
"@",
|
|
2867
2982
|
username
|
|
2868
2983
|
] }),
|
|
2869
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.profileReady, { color: t.success }], children: [
|
|
2870
2985
|
"\u2713",
|
|
2871
2986
|
" Ready to go!"
|
|
2872
2987
|
] })
|
|
2873
2988
|
] })
|
|
2874
2989
|
] })
|
|
2875
2990
|
] }),
|
|
2876
|
-
error ? /* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
/* @__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: [
|
|
2879
2994
|
"Referral Code ",
|
|
2880
|
-
/* @__PURE__ */
|
|
2995
|
+
/* @__PURE__ */ jsx4(Text3, { style: { color: t.textMuted }, children: "(optional)" })
|
|
2881
2996
|
] }),
|
|
2882
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsx4(
|
|
2883
2998
|
TextInput,
|
|
2884
2999
|
{
|
|
2885
3000
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: t.border }],
|
|
@@ -2892,31 +3007,31 @@ function DefaultRegistrationScreen({
|
|
|
2892
3007
|
editable: !registering
|
|
2893
3008
|
}
|
|
2894
3009
|
),
|
|
2895
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsxs3(Text3, { style: [s.hint, { color: t.textMuted }], children: [
|
|
2896
3011
|
"\u{1F381}",
|
|
2897
3012
|
" If a friend invited you, enter their code to give them credit!"
|
|
2898
3013
|
] })
|
|
2899
3014
|
] })
|
|
2900
3015
|
] }),
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2903
|
-
|
|
3016
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
3017
|
+
/* @__PURE__ */ jsx4(
|
|
3018
|
+
TouchableOpacity3,
|
|
2904
3019
|
{
|
|
2905
3020
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2906
3021
|
onPress: () => animateToStep(1),
|
|
2907
3022
|
disabled: registering,
|
|
2908
3023
|
activeOpacity: 0.7,
|
|
2909
|
-
children: /* @__PURE__ */
|
|
3024
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2910
3025
|
}
|
|
2911
3026
|
),
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
|
|
3027
|
+
/* @__PURE__ */ jsx4(
|
|
3028
|
+
TouchableOpacity3,
|
|
2914
3029
|
{
|
|
2915
3030
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: registering ? 0.7 : 1 }],
|
|
2916
3031
|
onPress: handleSubmit,
|
|
2917
3032
|
disabled: registering,
|
|
2918
3033
|
activeOpacity: 0.8,
|
|
2919
|
-
children: registering ? /* @__PURE__ */
|
|
3034
|
+
children: registering ? /* @__PURE__ */ jsx4(ActivityIndicator2, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Create Account" })
|
|
2920
3035
|
}
|
|
2921
3036
|
)
|
|
2922
3037
|
] })
|
|
@@ -2933,18 +3048,18 @@ function DefaultRegistrationScreen({
|
|
|
2933
3048
|
return null;
|
|
2934
3049
|
}
|
|
2935
3050
|
};
|
|
2936
|
-
return /* @__PURE__ */
|
|
3051
|
+
return /* @__PURE__ */ jsx4(
|
|
2937
3052
|
KeyboardAvoidingView,
|
|
2938
3053
|
{
|
|
2939
3054
|
style: [s.container, { backgroundColor: t.background }],
|
|
2940
3055
|
behavior: Platform4.OS === "ios" ? "padding" : void 0,
|
|
2941
|
-
children: /* @__PURE__ */
|
|
2942
|
-
|
|
3056
|
+
children: /* @__PURE__ */ jsx4(
|
|
3057
|
+
ScrollView2,
|
|
2943
3058
|
{
|
|
2944
3059
|
contentContainerStyle: { flexGrow: 1 },
|
|
2945
3060
|
keyboardShouldPersistTaps: "handled",
|
|
2946
3061
|
bounces: false,
|
|
2947
|
-
children: /* @__PURE__ */
|
|
3062
|
+
children: /* @__PURE__ */ jsx4(
|
|
2948
3063
|
Animated.View,
|
|
2949
3064
|
{
|
|
2950
3065
|
style: [
|
|
@@ -2994,7 +3109,7 @@ function PushSetupScreen({
|
|
|
2994
3109
|
"Your pick wins or loses",
|
|
2995
3110
|
"Final results and rankings"
|
|
2996
3111
|
];
|
|
2997
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx4(View3, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ jsxs3(
|
|
2998
3113
|
Animated.View,
|
|
2999
3114
|
{
|
|
3000
3115
|
style: [
|
|
@@ -3002,37 +3117,37 @@ function PushSetupScreen({
|
|
|
3002
3117
|
{ opacity: fadeAnim, transform: [{ translateY: slideAnim }] }
|
|
3003
3118
|
],
|
|
3004
3119
|
children: [
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
-
/* @__PURE__ */
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
/* @__PURE__ */
|
|
3010
|
-
/* @__PURE__ */
|
|
3011
|
-
/* @__PURE__ */
|
|
3012
|
-
benefits.map((item, i) => /* @__PURE__ */
|
|
3013
|
-
/* @__PURE__ */
|
|
3014
|
-
/* @__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 })
|
|
3015
3130
|
] }, i))
|
|
3016
3131
|
] })
|
|
3017
3132
|
] }),
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
|
|
3133
|
+
/* @__PURE__ */ jsxs3(View3, { style: s.bottomRow, children: [
|
|
3134
|
+
/* @__PURE__ */ jsx4(
|
|
3135
|
+
TouchableOpacity3,
|
|
3021
3136
|
{
|
|
3022
3137
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
3023
3138
|
onPress: onComplete,
|
|
3024
3139
|
activeOpacity: 0.7,
|
|
3025
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ jsx4(Text3, { style: [s.secondaryBtnText, { color: t.textMuted }], children: "Maybe Later" })
|
|
3026
3141
|
}
|
|
3027
3142
|
),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
|
|
3143
|
+
/* @__PURE__ */ jsx4(
|
|
3144
|
+
TouchableOpacity3,
|
|
3030
3145
|
{
|
|
3031
3146
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: push.loading ? 0.7 : 1 }],
|
|
3032
3147
|
onPress: handleEnable,
|
|
3033
3148
|
disabled: push.loading,
|
|
3034
3149
|
activeOpacity: 0.8,
|
|
3035
|
-
children: push.loading ? /* @__PURE__ */
|
|
3150
|
+
children: push.loading ? /* @__PURE__ */ jsx4(ActivityIndicator2, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ jsx4(Text3, { style: s.primaryBtnText, children: "Enable Notifications" })
|
|
3036
3151
|
}
|
|
3037
3152
|
)
|
|
3038
3153
|
] })
|
|
@@ -3040,7 +3155,7 @@ function PushSetupScreen({
|
|
|
3040
3155
|
}
|
|
3041
3156
|
) });
|
|
3042
3157
|
}
|
|
3043
|
-
var pushStyles =
|
|
3158
|
+
var pushStyles = StyleSheet3.create({
|
|
3044
3159
|
iconContainer: { alignItems: "center", marginVertical: 24 },
|
|
3045
3160
|
bellCircle: { width: 100, height: 100, borderRadius: 50, justifyContent: "center", alignItems: "center" },
|
|
3046
3161
|
bellIcon: { fontSize: 48 },
|
|
@@ -3050,7 +3165,7 @@ var pushStyles = StyleSheet2.create({
|
|
|
3050
3165
|
bulletDot: { width: 8, height: 8, borderRadius: 4 },
|
|
3051
3166
|
benefitText: { fontSize: 16, flex: 1 }
|
|
3052
3167
|
});
|
|
3053
|
-
var s =
|
|
3168
|
+
var s = StyleSheet3.create({
|
|
3054
3169
|
container: { flex: 1 },
|
|
3055
3170
|
// Loading / Error
|
|
3056
3171
|
centerContent: { flex: 1, justifyContent: "center", alignItems: "center", paddingHorizontal: 32, gap: 48 },
|
|
@@ -3093,7 +3208,6 @@ var s = StyleSheet2.create({
|
|
|
3093
3208
|
styleScroll: { paddingHorizontal: 24, marginTop: 4 },
|
|
3094
3209
|
styleThumbWrap: { borderWidth: 2, borderRadius: 12, padding: 3, marginRight: 10 },
|
|
3095
3210
|
styleThumb: { width: 52, height: 52, borderRadius: 10, backgroundColor: "#E5E5EA" },
|
|
3096
|
-
colorSwatch: { width: 32, height: 32, borderRadius: 16, borderWidth: 1.5, borderColor: "rgba(255,255,255,0.15)", marginRight: 10 },
|
|
3097
3211
|
// Input
|
|
3098
3212
|
inputGroup: { paddingHorizontal: 24, gap: 6 },
|
|
3099
3213
|
inputLabel: { fontSize: 15, fontWeight: "600" },
|
|
@@ -3115,7 +3229,7 @@ var s = StyleSheet2.create({
|
|
|
3115
3229
|
});
|
|
3116
3230
|
|
|
3117
3231
|
// src/provider.tsx
|
|
3118
|
-
import { jsx as
|
|
3232
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
3119
3233
|
var DubsContext = createContext4(null);
|
|
3120
3234
|
function DubsProvider({
|
|
3121
3235
|
apiKey,
|
|
@@ -3165,7 +3279,7 @@ function DubsProvider({
|
|
|
3165
3279
|
themeOverrides.accent = uiConfig.accentColor;
|
|
3166
3280
|
}
|
|
3167
3281
|
if (externalWallet) {
|
|
3168
|
-
return /* @__PURE__ */
|
|
3282
|
+
return /* @__PURE__ */ jsx5(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ jsx5(
|
|
3169
3283
|
ExternalWalletProvider,
|
|
3170
3284
|
{
|
|
3171
3285
|
client,
|
|
@@ -3185,7 +3299,7 @@ function DubsProvider({
|
|
|
3185
3299
|
}
|
|
3186
3300
|
) });
|
|
3187
3301
|
}
|
|
3188
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx5(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ jsx5(
|
|
3189
3303
|
ManagedWalletProvider,
|
|
3190
3304
|
{
|
|
3191
3305
|
appName: uiConfig.appName || appName,
|
|
@@ -3197,7 +3311,7 @@ function DubsProvider({
|
|
|
3197
3311
|
tagline: uiConfig.tagline,
|
|
3198
3312
|
redirectUri,
|
|
3199
3313
|
appUrl: appUrl || uiConfig.appUrl,
|
|
3200
|
-
children: (adapter) => /* @__PURE__ */
|
|
3314
|
+
children: (adapter) => /* @__PURE__ */ jsx5(
|
|
3201
3315
|
ManagedInner,
|
|
3202
3316
|
{
|
|
3203
3317
|
client,
|
|
@@ -3242,7 +3356,7 @@ function ManagedInner({
|
|
|
3242
3356
|
() => ({ client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled }),
|
|
3243
3357
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3244
3358
|
);
|
|
3245
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children: /* @__PURE__ */ jsx5(
|
|
3246
3360
|
AuthGate,
|
|
3247
3361
|
{
|
|
3248
3362
|
onSaveToken: (token) => {
|
|
@@ -3286,9 +3400,9 @@ function ExternalWalletProvider({
|
|
|
3286
3400
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3287
3401
|
);
|
|
3288
3402
|
if (!managed) {
|
|
3289
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children });
|
|
3290
3404
|
}
|
|
3291
|
-
return /* @__PURE__ */
|
|
3405
|
+
return /* @__PURE__ */ jsx5(DubsContext.Provider, { value, children: /* @__PURE__ */ jsx5(
|
|
3292
3406
|
AuthGate,
|
|
3293
3407
|
{
|
|
3294
3408
|
onSaveToken: (token) => {
|
|
@@ -3319,8 +3433,8 @@ function useAppConfig() {
|
|
|
3319
3433
|
|
|
3320
3434
|
// src/ui/UserProfileCard.tsx
|
|
3321
3435
|
import { useMemo as useMemo3 } from "react";
|
|
3322
|
-
import { View as
|
|
3323
|
-
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";
|
|
3324
3438
|
function truncateAddress(address, chars = 4) {
|
|
3325
3439
|
if (address.length <= chars * 2 + 3) return address;
|
|
3326
3440
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3342,16 +3456,16 @@ function UserProfileCard({
|
|
|
3342
3456
|
() => ensurePngAvatar(avatarUrl) || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3343
3457
|
[avatarUrl, walletAddress]
|
|
3344
3458
|
);
|
|
3345
|
-
return /* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
username ? /* @__PURE__ */
|
|
3349
|
-
/* @__PURE__ */
|
|
3350
|
-
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
|
|
3351
3465
|
] })
|
|
3352
3466
|
] });
|
|
3353
3467
|
}
|
|
3354
|
-
var
|
|
3468
|
+
var styles3 = StyleSheet4.create({
|
|
3355
3469
|
card: {
|
|
3356
3470
|
flexDirection: "row",
|
|
3357
3471
|
alignItems: "center",
|
|
@@ -3386,14 +3500,14 @@ var styles2 = StyleSheet3.create({
|
|
|
3386
3500
|
|
|
3387
3501
|
// src/ui/SettingsSheet.tsx
|
|
3388
3502
|
import {
|
|
3389
|
-
View as
|
|
3390
|
-
Text as
|
|
3391
|
-
ScrollView as
|
|
3392
|
-
TouchableOpacity as
|
|
3503
|
+
View as View5,
|
|
3504
|
+
Text as Text5,
|
|
3505
|
+
ScrollView as ScrollView3,
|
|
3506
|
+
TouchableOpacity as TouchableOpacity4,
|
|
3393
3507
|
ActivityIndicator as ActivityIndicator3,
|
|
3394
|
-
StyleSheet as
|
|
3508
|
+
StyleSheet as StyleSheet5
|
|
3395
3509
|
} from "react-native";
|
|
3396
|
-
import { Fragment as Fragment3, jsx as
|
|
3510
|
+
import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
3397
3511
|
function truncateAddress2(address, chars = 4) {
|
|
3398
3512
|
if (address.length <= chars * 2 + 3) return address;
|
|
3399
3513
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3410,13 +3524,13 @@ function SettingsSheet({
|
|
|
3410
3524
|
loggingOut = false
|
|
3411
3525
|
}) {
|
|
3412
3526
|
const t = useDubsTheme();
|
|
3413
|
-
return /* @__PURE__ */
|
|
3414
|
-
|
|
3527
|
+
return /* @__PURE__ */ jsxs5(
|
|
3528
|
+
ScrollView3,
|
|
3415
3529
|
{
|
|
3416
|
-
style: [
|
|
3417
|
-
contentContainerStyle:
|
|
3530
|
+
style: [styles4.container, { backgroundColor: t.background }],
|
|
3531
|
+
contentContainerStyle: styles4.content,
|
|
3418
3532
|
children: [
|
|
3419
|
-
/* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ jsx7(
|
|
3420
3534
|
UserProfileCard,
|
|
3421
3535
|
{
|
|
3422
3536
|
walletAddress,
|
|
@@ -3425,49 +3539,49 @@ function SettingsSheet({
|
|
|
3425
3539
|
memberSince
|
|
3426
3540
|
}
|
|
3427
3541
|
),
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
onCopyAddress ? /* @__PURE__ */
|
|
3430
|
-
|
|
3542
|
+
/* @__PURE__ */ jsxs5(View5, { style: [styles4.actionsCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3543
|
+
onCopyAddress ? /* @__PURE__ */ jsxs5(
|
|
3544
|
+
TouchableOpacity4,
|
|
3431
3545
|
{
|
|
3432
|
-
style:
|
|
3546
|
+
style: styles4.actionRow,
|
|
3433
3547
|
onPress: onCopyAddress,
|
|
3434
3548
|
activeOpacity: 0.7,
|
|
3435
3549
|
children: [
|
|
3436
|
-
/* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
/* @__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) })
|
|
3439
3553
|
] }),
|
|
3440
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx7(Text5, { style: [styles4.copyLabel, { color: t.accent }], children: "Copy" })
|
|
3441
3555
|
]
|
|
3442
3556
|
}
|
|
3443
3557
|
) : null,
|
|
3444
|
-
onSupport ? /* @__PURE__ */
|
|
3445
|
-
onCopyAddress ? /* @__PURE__ */
|
|
3446
|
-
/* @__PURE__ */
|
|
3447
|
-
|
|
3558
|
+
onSupport ? /* @__PURE__ */ jsxs5(Fragment3, { children: [
|
|
3559
|
+
onCopyAddress ? /* @__PURE__ */ jsx7(View5, { style: [styles4.separator, { backgroundColor: t.border }] }) : null,
|
|
3560
|
+
/* @__PURE__ */ jsxs5(
|
|
3561
|
+
TouchableOpacity4,
|
|
3448
3562
|
{
|
|
3449
|
-
style:
|
|
3563
|
+
style: styles4.actionRow,
|
|
3450
3564
|
onPress: onSupport,
|
|
3451
3565
|
activeOpacity: 0.7,
|
|
3452
3566
|
children: [
|
|
3453
|
-
/* @__PURE__ */
|
|
3454
|
-
/* @__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" })
|
|
3455
3569
|
]
|
|
3456
3570
|
}
|
|
3457
3571
|
)
|
|
3458
3572
|
] }) : null
|
|
3459
3573
|
] }),
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
|
|
3574
|
+
/* @__PURE__ */ jsx7(
|
|
3575
|
+
TouchableOpacity4,
|
|
3462
3576
|
{
|
|
3463
|
-
style: [
|
|
3577
|
+
style: [styles4.logoutButton, { borderColor: t.live }],
|
|
3464
3578
|
onPress: onLogout,
|
|
3465
3579
|
disabled: loggingOut,
|
|
3466
3580
|
activeOpacity: 0.7,
|
|
3467
|
-
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" })
|
|
3468
3582
|
}
|
|
3469
3583
|
),
|
|
3470
|
-
appVersion ? /* @__PURE__ */
|
|
3584
|
+
appVersion ? /* @__PURE__ */ jsxs5(Text5, { style: [styles4.version, { color: t.textDim }], children: [
|
|
3471
3585
|
"v",
|
|
3472
3586
|
appVersion
|
|
3473
3587
|
] }) : null
|
|
@@ -3475,7 +3589,7 @@ function SettingsSheet({
|
|
|
3475
3589
|
}
|
|
3476
3590
|
);
|
|
3477
3591
|
}
|
|
3478
|
-
var
|
|
3592
|
+
var styles4 = StyleSheet5.create({
|
|
3479
3593
|
container: {
|
|
3480
3594
|
flex: 1
|
|
3481
3595
|
},
|
|
@@ -3540,58 +3654,20 @@ var styles3 = StyleSheet4.create({
|
|
|
3540
3654
|
// src/ui/UserProfileSheet.tsx
|
|
3541
3655
|
import { useState as useState17, useEffect as useEffect12, useRef as useRef5, useCallback as useCallback16, useMemo as useMemo4 } from "react";
|
|
3542
3656
|
import {
|
|
3543
|
-
View as
|
|
3544
|
-
Text as
|
|
3545
|
-
TouchableOpacity as
|
|
3657
|
+
View as View6,
|
|
3658
|
+
Text as Text6,
|
|
3659
|
+
TouchableOpacity as TouchableOpacity5,
|
|
3546
3660
|
ActivityIndicator as ActivityIndicator4,
|
|
3547
3661
|
Modal,
|
|
3548
3662
|
Animated as Animated2,
|
|
3549
|
-
StyleSheet as
|
|
3663
|
+
StyleSheet as StyleSheet6,
|
|
3550
3664
|
KeyboardAvoidingView as KeyboardAvoidingView2,
|
|
3551
3665
|
Platform as Platform5,
|
|
3552
|
-
Image as
|
|
3553
|
-
ScrollView as
|
|
3666
|
+
Image as Image5,
|
|
3667
|
+
ScrollView as ScrollView4,
|
|
3554
3668
|
Dimensions
|
|
3555
3669
|
} from "react-native";
|
|
3556
|
-
import { jsx as
|
|
3557
|
-
var DICEBEAR_STYLES2 = [
|
|
3558
|
-
"adventurer",
|
|
3559
|
-
"avataaars",
|
|
3560
|
-
"fun-emoji",
|
|
3561
|
-
"bottts",
|
|
3562
|
-
"big-smile",
|
|
3563
|
-
"thumbs"
|
|
3564
|
-
];
|
|
3565
|
-
var BG_COLORS2 = [
|
|
3566
|
-
"1a1a2e",
|
|
3567
|
-
"f43f5e",
|
|
3568
|
-
"f97316",
|
|
3569
|
-
"eab308",
|
|
3570
|
-
"22c55e",
|
|
3571
|
-
"3b82f6",
|
|
3572
|
-
"8b5cf6",
|
|
3573
|
-
"ec4899",
|
|
3574
|
-
"06b6d4",
|
|
3575
|
-
"64748b"
|
|
3576
|
-
];
|
|
3577
|
-
function generateSeed2() {
|
|
3578
|
-
return Math.random().toString(36).slice(2, 10);
|
|
3579
|
-
}
|
|
3580
|
-
function getAvatarUrl2(style, seed, bg = "1a1a2e", size = 256) {
|
|
3581
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
3582
|
-
}
|
|
3583
|
-
function parseAvatarUrl(url) {
|
|
3584
|
-
if (!url) return { style: "adventurer", seed: generateSeed2(), bg: "1a1a2e" };
|
|
3585
|
-
try {
|
|
3586
|
-
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
3587
|
-
if (match) {
|
|
3588
|
-
const bgMatch = url.match(/backgroundColor=([^&]+)/);
|
|
3589
|
-
return { style: match[1], seed: match[2], bg: bgMatch?.[1] || "1a1a2e" };
|
|
3590
|
-
}
|
|
3591
|
-
} catch {
|
|
3592
|
-
}
|
|
3593
|
-
return { style: "adventurer", seed: generateSeed2(), bg: "1a1a2e" };
|
|
3594
|
-
}
|
|
3670
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
3595
3671
|
function truncateAddress3(address, chars = 4) {
|
|
3596
3672
|
if (address.length <= chars * 2 + 3) return address;
|
|
3597
3673
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3629,7 +3705,7 @@ function UserProfileSheet({
|
|
|
3629
3705
|
useEffect12(() => {
|
|
3630
3706
|
if (visible) setError(null);
|
|
3631
3707
|
}, [visible]);
|
|
3632
|
-
const currentAvatarUrl =
|
|
3708
|
+
const currentAvatarUrl = getAvatarUrl(avatarStyle, avatarSeed, bgColor);
|
|
3633
3709
|
const saveAvatar = useCallback16(async (newUrl) => {
|
|
3634
3710
|
setSaving(true);
|
|
3635
3711
|
setError(null);
|
|
@@ -3642,26 +3718,20 @@ function UserProfileSheet({
|
|
|
3642
3718
|
setSaving(false);
|
|
3643
3719
|
}
|
|
3644
3720
|
}, [client, onAvatarUpdated]);
|
|
3645
|
-
const
|
|
3646
|
-
(style)
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
},
|
|
3650
|
-
[avatarSeed, bgColor, saveAvatar]
|
|
3651
|
-
);
|
|
3721
|
+
const handleStyleChange = useCallback16((style) => {
|
|
3722
|
+
setAvatarStyle(style);
|
|
3723
|
+
saveAvatar(getAvatarUrl(style, avatarSeed, bgColor));
|
|
3724
|
+
}, [avatarSeed, bgColor, saveAvatar]);
|
|
3652
3725
|
const handleShuffle = useCallback16(() => {
|
|
3653
|
-
const newSeed =
|
|
3726
|
+
const newSeed = generateSeed();
|
|
3654
3727
|
setAvatarSeed(newSeed);
|
|
3655
|
-
saveAvatar(
|
|
3728
|
+
saveAvatar(getAvatarUrl(avatarStyle, newSeed, bgColor));
|
|
3656
3729
|
}, [avatarStyle, bgColor, saveAvatar]);
|
|
3657
|
-
const
|
|
3658
|
-
(color)
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
[avatarStyle, avatarSeed, saveAvatar]
|
|
3663
|
-
);
|
|
3664
|
-
return /* @__PURE__ */ jsxs5(
|
|
3730
|
+
const handleBgChange = useCallback16((color) => {
|
|
3731
|
+
setBgColor(color);
|
|
3732
|
+
saveAvatar(getAvatarUrl(avatarStyle, avatarSeed, color));
|
|
3733
|
+
}, [avatarStyle, avatarSeed, saveAvatar]);
|
|
3734
|
+
return /* @__PURE__ */ jsxs6(
|
|
3665
3735
|
Modal,
|
|
3666
3736
|
{
|
|
3667
3737
|
visible,
|
|
@@ -3669,149 +3739,101 @@ function UserProfileSheet({
|
|
|
3669
3739
|
transparent: true,
|
|
3670
3740
|
onRequestClose: onDismiss,
|
|
3671
3741
|
children: [
|
|
3672
|
-
/* @__PURE__ */
|
|
3673
|
-
/* @__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(
|
|
3674
3744
|
KeyboardAvoidingView2,
|
|
3675
3745
|
{
|
|
3676
|
-
style:
|
|
3746
|
+
style: styles5.keyboardView,
|
|
3677
3747
|
behavior: Platform5.OS === "ios" ? "padding" : void 0,
|
|
3678
|
-
children: /* @__PURE__ */
|
|
3679
|
-
/* @__PURE__ */
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
/* @__PURE__ */
|
|
3682
|
-
/* @__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" }) })
|
|
3683
3753
|
] }),
|
|
3684
|
-
/* @__PURE__ */
|
|
3685
|
-
|
|
3754
|
+
/* @__PURE__ */ jsxs6(
|
|
3755
|
+
ScrollView4,
|
|
3686
3756
|
{
|
|
3687
|
-
style:
|
|
3688
|
-
contentContainerStyle:
|
|
3757
|
+
style: styles5.scrollContent,
|
|
3758
|
+
contentContainerStyle: styles5.scrollContentInner,
|
|
3689
3759
|
showsVerticalScrollIndicator: false,
|
|
3690
3760
|
bounces: false,
|
|
3691
3761
|
children: [
|
|
3692
|
-
/* @__PURE__ */
|
|
3693
|
-
/* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
|
|
3762
|
+
/* @__PURE__ */ jsxs6(View6, { style: styles5.avatarSection, children: [
|
|
3763
|
+
/* @__PURE__ */ jsxs6(View6, { style: [styles5.avatarContainer, { borderColor: t.border }], children: [
|
|
3764
|
+
/* @__PURE__ */ jsx8(
|
|
3765
|
+
Image5,
|
|
3696
3766
|
{
|
|
3697
3767
|
source: { uri: currentAvatarUrl },
|
|
3698
|
-
style:
|
|
3768
|
+
style: styles5.avatar
|
|
3699
3769
|
}
|
|
3700
3770
|
),
|
|
3701
|
-
saving && /* @__PURE__ */
|
|
3771
|
+
saving && /* @__PURE__ */ jsx8(View6, { style: styles5.avatarLoading, children: /* @__PURE__ */ jsx8(ActivityIndicator4, { size: "small", color: "#FFFFFF" }) })
|
|
3702
3772
|
] }),
|
|
3703
|
-
user.username ? /* @__PURE__ */
|
|
3704
|
-
/* @__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) })
|
|
3705
3775
|
] }),
|
|
3706
|
-
/* @__PURE__ */
|
|
3707
|
-
/* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3709
|
-
/* @__PURE__ */
|
|
3710
|
-
|
|
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,
|
|
3711
3781
|
{
|
|
3712
|
-
style: [
|
|
3782
|
+
style: [styles5.shuffleButton, { borderColor: t.border }],
|
|
3713
3783
|
onPress: handleShuffle,
|
|
3714
3784
|
activeOpacity: 0.7,
|
|
3715
3785
|
disabled: saving,
|
|
3716
|
-
children: /* @__PURE__ */
|
|
3786
|
+
children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.shuffleText, { color: t.accent }], children: "Shuffle" })
|
|
3717
3787
|
}
|
|
3718
3788
|
)
|
|
3719
3789
|
] }),
|
|
3720
|
-
/* @__PURE__ */
|
|
3721
|
-
|
|
3790
|
+
/* @__PURE__ */ jsx8(
|
|
3791
|
+
AvatarEditor,
|
|
3722
3792
|
{
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
{
|
|
3731
|
-
onPress: () => handleSelectStyle(style),
|
|
3732
|
-
activeOpacity: 0.7,
|
|
3733
|
-
disabled: saving,
|
|
3734
|
-
style: [
|
|
3735
|
-
styles4.styleTile,
|
|
3736
|
-
{
|
|
3737
|
-
borderColor: isSelected ? t.accent : t.border,
|
|
3738
|
-
borderWidth: isSelected ? 2 : 1
|
|
3739
|
-
}
|
|
3740
|
-
],
|
|
3741
|
-
children: /* @__PURE__ */ jsx7(
|
|
3742
|
-
Image4,
|
|
3743
|
-
{
|
|
3744
|
-
source: { uri: getAvatarUrl2(style, avatarSeed, bgColor, 80) },
|
|
3745
|
-
style: styles4.styleTileImage
|
|
3746
|
-
}
|
|
3747
|
-
)
|
|
3748
|
-
},
|
|
3749
|
-
style
|
|
3750
|
-
);
|
|
3751
|
-
})
|
|
3752
|
-
}
|
|
3753
|
-
),
|
|
3754
|
-
/* @__PURE__ */ jsx7(Text5, { style: [styles4.sectionLabel, { color: t.textSecondary, marginTop: 4 }], children: "Background Color" }),
|
|
3755
|
-
/* @__PURE__ */ jsx7(
|
|
3756
|
-
ScrollView3,
|
|
3757
|
-
{
|
|
3758
|
-
horizontal: true,
|
|
3759
|
-
showsHorizontalScrollIndicator: false,
|
|
3760
|
-
contentContainerStyle: styles4.colorPickerContent,
|
|
3761
|
-
children: BG_COLORS2.map((color) => {
|
|
3762
|
-
const isSelected = color === bgColor;
|
|
3763
|
-
return /* @__PURE__ */ jsx7(
|
|
3764
|
-
TouchableOpacity4,
|
|
3765
|
-
{
|
|
3766
|
-
onPress: () => handleSelectBgColor(color),
|
|
3767
|
-
activeOpacity: 0.7,
|
|
3768
|
-
disabled: saving,
|
|
3769
|
-
style: [
|
|
3770
|
-
styles4.colorSwatch,
|
|
3771
|
-
{ backgroundColor: `#${color}` },
|
|
3772
|
-
isSelected && { borderColor: t.accent, borderWidth: 2.5 }
|
|
3773
|
-
]
|
|
3774
|
-
},
|
|
3775
|
-
color
|
|
3776
|
-
);
|
|
3777
|
-
})
|
|
3793
|
+
style: avatarStyle,
|
|
3794
|
+
seed: avatarSeed,
|
|
3795
|
+
bg: bgColor,
|
|
3796
|
+
onStyleChange: handleStyleChange,
|
|
3797
|
+
onSeedChange: setAvatarSeed,
|
|
3798
|
+
onBgChange: handleBgChange,
|
|
3799
|
+
disabled: saving
|
|
3778
3800
|
}
|
|
3779
3801
|
)
|
|
3780
3802
|
] }),
|
|
3781
|
-
error ? /* @__PURE__ */
|
|
3782
|
-
push.enabled && /* @__PURE__ */
|
|
3783
|
-
/* @__PURE__ */
|
|
3784
|
-
/* @__PURE__ */
|
|
3785
|
-
/* @__PURE__ */
|
|
3786
|
-
|
|
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,
|
|
3787
3809
|
{
|
|
3788
3810
|
style: [
|
|
3789
|
-
|
|
3811
|
+
styles5.notifStatus,
|
|
3790
3812
|
{ color: push.hasPermission ? t.success : t.textMuted }
|
|
3791
3813
|
],
|
|
3792
3814
|
children: push.hasPermission ? "Enabled" : "Disabled"
|
|
3793
3815
|
}
|
|
3794
3816
|
)
|
|
3795
3817
|
] }),
|
|
3796
|
-
!push.hasPermission && /* @__PURE__ */
|
|
3797
|
-
|
|
3818
|
+
!push.hasPermission && /* @__PURE__ */ jsx8(
|
|
3819
|
+
TouchableOpacity5,
|
|
3798
3820
|
{
|
|
3799
|
-
style: [
|
|
3821
|
+
style: [styles5.enableButton, { backgroundColor: t.accent }],
|
|
3800
3822
|
onPress: push.register,
|
|
3801
3823
|
disabled: push.loading,
|
|
3802
3824
|
activeOpacity: 0.8,
|
|
3803
|
-
children: push.loading ? /* @__PURE__ */
|
|
3825
|
+
children: push.loading ? /* @__PURE__ */ jsx8(ActivityIndicator4, { size: "small", color: "#FFFFFF" }) : /* @__PURE__ */ jsx8(Text6, { style: styles5.enableText, children: "Enable" })
|
|
3804
3826
|
}
|
|
3805
3827
|
)
|
|
3806
3828
|
] }),
|
|
3807
|
-
push.enabled && push.error ? /* @__PURE__ */
|
|
3808
|
-
onDisconnect ? /* @__PURE__ */
|
|
3809
|
-
|
|
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,
|
|
3810
3832
|
{
|
|
3811
|
-
style: [
|
|
3833
|
+
style: [styles5.disconnectButton, { borderColor: t.live }],
|
|
3812
3834
|
onPress: onDisconnect,
|
|
3813
3835
|
activeOpacity: 0.7,
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3836
|
+
children: /* @__PURE__ */ jsx8(Text6, { style: [styles5.disconnectText, { color: t.live }], children: "Disconnect Wallet" })
|
|
3815
3837
|
}
|
|
3816
3838
|
) : null
|
|
3817
3839
|
]
|
|
@@ -3824,9 +3846,9 @@ function UserProfileSheet({
|
|
|
3824
3846
|
}
|
|
3825
3847
|
);
|
|
3826
3848
|
}
|
|
3827
|
-
var
|
|
3849
|
+
var styles5 = StyleSheet6.create({
|
|
3828
3850
|
overlay: {
|
|
3829
|
-
...
|
|
3851
|
+
...StyleSheet6.absoluteFillObject,
|
|
3830
3852
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
3831
3853
|
},
|
|
3832
3854
|
overlayTap: {
|
|
@@ -3877,7 +3899,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3877
3899
|
scrollContentInner: {
|
|
3878
3900
|
paddingBottom: 8
|
|
3879
3901
|
},
|
|
3880
|
-
// Avatar
|
|
3881
3902
|
avatarSection: {
|
|
3882
3903
|
alignItems: "center",
|
|
3883
3904
|
paddingTop: 8,
|
|
@@ -3893,11 +3914,10 @@ var styles4 = StyleSheet5.create({
|
|
|
3893
3914
|
},
|
|
3894
3915
|
avatar: {
|
|
3895
3916
|
width: "100%",
|
|
3896
|
-
height: "100%"
|
|
3897
|
-
backgroundColor: "#1a1a2e"
|
|
3917
|
+
height: "100%"
|
|
3898
3918
|
},
|
|
3899
3919
|
avatarLoading: {
|
|
3900
|
-
...
|
|
3920
|
+
...StyleSheet6.absoluteFillObject,
|
|
3901
3921
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
3902
3922
|
justifyContent: "center",
|
|
3903
3923
|
alignItems: "center"
|
|
@@ -3910,7 +3930,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3910
3930
|
fontSize: 13,
|
|
3911
3931
|
fontFamily: "monospace"
|
|
3912
3932
|
},
|
|
3913
|
-
// Change Avatar
|
|
3914
3933
|
section: {
|
|
3915
3934
|
marginBottom: 20,
|
|
3916
3935
|
gap: 12
|
|
@@ -3934,31 +3953,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3934
3953
|
fontSize: 13,
|
|
3935
3954
|
fontWeight: "600"
|
|
3936
3955
|
},
|
|
3937
|
-
stylePickerContent: {
|
|
3938
|
-
gap: 10
|
|
3939
|
-
},
|
|
3940
|
-
colorPickerContent: {
|
|
3941
|
-
gap: 8
|
|
3942
|
-
},
|
|
3943
|
-
colorSwatch: {
|
|
3944
|
-
width: 32,
|
|
3945
|
-
height: 32,
|
|
3946
|
-
borderRadius: 16,
|
|
3947
|
-
borderWidth: 1.5,
|
|
3948
|
-
borderColor: "rgba(255,255,255,0.15)"
|
|
3949
|
-
},
|
|
3950
|
-
styleTile: {
|
|
3951
|
-
width: 72,
|
|
3952
|
-
height: 72,
|
|
3953
|
-
borderRadius: 16,
|
|
3954
|
-
overflow: "hidden"
|
|
3955
|
-
},
|
|
3956
|
-
styleTileImage: {
|
|
3957
|
-
width: "100%",
|
|
3958
|
-
height: "100%",
|
|
3959
|
-
backgroundColor: "#1a1a2e"
|
|
3960
|
-
},
|
|
3961
|
-
// Error
|
|
3962
3956
|
errorBox: {
|
|
3963
3957
|
marginBottom: 16,
|
|
3964
3958
|
borderRadius: 12,
|
|
@@ -3969,7 +3963,6 @@ var styles4 = StyleSheet5.create({
|
|
|
3969
3963
|
fontSize: 13,
|
|
3970
3964
|
fontWeight: "500"
|
|
3971
3965
|
},
|
|
3972
|
-
// Push Notifications
|
|
3973
3966
|
notifRow: {
|
|
3974
3967
|
flexDirection: "row",
|
|
3975
3968
|
alignItems: "center",
|
|
@@ -4000,7 +3993,6 @@ var styles4 = StyleSheet5.create({
|
|
|
4000
3993
|
fontSize: 14,
|
|
4001
3994
|
fontWeight: "700"
|
|
4002
3995
|
},
|
|
4003
|
-
// Disconnect
|
|
4004
3996
|
disconnectButton: {
|
|
4005
3997
|
height: 52,
|
|
4006
3998
|
borderRadius: 16,
|
|
@@ -4016,8 +4008,8 @@ var styles4 = StyleSheet5.create({
|
|
|
4016
4008
|
|
|
4017
4009
|
// src/ui/game/GamePoster.tsx
|
|
4018
4010
|
import { useState as useState18 } from "react";
|
|
4019
|
-
import { StyleSheet as
|
|
4020
|
-
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";
|
|
4021
4013
|
function computeCountdown(lockTimestamp) {
|
|
4022
4014
|
if (!lockTimestamp) return "";
|
|
4023
4015
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -4038,27 +4030,27 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4038
4030
|
const away = opponents[1];
|
|
4039
4031
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
4040
4032
|
const isLive = countdown === "LIVE";
|
|
4041
|
-
return /* @__PURE__ */
|
|
4042
|
-
game.media?.poster ? /* @__PURE__ */
|
|
4033
|
+
return /* @__PURE__ */ jsxs7(View7, { style: styles6.container, children: [
|
|
4034
|
+
game.media?.poster ? /* @__PURE__ */ jsx9(
|
|
4043
4035
|
Img,
|
|
4044
4036
|
{
|
|
4045
4037
|
source: { uri: game.media.poster },
|
|
4046
|
-
style:
|
|
4038
|
+
style: styles6.image,
|
|
4047
4039
|
resizeMode: "cover"
|
|
4048
4040
|
}
|
|
4049
|
-
) : /* @__PURE__ */
|
|
4050
|
-
/* @__PURE__ */
|
|
4051
|
-
/* @__PURE__ */
|
|
4052
|
-
/* @__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 })
|
|
4053
4045
|
] }) }),
|
|
4054
|
-
/* @__PURE__ */
|
|
4055
|
-
/* @__PURE__ */
|
|
4056
|
-
/* @__PURE__ */
|
|
4057
|
-
/* @__PURE__ */
|
|
4058
|
-
/* @__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" })
|
|
4059
4051
|
] }),
|
|
4060
|
-
countdown ? /* @__PURE__ */
|
|
4061
|
-
/* @__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: [
|
|
4062
4054
|
game.totalPool || 0,
|
|
4063
4055
|
" SOL"
|
|
4064
4056
|
] }) })
|
|
@@ -4067,9 +4059,9 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4067
4059
|
function TeamLogoInternal({ url, size, Img }) {
|
|
4068
4060
|
const [failed, setFailed] = useState18(false);
|
|
4069
4061
|
if (!url || failed) {
|
|
4070
|
-
return /* @__PURE__ */
|
|
4062
|
+
return /* @__PURE__ */ jsx9(View7, { style: [styles6.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
4071
4063
|
}
|
|
4072
|
-
return /* @__PURE__ */
|
|
4064
|
+
return /* @__PURE__ */ jsx9(
|
|
4073
4065
|
Img,
|
|
4074
4066
|
{
|
|
4075
4067
|
source: { uri: url },
|
|
@@ -4079,7 +4071,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
4079
4071
|
}
|
|
4080
4072
|
);
|
|
4081
4073
|
}
|
|
4082
|
-
var
|
|
4074
|
+
var styles6 = StyleSheet7.create({
|
|
4083
4075
|
container: {
|
|
4084
4076
|
height: 200,
|
|
4085
4077
|
borderRadius: 16,
|
|
@@ -4087,12 +4079,12 @@ var styles5 = StyleSheet6.create({
|
|
|
4087
4079
|
position: "relative"
|
|
4088
4080
|
},
|
|
4089
4081
|
image: {
|
|
4090
|
-
...
|
|
4082
|
+
...StyleSheet7.absoluteFillObject,
|
|
4091
4083
|
justifyContent: "center",
|
|
4092
4084
|
alignItems: "center"
|
|
4093
4085
|
},
|
|
4094
4086
|
overlay: {
|
|
4095
|
-
...
|
|
4087
|
+
...StyleSheet7.absoluteFillObject,
|
|
4096
4088
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4097
4089
|
},
|
|
4098
4090
|
fallback: {
|
|
@@ -4167,8 +4159,8 @@ var styles5 = StyleSheet6.create({
|
|
|
4167
4159
|
|
|
4168
4160
|
// src/ui/game/LivePoolsCard.tsx
|
|
4169
4161
|
import { useMemo as useMemo5 } from "react";
|
|
4170
|
-
import { StyleSheet as
|
|
4171
|
-
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";
|
|
4172
4164
|
function LivePoolsCard({
|
|
4173
4165
|
game,
|
|
4174
4166
|
shortName,
|
|
@@ -4190,29 +4182,29 @@ function LivePoolsCard({
|
|
|
4190
4182
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4191
4183
|
};
|
|
4192
4184
|
}, [homePool, awayPool, totalPool]);
|
|
4193
|
-
return /* @__PURE__ */
|
|
4194
|
-
/* @__PURE__ */
|
|
4195
|
-
/* @__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: [
|
|
4196
4188
|
totalPool,
|
|
4197
4189
|
" SOL total"
|
|
4198
4190
|
] }),
|
|
4199
|
-
/* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4201
|
-
/* @__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 })
|
|
4202
4194
|
] }),
|
|
4203
|
-
/* @__PURE__ */
|
|
4204
|
-
/* @__PURE__ */
|
|
4195
|
+
/* @__PURE__ */ jsxs8(View8, { style: styles7.oddsRow, children: [
|
|
4196
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4205
4197
|
homeName,
|
|
4206
4198
|
": ",
|
|
4207
|
-
/* @__PURE__ */
|
|
4199
|
+
/* @__PURE__ */ jsxs8(Text8, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4208
4200
|
homeOdds,
|
|
4209
4201
|
"x"
|
|
4210
4202
|
] })
|
|
4211
4203
|
] }),
|
|
4212
|
-
/* @__PURE__ */
|
|
4204
|
+
/* @__PURE__ */ jsxs8(Text8, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4213
4205
|
awayName,
|
|
4214
4206
|
": ",
|
|
4215
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsxs8(Text8, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4216
4208
|
awayOdds,
|
|
4217
4209
|
"x"
|
|
4218
4210
|
] })
|
|
@@ -4221,16 +4213,16 @@ function LivePoolsCard({
|
|
|
4221
4213
|
] });
|
|
4222
4214
|
}
|
|
4223
4215
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4224
|
-
return /* @__PURE__ */
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
-
/* @__PURE__ */
|
|
4227
|
-
/* @__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: [
|
|
4228
4220
|
amount,
|
|
4229
4221
|
" SOL"
|
|
4230
4222
|
] })
|
|
4231
4223
|
] });
|
|
4232
4224
|
}
|
|
4233
|
-
var
|
|
4225
|
+
var styles7 = StyleSheet8.create({
|
|
4234
4226
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4235
4227
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4236
4228
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4246,8 +4238,8 @@ var styles6 = StyleSheet7.create({
|
|
|
4246
4238
|
|
|
4247
4239
|
// src/ui/game/PickWinnerCard.tsx
|
|
4248
4240
|
import { useState as useState19, useMemo as useMemo6 } from "react";
|
|
4249
|
-
import { StyleSheet as
|
|
4250
|
-
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";
|
|
4251
4243
|
function PickWinnerCard({
|
|
4252
4244
|
game,
|
|
4253
4245
|
selectedTeam,
|
|
@@ -4271,10 +4263,10 @@ function PickWinnerCard({
|
|
|
4271
4263
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4272
4264
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4273
4265
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4274
|
-
return /* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
/* @__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(
|
|
4278
4270
|
TeamOption,
|
|
4279
4271
|
{
|
|
4280
4272
|
name: homeName,
|
|
@@ -4288,7 +4280,7 @@ function PickWinnerCard({
|
|
|
4288
4280
|
t
|
|
4289
4281
|
}
|
|
4290
4282
|
),
|
|
4291
|
-
/* @__PURE__ */
|
|
4283
|
+
/* @__PURE__ */ jsx11(
|
|
4292
4284
|
TeamOption,
|
|
4293
4285
|
{
|
|
4294
4286
|
name: awayName,
|
|
@@ -4319,30 +4311,30 @@ function TeamOption({
|
|
|
4319
4311
|
const [imgFailed, setImgFailed] = useState19(false);
|
|
4320
4312
|
const Img = ImageComponent || __require("react-native").Image;
|
|
4321
4313
|
const showImage = imageUrl && !imgFailed;
|
|
4322
|
-
return /* @__PURE__ */
|
|
4323
|
-
|
|
4314
|
+
return /* @__PURE__ */ jsxs9(
|
|
4315
|
+
TouchableOpacity6,
|
|
4324
4316
|
{
|
|
4325
|
-
style: [
|
|
4317
|
+
style: [styles8.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4326
4318
|
onPress,
|
|
4327
4319
|
activeOpacity: 0.7,
|
|
4328
4320
|
children: [
|
|
4329
|
-
showImage ? /* @__PURE__ */
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
/* @__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: [
|
|
4332
4324
|
odds,
|
|
4333
4325
|
"x"
|
|
4334
4326
|
] }),
|
|
4335
|
-
/* @__PURE__ */
|
|
4327
|
+
/* @__PURE__ */ jsxs9(Text9, { style: [styles8.bets, { color: t.textMuted }], children: [
|
|
4336
4328
|
bets,
|
|
4337
4329
|
" ",
|
|
4338
4330
|
bets === 1 ? "bet" : "bets"
|
|
4339
4331
|
] }),
|
|
4340
|
-
selected && /* @__PURE__ */
|
|
4332
|
+
selected && /* @__PURE__ */ jsx11(View9, { style: [styles8.badge, { backgroundColor: color }], children: /* @__PURE__ */ jsx11(Text9, { style: styles8.badgeText, children: "Selected" }) })
|
|
4341
4333
|
]
|
|
4342
4334
|
}
|
|
4343
4335
|
);
|
|
4344
4336
|
}
|
|
4345
|
-
var
|
|
4337
|
+
var styles8 = StyleSheet9.create({
|
|
4346
4338
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4347
4339
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4348
4340
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4358,8 +4350,8 @@ var styles7 = StyleSheet8.create({
|
|
|
4358
4350
|
|
|
4359
4351
|
// src/ui/game/PlayersCard.tsx
|
|
4360
4352
|
import { useState as useState20 } from "react";
|
|
4361
|
-
import { StyleSheet as
|
|
4362
|
-
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";
|
|
4363
4355
|
function truncateWallet(addr, chars) {
|
|
4364
4356
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4365
4357
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4379,12 +4371,12 @@ function PlayersCard({
|
|
|
4379
4371
|
if (team === "away") return awayColor;
|
|
4380
4372
|
return drawColor;
|
|
4381
4373
|
};
|
|
4382
|
-
return /* @__PURE__ */
|
|
4383
|
-
/* @__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: [
|
|
4384
4376
|
"Players",
|
|
4385
4377
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4386
4378
|
] }),
|
|
4387
|
-
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(
|
|
4388
4380
|
BettorRow,
|
|
4389
4381
|
{
|
|
4390
4382
|
bettor: b,
|
|
@@ -4409,17 +4401,17 @@ function BettorRow({
|
|
|
4409
4401
|
const [imgFailed, setImgFailed] = useState20(false);
|
|
4410
4402
|
const Img = ImageComponent || __require("react-native").Image;
|
|
4411
4403
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4412
|
-
return /* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4414
|
-
showAvatar ? /* @__PURE__ */
|
|
4415
|
-
/* @__PURE__ */
|
|
4416
|
-
/* @__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: [
|
|
4417
4409
|
bettor.amount,
|
|
4418
4410
|
" SOL"
|
|
4419
4411
|
] })
|
|
4420
4412
|
] });
|
|
4421
4413
|
}
|
|
4422
|
-
var
|
|
4414
|
+
var styles9 = StyleSheet10.create({
|
|
4423
4415
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4424
4416
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4425
4417
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4434,8 +4426,8 @@ var styles8 = StyleSheet9.create({
|
|
|
4434
4426
|
|
|
4435
4427
|
// src/ui/game/JoinGameButton.tsx
|
|
4436
4428
|
import { useMemo as useMemo7 } from "react";
|
|
4437
|
-
import { StyleSheet as
|
|
4438
|
-
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";
|
|
4439
4431
|
var STATUS_LABELS = {
|
|
4440
4432
|
building: "Building transaction...",
|
|
4441
4433
|
signing: "Approve in wallet...",
|
|
@@ -4451,30 +4443,30 @@ function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
|
4451
4443
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4452
4444
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4453
4445
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4454
|
-
return /* @__PURE__ */
|
|
4455
|
-
/* @__PURE__ */
|
|
4456
|
-
/* @__PURE__ */
|
|
4457
|
-
/* @__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: [
|
|
4458
4450
|
game.buyIn,
|
|
4459
4451
|
" SOL"
|
|
4460
4452
|
] })
|
|
4461
4453
|
] }),
|
|
4462
|
-
/* @__PURE__ */
|
|
4463
|
-
|
|
4454
|
+
/* @__PURE__ */ jsx13(
|
|
4455
|
+
TouchableOpacity7,
|
|
4464
4456
|
{
|
|
4465
|
-
style: [
|
|
4457
|
+
style: [styles10.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4466
4458
|
disabled: !selectedTeam || isJoining,
|
|
4467
4459
|
onPress: onJoin,
|
|
4468
4460
|
activeOpacity: 0.8,
|
|
4469
|
-
children: isJoining ? /* @__PURE__ */
|
|
4470
|
-
/* @__PURE__ */
|
|
4471
|
-
/* @__PURE__ */
|
|
4472
|
-
] }) : /* @__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" })
|
|
4473
4465
|
}
|
|
4474
4466
|
)
|
|
4475
4467
|
] });
|
|
4476
4468
|
}
|
|
4477
|
-
var
|
|
4469
|
+
var styles10 = StyleSheet11.create({
|
|
4478
4470
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4479
4471
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4480
4472
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4487,18 +4479,18 @@ var styles9 = StyleSheet10.create({
|
|
|
4487
4479
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4488
4480
|
import { useState as useState21, useEffect as useEffect13, useRef as useRef6, useCallback as useCallback17 } from "react";
|
|
4489
4481
|
import {
|
|
4490
|
-
View as
|
|
4491
|
-
Text as
|
|
4482
|
+
View as View12,
|
|
4483
|
+
Text as Text12,
|
|
4492
4484
|
TextInput as TextInput2,
|
|
4493
|
-
TouchableOpacity as
|
|
4485
|
+
TouchableOpacity as TouchableOpacity8,
|
|
4494
4486
|
ActivityIndicator as ActivityIndicator6,
|
|
4495
4487
|
Modal as Modal2,
|
|
4496
4488
|
Animated as Animated3,
|
|
4497
|
-
StyleSheet as
|
|
4489
|
+
StyleSheet as StyleSheet12,
|
|
4498
4490
|
KeyboardAvoidingView as KeyboardAvoidingView3,
|
|
4499
4491
|
Platform as Platform6
|
|
4500
4492
|
} from "react-native";
|
|
4501
|
-
import { jsx as
|
|
4493
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4502
4494
|
var STATUS_LABELS2 = {
|
|
4503
4495
|
building: "Building transaction...",
|
|
4504
4496
|
signing: "Approve in wallet...",
|
|
@@ -4597,7 +4589,7 @@ function CreateCustomGameSheet({
|
|
|
4597
4589
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4598
4590
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4599
4591
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4600
|
-
return /* @__PURE__ */
|
|
4592
|
+
return /* @__PURE__ */ jsxs12(
|
|
4601
4593
|
Modal2,
|
|
4602
4594
|
{
|
|
4603
4595
|
visible,
|
|
@@ -4605,34 +4597,34 @@ function CreateCustomGameSheet({
|
|
|
4605
4597
|
transparent: true,
|
|
4606
4598
|
onRequestClose: onDismiss,
|
|
4607
4599
|
children: [
|
|
4608
|
-
/* @__PURE__ */
|
|
4609
|
-
/* @__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(
|
|
4610
4602
|
KeyboardAvoidingView3,
|
|
4611
4603
|
{
|
|
4612
|
-
style:
|
|
4604
|
+
style: styles11.keyboardView,
|
|
4613
4605
|
behavior: Platform6.OS === "ios" ? "padding" : void 0,
|
|
4614
|
-
children: /* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4616
|
-
/* @__PURE__ */
|
|
4617
|
-
/* @__PURE__ */
|
|
4618
|
-
/* @__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" }) })
|
|
4619
4611
|
] }),
|
|
4620
|
-
!isPoolModeEnabled && /* @__PURE__ */
|
|
4621
|
-
/* @__PURE__ */
|
|
4622
|
-
/* @__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: [
|
|
4623
4615
|
presetAmounts.map((amount) => {
|
|
4624
4616
|
const active = !isCustom && selectedAmount === amount;
|
|
4625
|
-
return /* @__PURE__ */
|
|
4626
|
-
|
|
4617
|
+
return /* @__PURE__ */ jsx14(
|
|
4618
|
+
TouchableOpacity8,
|
|
4627
4619
|
{
|
|
4628
4620
|
style: [
|
|
4629
|
-
|
|
4621
|
+
styles11.chip,
|
|
4630
4622
|
{ borderColor: active ? t.accent : t.border },
|
|
4631
4623
|
active && { backgroundColor: t.accent }
|
|
4632
4624
|
],
|
|
4633
4625
|
onPress: () => handlePresetSelect(amount),
|
|
4634
4626
|
activeOpacity: 0.8,
|
|
4635
|
-
children: /* @__PURE__ */
|
|
4627
|
+
children: /* @__PURE__ */ jsxs12(Text12, { style: [styles11.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4636
4628
|
amount,
|
|
4637
4629
|
" SOL"
|
|
4638
4630
|
] })
|
|
@@ -4640,24 +4632,24 @@ function CreateCustomGameSheet({
|
|
|
4640
4632
|
amount
|
|
4641
4633
|
);
|
|
4642
4634
|
}),
|
|
4643
|
-
/* @__PURE__ */
|
|
4644
|
-
|
|
4635
|
+
/* @__PURE__ */ jsx14(
|
|
4636
|
+
TouchableOpacity8,
|
|
4645
4637
|
{
|
|
4646
4638
|
style: [
|
|
4647
|
-
|
|
4639
|
+
styles11.chip,
|
|
4648
4640
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4649
4641
|
isCustom && { backgroundColor: t.accent }
|
|
4650
4642
|
],
|
|
4651
4643
|
onPress: handleCustomSelect,
|
|
4652
4644
|
activeOpacity: 0.8,
|
|
4653
|
-
children: /* @__PURE__ */
|
|
4645
|
+
children: /* @__PURE__ */ jsx14(Text12, { style: [styles11.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4654
4646
|
}
|
|
4655
4647
|
)
|
|
4656
4648
|
] }),
|
|
4657
|
-
isCustom && /* @__PURE__ */
|
|
4649
|
+
isCustom && /* @__PURE__ */ jsx14(
|
|
4658
4650
|
TextInput2,
|
|
4659
4651
|
{
|
|
4660
|
-
style: [
|
|
4652
|
+
style: [styles11.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4661
4653
|
placeholder: "Enter amount in SOL",
|
|
4662
4654
|
placeholderTextColor: t.textDim,
|
|
4663
4655
|
keyboardType: "decimal-pad",
|
|
@@ -4667,43 +4659,43 @@ function CreateCustomGameSheet({
|
|
|
4667
4659
|
}
|
|
4668
4660
|
)
|
|
4669
4661
|
] }),
|
|
4670
|
-
/* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4672
|
-
/* @__PURE__ */
|
|
4673
|
-
/* @__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" })
|
|
4674
4666
|
] }),
|
|
4675
|
-
/* @__PURE__ */
|
|
4676
|
-
/* @__PURE__ */
|
|
4677
|
-
/* @__PURE__ */
|
|
4678
|
-
/* @__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 })
|
|
4679
4671
|
] }),
|
|
4680
|
-
/* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4682
|
-
/* @__PURE__ */
|
|
4683
|
-
/* @__PURE__ */
|
|
4684
|
-
/* @__PURE__ */
|
|
4685
|
-
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: [
|
|
4686
4678
|
fee,
|
|
4687
4679
|
"% platform fee"
|
|
4688
4680
|
] }) : null
|
|
4689
4681
|
] })
|
|
4690
4682
|
] })
|
|
4691
4683
|
] }),
|
|
4692
|
-
mutation.error && /* @__PURE__ */
|
|
4693
|
-
/* @__PURE__ */
|
|
4694
|
-
|
|
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,
|
|
4695
4687
|
{
|
|
4696
4688
|
style: [
|
|
4697
|
-
|
|
4689
|
+
styles11.ctaButton,
|
|
4698
4690
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4699
4691
|
],
|
|
4700
4692
|
disabled: !canCreate,
|
|
4701
4693
|
onPress: handleCreate,
|
|
4702
4694
|
activeOpacity: 0.8,
|
|
4703
|
-
children: isMutating ? /* @__PURE__ */
|
|
4704
|
-
/* @__PURE__ */
|
|
4705
|
-
/* @__PURE__ */
|
|
4706
|
-
] }) : 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" })
|
|
4707
4699
|
}
|
|
4708
4700
|
)
|
|
4709
4701
|
] }) })
|
|
@@ -4713,9 +4705,9 @@ function CreateCustomGameSheet({
|
|
|
4713
4705
|
}
|
|
4714
4706
|
);
|
|
4715
4707
|
}
|
|
4716
|
-
var
|
|
4708
|
+
var styles11 = StyleSheet12.create({
|
|
4717
4709
|
overlay: {
|
|
4718
|
-
...
|
|
4710
|
+
...StyleSheet12.absoluteFillObject,
|
|
4719
4711
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4720
4712
|
},
|
|
4721
4713
|
overlayTap: {
|
|
@@ -4852,17 +4844,17 @@ var styles10 = StyleSheet11.create({
|
|
|
4852
4844
|
// src/ui/game/JoinGameSheet.tsx
|
|
4853
4845
|
import { useState as useState22, useEffect as useEffect14, useRef as useRef7, useCallback as useCallback18, useMemo as useMemo8 } from "react";
|
|
4854
4846
|
import {
|
|
4855
|
-
View as
|
|
4856
|
-
Text as
|
|
4857
|
-
TouchableOpacity as
|
|
4847
|
+
View as View13,
|
|
4848
|
+
Text as Text13,
|
|
4849
|
+
TouchableOpacity as TouchableOpacity9,
|
|
4858
4850
|
ActivityIndicator as ActivityIndicator7,
|
|
4859
4851
|
Modal as Modal3,
|
|
4860
4852
|
Animated as Animated4,
|
|
4861
|
-
StyleSheet as
|
|
4853
|
+
StyleSheet as StyleSheet13,
|
|
4862
4854
|
KeyboardAvoidingView as KeyboardAvoidingView4,
|
|
4863
4855
|
Platform as Platform7
|
|
4864
4856
|
} from "react-native";
|
|
4865
|
-
import { Fragment as Fragment4, jsx as
|
|
4857
|
+
import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
4866
4858
|
var STATUS_LABELS3 = {
|
|
4867
4859
|
building: "Building transaction...",
|
|
4868
4860
|
signing: "Approve in wallet...",
|
|
@@ -4953,7 +4945,7 @@ function JoinGameSheet({
|
|
|
4953
4945
|
}
|
|
4954
4946
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4955
4947
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4956
|
-
return /* @__PURE__ */
|
|
4948
|
+
return /* @__PURE__ */ jsxs13(
|
|
4957
4949
|
Modal3,
|
|
4958
4950
|
{
|
|
4959
4951
|
visible,
|
|
@@ -4961,22 +4953,22 @@ function JoinGameSheet({
|
|
|
4961
4953
|
transparent: true,
|
|
4962
4954
|
onRequestClose: onDismiss,
|
|
4963
4955
|
children: [
|
|
4964
|
-
/* @__PURE__ */
|
|
4965
|
-
/* @__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(
|
|
4966
4958
|
KeyboardAvoidingView4,
|
|
4967
4959
|
{
|
|
4968
|
-
style:
|
|
4960
|
+
style: styles12.keyboardView,
|
|
4969
4961
|
behavior: Platform7.OS === "ios" ? "padding" : void 0,
|
|
4970
|
-
children: /* @__PURE__ */
|
|
4971
|
-
/* @__PURE__ */
|
|
4972
|
-
/* @__PURE__ */
|
|
4973
|
-
/* @__PURE__ */
|
|
4974
|
-
/* @__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" }) })
|
|
4975
4967
|
] }),
|
|
4976
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */
|
|
4977
|
-
/* @__PURE__ */
|
|
4978
|
-
/* @__PURE__ */
|
|
4979
|
-
/* @__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(
|
|
4980
4972
|
TeamButton,
|
|
4981
4973
|
{
|
|
4982
4974
|
name: homeName,
|
|
@@ -4990,7 +4982,7 @@ function JoinGameSheet({
|
|
|
4990
4982
|
t
|
|
4991
4983
|
}
|
|
4992
4984
|
),
|
|
4993
|
-
/* @__PURE__ */
|
|
4985
|
+
/* @__PURE__ */ jsx15(
|
|
4994
4986
|
TeamButton,
|
|
4995
4987
|
{
|
|
4996
4988
|
name: awayName,
|
|
@@ -5006,64 +4998,64 @@ function JoinGameSheet({
|
|
|
5006
4998
|
)
|
|
5007
4999
|
] })
|
|
5008
5000
|
] }),
|
|
5009
|
-
/* @__PURE__ */
|
|
5010
|
-
/* @__PURE__ */
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
/* @__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: [
|
|
5013
5005
|
buyIn,
|
|
5014
5006
|
" SOL"
|
|
5015
5007
|
] })
|
|
5016
5008
|
] }),
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
isPoolModeEnabled ? /* @__PURE__ */
|
|
5019
|
-
/* @__PURE__ */
|
|
5020
|
-
/* @__PURE__ */
|
|
5021
|
-
/* @__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 })
|
|
5022
5014
|
] }),
|
|
5023
|
-
/* @__PURE__ */
|
|
5024
|
-
/* @__PURE__ */
|
|
5025
|
-
/* @__PURE__ */
|
|
5026
|
-
/* @__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: [
|
|
5027
5019
|
totalPool,
|
|
5028
5020
|
" SOL"
|
|
5029
5021
|
] })
|
|
5030
5022
|
] })
|
|
5031
|
-
] }) : /* @__PURE__ */
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
5034
|
-
/* @__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 })
|
|
5035
5027
|
] }),
|
|
5036
|
-
/* @__PURE__ */
|
|
5037
|
-
/* @__PURE__ */
|
|
5038
|
-
/* @__PURE__ */
|
|
5039
|
-
/* @__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: [
|
|
5040
5032
|
poolAfterJoin,
|
|
5041
5033
|
" SOL"
|
|
5042
5034
|
] })
|
|
5043
5035
|
] }),
|
|
5044
|
-
/* @__PURE__ */
|
|
5045
|
-
/* @__PURE__ */
|
|
5046
|
-
/* @__PURE__ */
|
|
5047
|
-
/* @__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" })
|
|
5048
5040
|
] })
|
|
5049
5041
|
] })
|
|
5050
5042
|
] }),
|
|
5051
|
-
alreadyJoined && /* @__PURE__ */
|
|
5052
|
-
mutation.error && /* @__PURE__ */
|
|
5053
|
-
/* @__PURE__ */
|
|
5054
|
-
|
|
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,
|
|
5055
5047
|
{
|
|
5056
5048
|
style: [
|
|
5057
|
-
|
|
5049
|
+
styles12.ctaButton,
|
|
5058
5050
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5059
5051
|
],
|
|
5060
5052
|
disabled: !canJoin,
|
|
5061
5053
|
onPress: handleJoin,
|
|
5062
5054
|
activeOpacity: 0.8,
|
|
5063
|
-
children: isMutating ? /* @__PURE__ */
|
|
5064
|
-
/* @__PURE__ */
|
|
5065
|
-
/* @__PURE__ */
|
|
5066
|
-
] }) : 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" })
|
|
5067
5059
|
}
|
|
5068
5060
|
)
|
|
5069
5061
|
] }) })
|
|
@@ -5087,32 +5079,32 @@ function TeamButton({
|
|
|
5087
5079
|
const [imgFailed, setImgFailed] = useState22(false);
|
|
5088
5080
|
const Img = ImageComponent || __require("react-native").Image;
|
|
5089
5081
|
const showImage = imageUrl && !imgFailed;
|
|
5090
|
-
return /* @__PURE__ */
|
|
5091
|
-
|
|
5082
|
+
return /* @__PURE__ */ jsxs13(
|
|
5083
|
+
TouchableOpacity9,
|
|
5092
5084
|
{
|
|
5093
|
-
style: [
|
|
5085
|
+
style: [styles12.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5094
5086
|
onPress,
|
|
5095
5087
|
activeOpacity: 0.7,
|
|
5096
5088
|
children: [
|
|
5097
|
-
showImage ? /* @__PURE__ */
|
|
5098
|
-
/* @__PURE__ */
|
|
5099
|
-
/* @__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: [
|
|
5100
5092
|
odds,
|
|
5101
5093
|
"x"
|
|
5102
5094
|
] }),
|
|
5103
|
-
/* @__PURE__ */
|
|
5095
|
+
/* @__PURE__ */ jsxs13(Text13, { style: [styles12.teamBets, { color: t.textMuted }], children: [
|
|
5104
5096
|
bets,
|
|
5105
5097
|
" ",
|
|
5106
5098
|
bets === 1 ? "bet" : "bets"
|
|
5107
5099
|
] }),
|
|
5108
|
-
selected && /* @__PURE__ */
|
|
5100
|
+
selected && /* @__PURE__ */ jsx15(View13, { style: [styles12.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ jsx15(Text13, { style: styles12.teamBadgeText, children: "Selected" }) })
|
|
5109
5101
|
]
|
|
5110
5102
|
}
|
|
5111
5103
|
);
|
|
5112
5104
|
}
|
|
5113
|
-
var
|
|
5105
|
+
var styles12 = StyleSheet13.create({
|
|
5114
5106
|
overlay: {
|
|
5115
|
-
...
|
|
5107
|
+
...StyleSheet13.absoluteFillObject,
|
|
5116
5108
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5117
5109
|
},
|
|
5118
5110
|
overlayTap: {
|
|
@@ -5263,17 +5255,17 @@ var styles11 = StyleSheet12.create({
|
|
|
5263
5255
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5264
5256
|
import { useState as useState23, useEffect as useEffect15, useRef as useRef8, useCallback as useCallback19 } from "react";
|
|
5265
5257
|
import {
|
|
5266
|
-
View as
|
|
5267
|
-
Text as
|
|
5268
|
-
TouchableOpacity as
|
|
5258
|
+
View as View14,
|
|
5259
|
+
Text as Text14,
|
|
5260
|
+
TouchableOpacity as TouchableOpacity10,
|
|
5269
5261
|
ActivityIndicator as ActivityIndicator8,
|
|
5270
5262
|
Modal as Modal4,
|
|
5271
5263
|
Animated as Animated5,
|
|
5272
|
-
StyleSheet as
|
|
5264
|
+
StyleSheet as StyleSheet14,
|
|
5273
5265
|
KeyboardAvoidingView as KeyboardAvoidingView5,
|
|
5274
5266
|
Platform as Platform8
|
|
5275
5267
|
} from "react-native";
|
|
5276
|
-
import { jsx as
|
|
5268
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5277
5269
|
var STATUS_LABELS4 = {
|
|
5278
5270
|
building: "Building transaction...",
|
|
5279
5271
|
signing: "Approve in wallet...",
|
|
@@ -5353,7 +5345,7 @@ function ClaimPrizeSheet({
|
|
|
5353
5345
|
}
|
|
5354
5346
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5355
5347
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5356
|
-
return /* @__PURE__ */
|
|
5348
|
+
return /* @__PURE__ */ jsxs14(
|
|
5357
5349
|
Modal4,
|
|
5358
5350
|
{
|
|
5359
5351
|
visible,
|
|
@@ -5361,54 +5353,54 @@ function ClaimPrizeSheet({
|
|
|
5361
5353
|
transparent: true,
|
|
5362
5354
|
onRequestClose: onDismiss,
|
|
5363
5355
|
children: [
|
|
5364
|
-
/* @__PURE__ */
|
|
5365
|
-
/* @__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(
|
|
5366
5358
|
KeyboardAvoidingView5,
|
|
5367
5359
|
{
|
|
5368
|
-
style:
|
|
5360
|
+
style: styles13.keyboardView,
|
|
5369
5361
|
behavior: Platform8.OS === "ios" ? "padding" : void 0,
|
|
5370
|
-
children: /* @__PURE__ */
|
|
5371
|
-
/* @__PURE__ */
|
|
5372
|
-
/* @__PURE__ */
|
|
5373
|
-
/* @__PURE__ */
|
|
5374
|
-
/* @__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" }) })
|
|
5375
5367
|
] }),
|
|
5376
|
-
showCelebration && /* @__PURE__ */
|
|
5368
|
+
showCelebration && /* @__PURE__ */ jsxs14(
|
|
5377
5369
|
Animated5.View,
|
|
5378
5370
|
{
|
|
5379
5371
|
style: [
|
|
5380
|
-
|
|
5372
|
+
styles13.celebrationContainer,
|
|
5381
5373
|
{
|
|
5382
5374
|
opacity: celebrationOpacity,
|
|
5383
5375
|
transform: [{ scale: celebrationScale }]
|
|
5384
5376
|
}
|
|
5385
5377
|
],
|
|
5386
5378
|
children: [
|
|
5387
|
-
/* @__PURE__ */
|
|
5388
|
-
/* @__PURE__ */
|
|
5379
|
+
/* @__PURE__ */ jsx16(Text14, { style: styles13.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5380
|
+
/* @__PURE__ */ jsxs14(Text14, { style: [styles13.celebrationText, { color: t.success }], children: [
|
|
5389
5381
|
"+",
|
|
5390
5382
|
prizeAmount,
|
|
5391
5383
|
" SOL"
|
|
5392
5384
|
] }),
|
|
5393
|
-
/* @__PURE__ */
|
|
5385
|
+
/* @__PURE__ */ jsx16(Text14, { style: [styles13.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5394
5386
|
]
|
|
5395
5387
|
}
|
|
5396
5388
|
),
|
|
5397
|
-
!showCelebration && /* @__PURE__ */
|
|
5398
|
-
/* @__PURE__ */
|
|
5399
|
-
/* @__PURE__ */
|
|
5400
|
-
/* @__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: [
|
|
5401
5393
|
prizeAmount,
|
|
5402
5394
|
" SOL"
|
|
5403
5395
|
] })
|
|
5404
5396
|
] }),
|
|
5405
|
-
/* @__PURE__ */
|
|
5406
|
-
/* @__PURE__ */
|
|
5407
|
-
/* @__PURE__ */
|
|
5408
|
-
/* @__PURE__ */
|
|
5409
|
-
|
|
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,
|
|
5410
5402
|
{
|
|
5411
|
-
style: [
|
|
5403
|
+
style: [styles13.summaryValue, { color: t.text }],
|
|
5412
5404
|
numberOfLines: 1,
|
|
5413
5405
|
children: [
|
|
5414
5406
|
gameId.slice(0, 8),
|
|
@@ -5419,21 +5411,21 @@ function ClaimPrizeSheet({
|
|
|
5419
5411
|
)
|
|
5420
5412
|
] })
|
|
5421
5413
|
] }),
|
|
5422
|
-
mutation.error && /* @__PURE__ */
|
|
5423
|
-
!showCelebration && /* @__PURE__ */
|
|
5424
|
-
|
|
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,
|
|
5425
5417
|
{
|
|
5426
5418
|
style: [
|
|
5427
|
-
|
|
5419
|
+
styles13.ctaButton,
|
|
5428
5420
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5429
5421
|
],
|
|
5430
5422
|
disabled: !canClaim,
|
|
5431
5423
|
onPress: handleClaim,
|
|
5432
5424
|
activeOpacity: 0.8,
|
|
5433
|
-
children: isMutating ? /* @__PURE__ */
|
|
5434
|
-
/* @__PURE__ */
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
] }) : /* @__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: [
|
|
5437
5429
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5438
5430
|
" \u2014 ",
|
|
5439
5431
|
prizeAmount,
|
|
@@ -5441,7 +5433,7 @@ function ClaimPrizeSheet({
|
|
|
5441
5433
|
] })
|
|
5442
5434
|
}
|
|
5443
5435
|
),
|
|
5444
|
-
mutation.data?.explorerUrl && /* @__PURE__ */
|
|
5436
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ jsx16(Text14, { style: [styles13.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5445
5437
|
] }) })
|
|
5446
5438
|
}
|
|
5447
5439
|
)
|
|
@@ -5449,9 +5441,9 @@ function ClaimPrizeSheet({
|
|
|
5449
5441
|
}
|
|
5450
5442
|
);
|
|
5451
5443
|
}
|
|
5452
|
-
var
|
|
5444
|
+
var styles13 = StyleSheet14.create({
|
|
5453
5445
|
overlay: {
|
|
5454
|
-
...
|
|
5446
|
+
...StyleSheet14.absoluteFillObject,
|
|
5455
5447
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5456
5448
|
},
|
|
5457
5449
|
overlayTap: {
|
|
@@ -5575,8 +5567,8 @@ var styles12 = StyleSheet13.create({
|
|
|
5575
5567
|
|
|
5576
5568
|
// src/ui/game/ClaimButton.tsx
|
|
5577
5569
|
import { useState as useState24, useMemo as useMemo9, useCallback as useCallback20 } from "react";
|
|
5578
|
-
import { StyleSheet as
|
|
5579
|
-
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";
|
|
5580
5572
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5581
5573
|
const t = useDubsTheme();
|
|
5582
5574
|
const { wallet } = useDubs();
|
|
@@ -5606,13 +5598,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5606
5598
|
}
|
|
5607
5599
|
const label = isRefund ? "Refund" : "Prize";
|
|
5608
5600
|
if (claimStatus.hasClaimed) {
|
|
5609
|
-
return /* @__PURE__ */
|
|
5610
|
-
|
|
5601
|
+
return /* @__PURE__ */ jsx17(
|
|
5602
|
+
TouchableOpacity11,
|
|
5611
5603
|
{
|
|
5612
|
-
style: [
|
|
5604
|
+
style: [styles14.badge, { borderColor: t.accent }, style],
|
|
5613
5605
|
activeOpacity: 1,
|
|
5614
5606
|
disabled: true,
|
|
5615
|
-
children: /* @__PURE__ */
|
|
5607
|
+
children: /* @__PURE__ */ jsxs15(Text15, { style: [styles14.badgeText, { color: t.accent }], children: [
|
|
5616
5608
|
label,
|
|
5617
5609
|
" Claimed!"
|
|
5618
5610
|
] })
|
|
@@ -5622,14 +5614,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5622
5614
|
if (!isEligible) {
|
|
5623
5615
|
return null;
|
|
5624
5616
|
}
|
|
5625
|
-
return /* @__PURE__ */
|
|
5626
|
-
/* @__PURE__ */
|
|
5627
|
-
|
|
5617
|
+
return /* @__PURE__ */ jsxs15(Fragment5, { children: [
|
|
5618
|
+
/* @__PURE__ */ jsx17(
|
|
5619
|
+
TouchableOpacity11,
|
|
5628
5620
|
{
|
|
5629
|
-
style: [
|
|
5621
|
+
style: [styles14.button, { backgroundColor: t.accent }, style],
|
|
5630
5622
|
activeOpacity: 0.8,
|
|
5631
5623
|
onPress: () => setSheetVisible(true),
|
|
5632
|
-
children: /* @__PURE__ */
|
|
5624
|
+
children: /* @__PURE__ */ jsxs15(Text15, { style: styles14.buttonText, children: [
|
|
5633
5625
|
"Claim ",
|
|
5634
5626
|
label,
|
|
5635
5627
|
" \u2014 ",
|
|
@@ -5638,7 +5630,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5638
5630
|
] })
|
|
5639
5631
|
}
|
|
5640
5632
|
),
|
|
5641
|
-
/* @__PURE__ */
|
|
5633
|
+
/* @__PURE__ */ jsx17(
|
|
5642
5634
|
ClaimPrizeSheet,
|
|
5643
5635
|
{
|
|
5644
5636
|
visible: sheetVisible,
|
|
@@ -5652,7 +5644,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5652
5644
|
)
|
|
5653
5645
|
] });
|
|
5654
5646
|
}
|
|
5655
|
-
var
|
|
5647
|
+
var styles14 = StyleSheet15.create({
|
|
5656
5648
|
button: {
|
|
5657
5649
|
height: 52,
|
|
5658
5650
|
borderRadius: 14,
|