@dubsdotapp/expo 0.2.76 → 0.2.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +678 -612
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +660 -587
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/AuthGate.tsx +14 -31
- package/src/ui/AvatarEditor.tsx +159 -0
- package/src/ui/UserProfileSheet.tsx +31 -104
package/dist/index.js
CHANGED
|
@@ -1695,7 +1695,7 @@ function ManagedWalletProvider({
|
|
|
1695
1695
|
|
|
1696
1696
|
// src/ui/AuthGate.tsx
|
|
1697
1697
|
var import_react17 = __toESM(require("react"));
|
|
1698
|
-
var
|
|
1698
|
+
var import_react_native8 = require("react-native");
|
|
1699
1699
|
|
|
1700
1700
|
// src/hooks/useEvents.ts
|
|
1701
1701
|
var import_react3 = require("react");
|
|
@@ -2526,7 +2526,8 @@ function usePushNotifications() {
|
|
|
2526
2526
|
};
|
|
2527
2527
|
}
|
|
2528
2528
|
|
|
2529
|
-
// src/ui/
|
|
2529
|
+
// src/ui/AvatarEditor.tsx
|
|
2530
|
+
var import_react_native7 = require("react-native");
|
|
2530
2531
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
2531
2532
|
var DICEBEAR_STYLES = [
|
|
2532
2533
|
"adventurer",
|
|
@@ -2536,12 +2537,143 @@ var DICEBEAR_STYLES = [
|
|
|
2536
2537
|
"big-smile",
|
|
2537
2538
|
"thumbs"
|
|
2538
2539
|
];
|
|
2540
|
+
var BG_COLORS = [
|
|
2541
|
+
"1a1a2e",
|
|
2542
|
+
"f43f5e",
|
|
2543
|
+
"f97316",
|
|
2544
|
+
"eab308",
|
|
2545
|
+
"22c55e",
|
|
2546
|
+
"3b82f6",
|
|
2547
|
+
"8b5cf6",
|
|
2548
|
+
"ec4899",
|
|
2549
|
+
"06b6d4",
|
|
2550
|
+
"64748b"
|
|
2551
|
+
];
|
|
2539
2552
|
function generateSeed() {
|
|
2540
2553
|
return Math.random().toString(36).slice(2, 10);
|
|
2541
2554
|
}
|
|
2542
|
-
function getAvatarUrl(style, seed, size = 256) {
|
|
2543
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&size=${size}`;
|
|
2555
|
+
function getAvatarUrl(style, seed, bg = "1a1a2e", size = 256) {
|
|
2556
|
+
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&backgroundColor=${bg}&size=${size}`;
|
|
2544
2557
|
}
|
|
2558
|
+
function parseAvatarUrl(url) {
|
|
2559
|
+
if (!url) return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2560
|
+
try {
|
|
2561
|
+
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
2562
|
+
if (match) {
|
|
2563
|
+
const bgMatch = url.match(/backgroundColor=([^&]+)/);
|
|
2564
|
+
return { style: match[1], seed: match[2], bg: bgMatch?.[1] || "1a1a2e" };
|
|
2565
|
+
}
|
|
2566
|
+
} catch {
|
|
2567
|
+
}
|
|
2568
|
+
return { style: "adventurer", seed: generateSeed(), bg: "1a1a2e" };
|
|
2569
|
+
}
|
|
2570
|
+
function AvatarEditor({
|
|
2571
|
+
style: avatarStyle,
|
|
2572
|
+
seed: avatarSeed,
|
|
2573
|
+
bg: bgColor,
|
|
2574
|
+
onStyleChange,
|
|
2575
|
+
onSeedChange,
|
|
2576
|
+
onBgChange,
|
|
2577
|
+
disabled = false,
|
|
2578
|
+
accentColor
|
|
2579
|
+
}) {
|
|
2580
|
+
const t = useDubsTheme();
|
|
2581
|
+
const accent = accentColor || t.accent;
|
|
2582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native7.View, { style: styles2.container, children: [
|
|
2583
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2584
|
+
import_react_native7.ScrollView,
|
|
2585
|
+
{
|
|
2586
|
+
horizontal: true,
|
|
2587
|
+
showsHorizontalScrollIndicator: false,
|
|
2588
|
+
contentContainerStyle: styles2.row,
|
|
2589
|
+
children: DICEBEAR_STYLES.map((st) => {
|
|
2590
|
+
const isSelected = st === avatarStyle;
|
|
2591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2592
|
+
import_react_native7.TouchableOpacity,
|
|
2593
|
+
{
|
|
2594
|
+
onPress: () => onStyleChange(st),
|
|
2595
|
+
activeOpacity: 0.7,
|
|
2596
|
+
disabled,
|
|
2597
|
+
style: [
|
|
2598
|
+
styles2.styleTile,
|
|
2599
|
+
{
|
|
2600
|
+
borderColor: isSelected ? accent : t.border,
|
|
2601
|
+
borderWidth: isSelected ? 2 : 1
|
|
2602
|
+
}
|
|
2603
|
+
],
|
|
2604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2605
|
+
import_react_native7.Image,
|
|
2606
|
+
{
|
|
2607
|
+
source: { uri: getAvatarUrl(st, avatarSeed, bgColor, 80) },
|
|
2608
|
+
style: styles2.styleTileImage
|
|
2609
|
+
}
|
|
2610
|
+
)
|
|
2611
|
+
},
|
|
2612
|
+
st
|
|
2613
|
+
);
|
|
2614
|
+
})
|
|
2615
|
+
}
|
|
2616
|
+
),
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native7.Text, { style: [styles2.label, { color: t.textSecondary }], children: "Background Color" }),
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2619
|
+
import_react_native7.ScrollView,
|
|
2620
|
+
{
|
|
2621
|
+
horizontal: true,
|
|
2622
|
+
showsHorizontalScrollIndicator: false,
|
|
2623
|
+
contentContainerStyle: styles2.row,
|
|
2624
|
+
children: BG_COLORS.map((color) => {
|
|
2625
|
+
const isSelected = color === bgColor;
|
|
2626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
2627
|
+
import_react_native7.TouchableOpacity,
|
|
2628
|
+
{
|
|
2629
|
+
onPress: () => onBgChange(color),
|
|
2630
|
+
activeOpacity: 0.7,
|
|
2631
|
+
disabled,
|
|
2632
|
+
style: [
|
|
2633
|
+
styles2.colorSwatch,
|
|
2634
|
+
{ backgroundColor: `#${color}` },
|
|
2635
|
+
isSelected && { borderColor: accent, borderWidth: 2.5 }
|
|
2636
|
+
]
|
|
2637
|
+
},
|
|
2638
|
+
color
|
|
2639
|
+
);
|
|
2640
|
+
})
|
|
2641
|
+
}
|
|
2642
|
+
)
|
|
2643
|
+
] });
|
|
2644
|
+
}
|
|
2645
|
+
var styles2 = import_react_native7.StyleSheet.create({
|
|
2646
|
+
container: {
|
|
2647
|
+
gap: 10
|
|
2648
|
+
},
|
|
2649
|
+
row: {
|
|
2650
|
+
gap: 10
|
|
2651
|
+
},
|
|
2652
|
+
label: {
|
|
2653
|
+
fontSize: 14,
|
|
2654
|
+
fontWeight: "600"
|
|
2655
|
+
},
|
|
2656
|
+
styleTile: {
|
|
2657
|
+
width: 72,
|
|
2658
|
+
height: 72,
|
|
2659
|
+
borderRadius: 16,
|
|
2660
|
+
overflow: "hidden"
|
|
2661
|
+
},
|
|
2662
|
+
styleTileImage: {
|
|
2663
|
+
width: "100%",
|
|
2664
|
+
height: "100%"
|
|
2665
|
+
},
|
|
2666
|
+
colorSwatch: {
|
|
2667
|
+
width: 32,
|
|
2668
|
+
height: 32,
|
|
2669
|
+
borderRadius: 16,
|
|
2670
|
+
borderWidth: 1.5,
|
|
2671
|
+
borderColor: "rgba(255,255,255,0.15)"
|
|
2672
|
+
}
|
|
2673
|
+
});
|
|
2674
|
+
|
|
2675
|
+
// src/ui/AuthGate.tsx
|
|
2676
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2545
2677
|
function AuthGate({
|
|
2546
2678
|
children,
|
|
2547
2679
|
onSaveToken,
|
|
@@ -2608,12 +2740,12 @@ function AuthGate({
|
|
|
2608
2740
|
[auth]
|
|
2609
2741
|
);
|
|
2610
2742
|
if (phase === "init") {
|
|
2611
|
-
if (renderLoading) return /* @__PURE__ */ (0,
|
|
2612
|
-
return /* @__PURE__ */ (0,
|
|
2743
|
+
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading("authenticating") });
|
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: "authenticating", appName, accentColor });
|
|
2613
2745
|
}
|
|
2614
2746
|
if (auth.status === "authenticated") {
|
|
2615
2747
|
if (showPushSetup) {
|
|
2616
|
-
return /* @__PURE__ */ (0,
|
|
2748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2617
2749
|
PushSetupScreen,
|
|
2618
2750
|
{
|
|
2619
2751
|
accentColor,
|
|
@@ -2622,8 +2754,8 @@ function AuthGate({
|
|
|
2622
2754
|
}
|
|
2623
2755
|
);
|
|
2624
2756
|
}
|
|
2625
|
-
return /* @__PURE__ */ (0,
|
|
2626
|
-
pushEnabled && /* @__PURE__ */ (0,
|
|
2757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(AuthContext.Provider, { value: auth, children: [
|
|
2758
|
+
pushEnabled && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PushTokenRestorer, {}),
|
|
2627
2759
|
children
|
|
2628
2760
|
] });
|
|
2629
2761
|
}
|
|
@@ -2631,9 +2763,9 @@ function AuthGate({
|
|
|
2631
2763
|
const isRegistering = auth.status === "registering";
|
|
2632
2764
|
const regError = auth.status === "error" ? auth.error : null;
|
|
2633
2765
|
if (renderRegistration) {
|
|
2634
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderRegistration({ onRegister: handleRegister, registering: isRegistering, error: regError, client }) });
|
|
2635
2767
|
}
|
|
2636
|
-
return /* @__PURE__ */ (0,
|
|
2768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2637
2769
|
DefaultRegistrationScreen,
|
|
2638
2770
|
{
|
|
2639
2771
|
onRegister: handleRegister,
|
|
@@ -2646,11 +2778,11 @@ function AuthGate({
|
|
|
2646
2778
|
);
|
|
2647
2779
|
}
|
|
2648
2780
|
if (auth.status === "error" && auth.error) {
|
|
2649
|
-
if (renderError) return /* @__PURE__ */ (0,
|
|
2650
|
-
return /* @__PURE__ */ (0,
|
|
2781
|
+
if (renderError) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderError(auth.error, retry) });
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultErrorScreen, { error: auth.error, onRetry: retry, appName, accentColor });
|
|
2651
2783
|
}
|
|
2652
|
-
if (renderLoading) return /* @__PURE__ */ (0,
|
|
2653
|
-
return /* @__PURE__ */ (0,
|
|
2784
|
+
if (renderLoading) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: renderLoading(auth.status) });
|
|
2785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DefaultLoadingScreen, { status: auth.status, appName, accentColor });
|
|
2654
2786
|
}
|
|
2655
2787
|
function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
2656
2788
|
const t = useDubsTheme();
|
|
@@ -2665,44 +2797,44 @@ function DefaultLoadingScreen({ status, appName, accentColor }) {
|
|
|
2665
2797
|
authenticated: "Ready!",
|
|
2666
2798
|
error: "Something went wrong"
|
|
2667
2799
|
};
|
|
2668
|
-
return /* @__PURE__ */ (0,
|
|
2669
|
-
/* @__PURE__ */ (0,
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.centerContent, children: [
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.brandingSection, children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.logoText, children: "D" }) }),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2672
2804
|
] }),
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
/* @__PURE__ */ (0,
|
|
2675
|
-
/* @__PURE__ */ (0,
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.loadingSection, children: [
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { size: "large", color: accent }),
|
|
2807
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.statusText, { color: t.textMuted }], children: statusText[status] || "Loading..." })
|
|
2676
2808
|
] })
|
|
2677
2809
|
] }) });
|
|
2678
2810
|
}
|
|
2679
2811
|
function DefaultErrorScreen({ error, onRetry, appName, accentColor }) {
|
|
2680
2812
|
const t = useDubsTheme();
|
|
2681
2813
|
const accent = accentColor || t.accent;
|
|
2682
|
-
return /* @__PURE__ */ (0,
|
|
2683
|
-
/* @__PURE__ */ (0,
|
|
2684
|
-
/* @__PURE__ */ (0,
|
|
2685
|
-
/* @__PURE__ */ (0,
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.spreadContent, children: [
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.brandingSection, children: [
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.logoCircle, { backgroundColor: accent }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.logoText, children: "D" }) }),
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.appNameText, { color: t.text }], children: appName })
|
|
2686
2818
|
] }),
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2688
|
-
/* @__PURE__ */ (0,
|
|
2689
|
-
/* @__PURE__ */ (0,
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: { gap: 16 }, children: [
|
|
2820
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.errorText, { color: t.errorText }], children: error.message }) }),
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { style: [s.primaryBtn, { backgroundColor: accent }], onPress: onRetry, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Try Again" }) })
|
|
2690
2822
|
] })
|
|
2691
2823
|
] }) });
|
|
2692
2824
|
}
|
|
2693
2825
|
function StepIndicator({ currentStep }) {
|
|
2694
2826
|
const t = useDubsTheme();
|
|
2695
2827
|
const steps = [0, 1, 2, 3];
|
|
2696
|
-
return /* @__PURE__ */ (0,
|
|
2697
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2699
|
-
|
|
2828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.stepRow, children: steps.map((i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react17.default.Fragment, { children: [
|
|
2829
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.stepLine, { backgroundColor: i <= currentStep ? t.success : t.border }] }),
|
|
2830
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2831
|
+
import_react_native8.View,
|
|
2700
2832
|
{
|
|
2701
2833
|
style: [
|
|
2702
2834
|
s.stepCircle,
|
|
2703
2835
|
i < currentStep ? { backgroundColor: t.success } : i === currentStep ? { backgroundColor: t.accent } : { backgroundColor: "transparent", borderWidth: 2, borderColor: t.border }
|
|
2704
2836
|
],
|
|
2705
|
-
children: i < currentStep ? /* @__PURE__ */ (0,
|
|
2837
|
+
children: i < currentStep ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.stepCheck, children: "\u2713" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.stepNum, { color: i === currentStep ? "#FFF" : t.textMuted }], children: i + 1 })
|
|
2706
2838
|
}
|
|
2707
2839
|
)
|
|
2708
2840
|
] }, i)) });
|
|
@@ -2720,15 +2852,16 @@ function DefaultRegistrationScreen({
|
|
|
2720
2852
|
const [step, setStep] = (0, import_react17.useState)(0);
|
|
2721
2853
|
const [avatarSeed, setAvatarSeed] = (0, import_react17.useState)(generateSeed);
|
|
2722
2854
|
const [avatarStyle, setAvatarStyle] = (0, import_react17.useState)("adventurer");
|
|
2855
|
+
const [avatarBg, setAvatarBg] = (0, import_react17.useState)("1a1a2e");
|
|
2723
2856
|
const [showStyles, setShowStyles] = (0, import_react17.useState)(false);
|
|
2724
2857
|
const [username, setUsername] = (0, import_react17.useState)("");
|
|
2725
2858
|
const [referralCode, setReferralCode] = (0, import_react17.useState)("");
|
|
2726
2859
|
const [checking, setChecking] = (0, import_react17.useState)(false);
|
|
2727
2860
|
const [availability, setAvailability] = (0, import_react17.useState)(null);
|
|
2728
2861
|
const debounceRef = (0, import_react17.useRef)(null);
|
|
2729
|
-
const fadeAnim = (0, import_react17.useRef)(new
|
|
2730
|
-
const slideAnim = (0, import_react17.useRef)(new
|
|
2731
|
-
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed);
|
|
2862
|
+
const fadeAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(1)).current;
|
|
2863
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(0)).current;
|
|
2864
|
+
const avatarUrl = getAvatarUrl(avatarStyle, avatarSeed, avatarBg);
|
|
2732
2865
|
(0, import_react17.useEffect)(() => {
|
|
2733
2866
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
2734
2867
|
const trimmed = username.trim();
|
|
@@ -2754,92 +2887,95 @@ function DefaultRegistrationScreen({
|
|
|
2754
2887
|
}, [username, client]);
|
|
2755
2888
|
const animateToStep = (0, import_react17.useCallback)((newStep) => {
|
|
2756
2889
|
const dir = newStep > step ? 1 : -1;
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2890
|
+
import_react_native8.Keyboard.dismiss();
|
|
2891
|
+
import_react_native8.Animated.parallel([
|
|
2892
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 0, duration: 120, useNativeDriver: true }),
|
|
2893
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: -dir * 40, duration: 120, useNativeDriver: true })
|
|
2761
2894
|
]).start(() => {
|
|
2762
2895
|
setStep(newStep);
|
|
2763
2896
|
slideAnim.setValue(dir * 40);
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2897
|
+
import_react_native8.Animated.parallel([
|
|
2898
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 1, duration: 200, useNativeDriver: true }),
|
|
2899
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: 0, duration: 200, useNativeDriver: true })
|
|
2767
2900
|
]).start();
|
|
2768
2901
|
});
|
|
2769
2902
|
}, [step, fadeAnim, slideAnim]);
|
|
2770
2903
|
const canContinueUsername = username.trim().length >= 3 && availability?.available === true && !checking;
|
|
2771
2904
|
const handleSubmit = () => {
|
|
2772
|
-
|
|
2905
|
+
import_react_native8.Keyboard.dismiss();
|
|
2773
2906
|
onRegister(username.trim(), referralCode.trim() || void 0, avatarUrl);
|
|
2774
2907
|
};
|
|
2775
|
-
const renderAvatarStep = () => /* @__PURE__ */ (0,
|
|
2776
|
-
/* @__PURE__ */ (0,
|
|
2777
|
-
/* @__PURE__ */ (0,
|
|
2778
|
-
/* @__PURE__ */ (0,
|
|
2779
|
-
/* @__PURE__ */ (0,
|
|
2780
|
-
/* @__PURE__ */ (0,
|
|
2781
|
-
/* @__PURE__ */ (0,
|
|
2782
|
-
/* @__PURE__ */ (0,
|
|
2908
|
+
const renderAvatarStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.title, { color: t.text }], children: "Choose Your Avatar" }),
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Pick a look that represents you" }),
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 0 }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.avatarFrame, { borderColor: accent }], children: [
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.avatarLarge }),
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.checkBadge, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.checkBadgeText, children: "\u2713" }) })
|
|
2783
2916
|
] }) }),
|
|
2784
|
-
/* @__PURE__ */ (0,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
2786
|
-
|
|
2917
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.avatarActions, children: [
|
|
2918
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2919
|
+
import_react_native8.TouchableOpacity,
|
|
2787
2920
|
{
|
|
2788
2921
|
style: [s.outlineBtn, { borderColor: t.border }],
|
|
2789
2922
|
onPress: () => setAvatarSeed(generateSeed()),
|
|
2790
2923
|
activeOpacity: 0.7,
|
|
2791
|
-
children: /* @__PURE__ */ (0,
|
|
2924
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.outlineBtnText, { color: t.text }], children: "\u21BB Shuffle" })
|
|
2792
2925
|
}
|
|
2793
2926
|
),
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2928
|
+
import_react_native8.TouchableOpacity,
|
|
2796
2929
|
{
|
|
2797
2930
|
style: [s.outlineBtn, { borderColor: accent, backgroundColor: accent + "15" }],
|
|
2798
2931
|
onPress: () => setShowStyles(!showStyles),
|
|
2799
2932
|
activeOpacity: 0.7,
|
|
2800
|
-
children: /* @__PURE__ */ (0,
|
|
2933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.outlineBtnText, { color: accent }], children: "\u263A Customize" })
|
|
2801
2934
|
}
|
|
2802
2935
|
)
|
|
2803
2936
|
] }),
|
|
2804
|
-
showStyles && /* @__PURE__ */ (0,
|
|
2805
|
-
|
|
2937
|
+
showStyles && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.styleScroll, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2938
|
+
AvatarEditor,
|
|
2806
2939
|
{
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2940
|
+
style: avatarStyle,
|
|
2941
|
+
seed: avatarSeed,
|
|
2942
|
+
bg: avatarBg,
|
|
2943
|
+
onStyleChange: setAvatarStyle,
|
|
2944
|
+
onSeedChange: setAvatarSeed,
|
|
2945
|
+
onBgChange: setAvatarBg,
|
|
2946
|
+
accentColor: accent
|
|
2947
|
+
}
|
|
2948
|
+
) })
|
|
2813
2949
|
] }),
|
|
2814
|
-
/* @__PURE__ */ (0,
|
|
2815
|
-
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.bottomRow, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2951
|
+
import_react_native8.TouchableOpacity,
|
|
2816
2952
|
{
|
|
2817
2953
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1 }],
|
|
2818
2954
|
onPress: () => animateToStep(1),
|
|
2819
2955
|
activeOpacity: 0.8,
|
|
2820
|
-
children: /* @__PURE__ */ (0,
|
|
2956
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2821
2957
|
}
|
|
2822
2958
|
) })
|
|
2823
2959
|
] });
|
|
2824
|
-
const renderUsernameStep = () => /* @__PURE__ */ (0,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2827
|
-
/* @__PURE__ */ (0,
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
2960
|
+
const renderUsernameStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.headerRow, children: [
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { onPress: () => animateToStep(0), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
2964
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.titleInline, { color: t.text }], children: "Pick a Username" })
|
|
2829
2965
|
] }),
|
|
2830
|
-
/* @__PURE__ */ (0,
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2966
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "This is how others will see you" }),
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 1 }),
|
|
2968
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: s.avatarCenter, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.avatarFrameSmall, { borderColor: accent }], children: [
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.avatarSmall }),
|
|
2970
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.checkBadgeSm, { backgroundColor: t.success }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.checkBadgeTextSm, children: "\u2713" }) })
|
|
2835
2971
|
] }) }),
|
|
2836
|
-
/* @__PURE__ */ (0,
|
|
2837
|
-
/* @__PURE__ */ (0,
|
|
2972
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.inputGroup, children: [
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2838
2974
|
"Username ",
|
|
2839
|
-
/* @__PURE__ */ (0,
|
|
2975
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: { color: t.errorText }, children: "*" })
|
|
2840
2976
|
] }),
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
2842
|
-
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2978
|
+
import_react_native8.TextInput,
|
|
2843
2979
|
{
|
|
2844
2980
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: accent }],
|
|
2845
2981
|
placeholder: "Enter username",
|
|
@@ -2851,63 +2987,63 @@ function DefaultRegistrationScreen({
|
|
|
2851
2987
|
autoFocus: true
|
|
2852
2988
|
}
|
|
2853
2989
|
),
|
|
2854
|
-
checking ? /* @__PURE__ */ (0,
|
|
2990
|
+
checking ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: t.textDim }], children: "Checking..." }) : availability ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: availability.available ? t.success : t.errorText }], children: availability.available ? "\u2713 Available!" : availability.reason || "Username taken" }) : username.trim().length > 0 && username.trim().length < 3 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.hint, { color: t.textDim }], children: "At least 3 characters" }) : null
|
|
2855
2991
|
] })
|
|
2856
2992
|
] }),
|
|
2857
|
-
/* @__PURE__ */ (0,
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2995
|
+
import_react_native8.TouchableOpacity,
|
|
2860
2996
|
{
|
|
2861
2997
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2862
2998
|
onPress: () => animateToStep(0),
|
|
2863
2999
|
activeOpacity: 0.7,
|
|
2864
|
-
children: /* @__PURE__ */ (0,
|
|
3000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2865
3001
|
}
|
|
2866
3002
|
),
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2868
|
-
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3004
|
+
import_react_native8.TouchableOpacity,
|
|
2869
3005
|
{
|
|
2870
3006
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: canContinueUsername ? 1 : 0.4 }],
|
|
2871
3007
|
onPress: () => animateToStep(2),
|
|
2872
3008
|
disabled: !canContinueUsername,
|
|
2873
3009
|
activeOpacity: 0.8,
|
|
2874
|
-
children: /* @__PURE__ */ (0,
|
|
3010
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Continue \u203A" })
|
|
2875
3011
|
}
|
|
2876
3012
|
)
|
|
2877
3013
|
] })
|
|
2878
3014
|
] });
|
|
2879
|
-
const renderReferralStep = () => /* @__PURE__ */ (0,
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2881
|
-
/* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
3015
|
+
const renderReferralStep = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepContainer, children: [
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.headerRow, children: [
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.TouchableOpacity, { onPress: () => animateToStep(1), hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.backChevron, { color: t.text }], children: "\u2039" }) }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.titleInline, { color: t.text }], children: "Almost There!" })
|
|
2884
3020
|
] }),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
/* @__PURE__ */ (0,
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
3021
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Got a referral code? (optional)" }),
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 2 }),
|
|
3023
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: [s.profileCard, { borderColor: t.border }], children: [
|
|
3024
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.profileLabel, { color: t.textMuted }], children: "Your Profile" }),
|
|
3025
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.profileRow, children: [
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Image, { source: { uri: avatarUrl }, style: s.profileAvatar }),
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: { gap: 4 }, children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.profileUsername, { color: t.text }], children: [
|
|
2893
3029
|
"@",
|
|
2894
3030
|
username
|
|
2895
3031
|
] }),
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.profileReady, { color: t.success }], children: [
|
|
2897
3033
|
"\u2713",
|
|
2898
3034
|
" Ready to go!"
|
|
2899
3035
|
] })
|
|
2900
3036
|
] })
|
|
2901
3037
|
] })
|
|
2902
3038
|
] }),
|
|
2903
|
-
error ? /* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
3039
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.errorText, { color: t.errorText }], children: error.message }) }) : null,
|
|
3040
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.inputGroup, children: [
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.inputLabel, { color: t.text }], children: [
|
|
2906
3042
|
"Referral Code ",
|
|
2907
|
-
/* @__PURE__ */ (0,
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: { color: t.textMuted }, children: "(optional)" })
|
|
2908
3044
|
] }),
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
2910
|
-
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3046
|
+
import_react_native8.TextInput,
|
|
2911
3047
|
{
|
|
2912
3048
|
style: [s.input, { backgroundColor: t.surface, color: t.text, borderColor: t.border }],
|
|
2913
3049
|
placeholder: "Enter referral code",
|
|
@@ -2919,31 +3055,31 @@ function DefaultRegistrationScreen({
|
|
|
2919
3055
|
editable: !registering
|
|
2920
3056
|
}
|
|
2921
3057
|
),
|
|
2922
|
-
/* @__PURE__ */ (0,
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.Text, { style: [s.hint, { color: t.textMuted }], children: [
|
|
2923
3059
|
"\u{1F381}",
|
|
2924
3060
|
" If a friend invited you, enter their code to give them credit!"
|
|
2925
3061
|
] })
|
|
2926
3062
|
] })
|
|
2927
3063
|
] }),
|
|
2928
|
-
/* @__PURE__ */ (0,
|
|
2929
|
-
/* @__PURE__ */ (0,
|
|
2930
|
-
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3066
|
+
import_react_native8.TouchableOpacity,
|
|
2931
3067
|
{
|
|
2932
3068
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
2933
3069
|
onPress: () => animateToStep(1),
|
|
2934
3070
|
disabled: registering,
|
|
2935
3071
|
activeOpacity: 0.7,
|
|
2936
|
-
children: /* @__PURE__ */ (0,
|
|
3072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.text }], children: "\u2039 Back" })
|
|
2937
3073
|
}
|
|
2938
3074
|
),
|
|
2939
|
-
/* @__PURE__ */ (0,
|
|
2940
|
-
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3076
|
+
import_react_native8.TouchableOpacity,
|
|
2941
3077
|
{
|
|
2942
3078
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: registering ? 0.7 : 1 }],
|
|
2943
3079
|
onPress: handleSubmit,
|
|
2944
3080
|
disabled: registering,
|
|
2945
3081
|
activeOpacity: 0.8,
|
|
2946
|
-
children: registering ? /* @__PURE__ */ (0,
|
|
3082
|
+
children: registering ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Create Account" })
|
|
2947
3083
|
}
|
|
2948
3084
|
)
|
|
2949
3085
|
] })
|
|
@@ -2960,19 +3096,19 @@ function DefaultRegistrationScreen({
|
|
|
2960
3096
|
return null;
|
|
2961
3097
|
}
|
|
2962
3098
|
};
|
|
2963
|
-
return /* @__PURE__ */ (0,
|
|
2964
|
-
|
|
3099
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3100
|
+
import_react_native8.KeyboardAvoidingView,
|
|
2965
3101
|
{
|
|
2966
3102
|
style: [s.container, { backgroundColor: t.background }],
|
|
2967
|
-
behavior:
|
|
2968
|
-
children: /* @__PURE__ */ (0,
|
|
2969
|
-
|
|
3103
|
+
behavior: import_react_native8.Platform.OS === "ios" ? "padding" : void 0,
|
|
3104
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3105
|
+
import_react_native8.ScrollView,
|
|
2970
3106
|
{
|
|
2971
3107
|
contentContainerStyle: { flexGrow: 1 },
|
|
2972
3108
|
keyboardShouldPersistTaps: "handled",
|
|
2973
3109
|
bounces: false,
|
|
2974
|
-
children: /* @__PURE__ */ (0,
|
|
2975
|
-
|
|
3110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3111
|
+
import_react_native8.Animated.View,
|
|
2976
3112
|
{
|
|
2977
3113
|
style: [
|
|
2978
3114
|
{ flex: 1 },
|
|
@@ -3004,12 +3140,12 @@ function PushSetupScreen({
|
|
|
3004
3140
|
const t = useDubsTheme();
|
|
3005
3141
|
const accent = accentColor || t.accent;
|
|
3006
3142
|
const push = usePushNotifications();
|
|
3007
|
-
const fadeAnim = (0, import_react17.useRef)(new
|
|
3008
|
-
const slideAnim = (0, import_react17.useRef)(new
|
|
3143
|
+
const fadeAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(0)).current;
|
|
3144
|
+
const slideAnim = (0, import_react17.useRef)(new import_react_native8.Animated.Value(30)).current;
|
|
3009
3145
|
(0, import_react17.useEffect)(() => {
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3146
|
+
import_react_native8.Animated.parallel([
|
|
3147
|
+
import_react_native8.Animated.timing(fadeAnim, { toValue: 1, duration: 300, useNativeDriver: true }),
|
|
3148
|
+
import_react_native8.Animated.timing(slideAnim, { toValue: 0, duration: 300, useNativeDriver: true })
|
|
3013
3149
|
]).start();
|
|
3014
3150
|
}, [fadeAnim, slideAnim]);
|
|
3015
3151
|
const handleEnable = async () => {
|
|
@@ -3021,45 +3157,45 @@ function PushSetupScreen({
|
|
|
3021
3157
|
"Your pick wins or loses",
|
|
3022
3158
|
"Final results and rankings"
|
|
3023
3159
|
];
|
|
3024
|
-
return /* @__PURE__ */ (0,
|
|
3025
|
-
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [s.container, { backgroundColor: t.background }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
3161
|
+
import_react_native8.Animated.View,
|
|
3026
3162
|
{
|
|
3027
3163
|
style: [
|
|
3028
3164
|
s.stepContainer,
|
|
3029
3165
|
{ opacity: fadeAnim, transform: [{ translateY: slideAnim }] }
|
|
3030
3166
|
],
|
|
3031
3167
|
children: [
|
|
3032
|
-
/* @__PURE__ */ (0,
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3034
|
-
/* @__PURE__ */ (0,
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3036
|
-
/* @__PURE__ */ (0,
|
|
3037
|
-
/* @__PURE__ */ (0,
|
|
3038
|
-
/* @__PURE__ */ (0,
|
|
3039
|
-
benefits.map((item, i) => /* @__PURE__ */ (0,
|
|
3040
|
-
/* @__PURE__ */ (0,
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.stepTop, children: [
|
|
3169
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.title, { color: t.text }], children: "Enable Notifications" }),
|
|
3170
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.subtitle, { color: t.textMuted }], children: "Stay in the loop with real-time updates" }),
|
|
3171
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StepIndicator, { currentStep: 3 }),
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: pushStyles.iconContainer, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [pushStyles.bellCircle, { backgroundColor: accent + "20" }], children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.bellIcon, { color: accent }], children: "\u{1F514}" }) }) }),
|
|
3173
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: pushStyles.benefitsList, children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.benefitsHeader, { color: t.text }], children: "Get real-time updates when:" }),
|
|
3175
|
+
benefits.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: pushStyles.benefitRow, children: [
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.View, { style: [pushStyles.bulletDot, { backgroundColor: accent }] }),
|
|
3177
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [pushStyles.benefitText, { color: t.textMuted }], children: item })
|
|
3042
3178
|
] }, i))
|
|
3043
3179
|
] })
|
|
3044
3180
|
] }),
|
|
3045
|
-
/* @__PURE__ */ (0,
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3047
|
-
|
|
3181
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_native8.View, { style: s.bottomRow, children: [
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3183
|
+
import_react_native8.TouchableOpacity,
|
|
3048
3184
|
{
|
|
3049
3185
|
style: [s.secondaryBtn, { borderColor: t.border }],
|
|
3050
3186
|
onPress: onComplete,
|
|
3051
3187
|
activeOpacity: 0.7,
|
|
3052
|
-
children: /* @__PURE__ */ (0,
|
|
3188
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: [s.secondaryBtnText, { color: t.textMuted }], children: "Maybe Later" })
|
|
3053
3189
|
}
|
|
3054
3190
|
),
|
|
3055
|
-
/* @__PURE__ */ (0,
|
|
3056
|
-
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3192
|
+
import_react_native8.TouchableOpacity,
|
|
3057
3193
|
{
|
|
3058
3194
|
style: [s.primaryBtn, { backgroundColor: accent, flex: 1, opacity: push.loading ? 0.7 : 1 }],
|
|
3059
3195
|
onPress: handleEnable,
|
|
3060
3196
|
disabled: push.loading,
|
|
3061
3197
|
activeOpacity: 0.8,
|
|
3062
|
-
children: push.loading ? /* @__PURE__ */ (0,
|
|
3198
|
+
children: push.loading ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.ActivityIndicator, { color: "#FFFFFF", size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_native8.Text, { style: s.primaryBtnText, children: "Enable Notifications" })
|
|
3063
3199
|
}
|
|
3064
3200
|
)
|
|
3065
3201
|
] })
|
|
@@ -3067,7 +3203,7 @@ function PushSetupScreen({
|
|
|
3067
3203
|
}
|
|
3068
3204
|
) });
|
|
3069
3205
|
}
|
|
3070
|
-
var pushStyles =
|
|
3206
|
+
var pushStyles = import_react_native8.StyleSheet.create({
|
|
3071
3207
|
iconContainer: { alignItems: "center", marginVertical: 24 },
|
|
3072
3208
|
bellCircle: { width: 100, height: 100, borderRadius: 50, justifyContent: "center", alignItems: "center" },
|
|
3073
3209
|
bellIcon: { fontSize: 48 },
|
|
@@ -3077,7 +3213,7 @@ var pushStyles = import_react_native7.StyleSheet.create({
|
|
|
3077
3213
|
bulletDot: { width: 8, height: 8, borderRadius: 4 },
|
|
3078
3214
|
benefitText: { fontSize: 16, flex: 1 }
|
|
3079
3215
|
});
|
|
3080
|
-
var s =
|
|
3216
|
+
var s = import_react_native8.StyleSheet.create({
|
|
3081
3217
|
container: { flex: 1 },
|
|
3082
3218
|
// Loading / Error
|
|
3083
3219
|
centerContent: { flex: 1, justifyContent: "center", alignItems: "center", paddingHorizontal: 32, gap: 48 },
|
|
@@ -3141,7 +3277,7 @@ var s = import_react_native7.StyleSheet.create({
|
|
|
3141
3277
|
});
|
|
3142
3278
|
|
|
3143
3279
|
// src/provider.tsx
|
|
3144
|
-
var
|
|
3280
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3145
3281
|
var DubsContext = (0, import_react18.createContext)(null);
|
|
3146
3282
|
function DubsProvider({
|
|
3147
3283
|
apiKey,
|
|
@@ -3191,7 +3327,7 @@ function DubsProvider({
|
|
|
3191
3327
|
themeOverrides.accent = uiConfig.accentColor;
|
|
3192
3328
|
}
|
|
3193
3329
|
if (externalWallet) {
|
|
3194
|
-
return /* @__PURE__ */ (0,
|
|
3330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3195
3331
|
ExternalWalletProvider,
|
|
3196
3332
|
{
|
|
3197
3333
|
client,
|
|
@@ -3211,7 +3347,7 @@ function DubsProvider({
|
|
|
3211
3347
|
}
|
|
3212
3348
|
) });
|
|
3213
3349
|
}
|
|
3214
|
-
return /* @__PURE__ */ (0,
|
|
3350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeOverrideProvider, { value: themeOverrides, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3215
3351
|
ManagedWalletProvider,
|
|
3216
3352
|
{
|
|
3217
3353
|
appName: uiConfig.appName || appName,
|
|
@@ -3223,7 +3359,7 @@ function DubsProvider({
|
|
|
3223
3359
|
tagline: uiConfig.tagline,
|
|
3224
3360
|
redirectUri,
|
|
3225
3361
|
appUrl: appUrl || uiConfig.appUrl,
|
|
3226
|
-
children: (adapter) => /* @__PURE__ */ (0,
|
|
3362
|
+
children: (adapter) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3227
3363
|
ManagedInner,
|
|
3228
3364
|
{
|
|
3229
3365
|
client,
|
|
@@ -3268,7 +3404,7 @@ function ManagedInner({
|
|
|
3268
3404
|
() => ({ client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled }),
|
|
3269
3405
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3270
3406
|
);
|
|
3271
|
-
return /* @__PURE__ */ (0,
|
|
3407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3272
3408
|
AuthGate,
|
|
3273
3409
|
{
|
|
3274
3410
|
onSaveToken: (token) => {
|
|
@@ -3312,9 +3448,9 @@ function ExternalWalletProvider({
|
|
|
3312
3448
|
[client, wallet, connection, appName, network, disconnect, uiConfig, pushEnabled]
|
|
3313
3449
|
);
|
|
3314
3450
|
if (!managed) {
|
|
3315
|
-
return /* @__PURE__ */ (0,
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children });
|
|
3316
3452
|
}
|
|
3317
|
-
return /* @__PURE__ */ (0,
|
|
3453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DubsContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3318
3454
|
AuthGate,
|
|
3319
3455
|
{
|
|
3320
3456
|
onSaveToken: (token) => {
|
|
@@ -3345,8 +3481,8 @@ function useAppConfig() {
|
|
|
3345
3481
|
|
|
3346
3482
|
// src/ui/UserProfileCard.tsx
|
|
3347
3483
|
var import_react19 = require("react");
|
|
3348
|
-
var
|
|
3349
|
-
var
|
|
3484
|
+
var import_react_native9 = require("react-native");
|
|
3485
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3350
3486
|
function truncateAddress(address, chars = 4) {
|
|
3351
3487
|
if (address.length <= chars * 2 + 3) return address;
|
|
3352
3488
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3368,16 +3504,16 @@ function UserProfileCard({
|
|
|
3368
3504
|
() => ensurePngAvatar(avatarUrl) || `https://api.dicebear.com/9.x/avataaars/png?seed=${walletAddress}&size=128`,
|
|
3369
3505
|
[avatarUrl, walletAddress]
|
|
3370
3506
|
);
|
|
3371
|
-
return /* @__PURE__ */ (0,
|
|
3372
|
-
/* @__PURE__ */ (0,
|
|
3373
|
-
/* @__PURE__ */ (0,
|
|
3374
|
-
username ? /* @__PURE__ */ (0,
|
|
3375
|
-
/* @__PURE__ */ (0,
|
|
3376
|
-
memberSince ? /* @__PURE__ */ (0,
|
|
3507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style: [styles3.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3508
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Image, { source: { uri: imageUri }, style: styles3.avatar }),
|
|
3509
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native9.View, { style: styles3.info, children: [
|
|
3510
|
+
username ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.username, { color: t.text }], children: username }) : null,
|
|
3511
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.address, { color: t.textMuted }], children: truncateAddress(walletAddress) }),
|
|
3512
|
+
memberSince ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native9.Text, { style: [styles3.memberSince, { color: t.textDim }], children: formatMemberSince(memberSince) }) : null
|
|
3377
3513
|
] })
|
|
3378
3514
|
] });
|
|
3379
3515
|
}
|
|
3380
|
-
var
|
|
3516
|
+
var styles3 = import_react_native9.StyleSheet.create({
|
|
3381
3517
|
card: {
|
|
3382
3518
|
flexDirection: "row",
|
|
3383
3519
|
alignItems: "center",
|
|
@@ -3411,8 +3547,8 @@ var styles2 = import_react_native8.StyleSheet.create({
|
|
|
3411
3547
|
});
|
|
3412
3548
|
|
|
3413
3549
|
// src/ui/SettingsSheet.tsx
|
|
3414
|
-
var
|
|
3415
|
-
var
|
|
3550
|
+
var import_react_native10 = require("react-native");
|
|
3551
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3416
3552
|
function truncateAddress2(address, chars = 4) {
|
|
3417
3553
|
if (address.length <= chars * 2 + 3) return address;
|
|
3418
3554
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3429,13 +3565,13 @@ function SettingsSheet({
|
|
|
3429
3565
|
loggingOut = false
|
|
3430
3566
|
}) {
|
|
3431
3567
|
const t = useDubsTheme();
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
-
|
|
3568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3569
|
+
import_react_native10.ScrollView,
|
|
3434
3570
|
{
|
|
3435
|
-
style: [
|
|
3436
|
-
contentContainerStyle:
|
|
3571
|
+
style: [styles4.container, { backgroundColor: t.background }],
|
|
3572
|
+
contentContainerStyle: styles4.content,
|
|
3437
3573
|
children: [
|
|
3438
|
-
/* @__PURE__ */ (0,
|
|
3574
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3439
3575
|
UserProfileCard,
|
|
3440
3576
|
{
|
|
3441
3577
|
walletAddress,
|
|
@@ -3444,49 +3580,49 @@ function SettingsSheet({
|
|
|
3444
3580
|
memberSince
|
|
3445
3581
|
}
|
|
3446
3582
|
),
|
|
3447
|
-
/* @__PURE__ */ (0,
|
|
3448
|
-
onCopyAddress ? /* @__PURE__ */ (0,
|
|
3449
|
-
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.View, { style: [styles4.actionsCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3584
|
+
onCopyAddress ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3585
|
+
import_react_native10.TouchableOpacity,
|
|
3450
3586
|
{
|
|
3451
|
-
style:
|
|
3587
|
+
style: styles4.actionRow,
|
|
3452
3588
|
onPress: onCopyAddress,
|
|
3453
3589
|
activeOpacity: 0.7,
|
|
3454
3590
|
children: [
|
|
3455
|
-
/* @__PURE__ */ (0,
|
|
3456
|
-
/* @__PURE__ */ (0,
|
|
3457
|
-
/* @__PURE__ */ (0,
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.View, { style: styles4.actionRowLeft, children: [
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionLabel, { color: t.text }], children: "Wallet Address" }),
|
|
3593
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionValue, { color: t.textMuted }], children: truncateAddress2(walletAddress) })
|
|
3458
3594
|
] }),
|
|
3459
|
-
/* @__PURE__ */ (0,
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.copyLabel, { color: t.accent }], children: "Copy" })
|
|
3460
3596
|
]
|
|
3461
3597
|
}
|
|
3462
3598
|
) : null,
|
|
3463
|
-
onSupport ? /* @__PURE__ */ (0,
|
|
3464
|
-
onCopyAddress ? /* @__PURE__ */ (0,
|
|
3465
|
-
/* @__PURE__ */ (0,
|
|
3466
|
-
|
|
3599
|
+
onSupport ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
3600
|
+
onCopyAddress ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.View, { style: [styles4.separator, { backgroundColor: t.border }] }) : null,
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
3602
|
+
import_react_native10.TouchableOpacity,
|
|
3467
3603
|
{
|
|
3468
|
-
style:
|
|
3604
|
+
style: styles4.actionRow,
|
|
3469
3605
|
onPress: onSupport,
|
|
3470
3606
|
activeOpacity: 0.7,
|
|
3471
3607
|
children: [
|
|
3472
|
-
/* @__PURE__ */ (0,
|
|
3473
|
-
/* @__PURE__ */ (0,
|
|
3608
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.actionLabel, { color: t.text }], children: "Help & Support" }),
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.chevron, { color: t.textMuted }], children: "\u203A" })
|
|
3474
3610
|
]
|
|
3475
3611
|
}
|
|
3476
3612
|
)
|
|
3477
3613
|
] }) : null
|
|
3478
3614
|
] }),
|
|
3479
|
-
/* @__PURE__ */ (0,
|
|
3480
|
-
|
|
3615
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3616
|
+
import_react_native10.TouchableOpacity,
|
|
3481
3617
|
{
|
|
3482
|
-
style: [
|
|
3618
|
+
style: [styles4.logoutButton, { borderColor: t.live }],
|
|
3483
3619
|
onPress: onLogout,
|
|
3484
3620
|
disabled: loggingOut,
|
|
3485
3621
|
activeOpacity: 0.7,
|
|
3486
|
-
children: loggingOut ? /* @__PURE__ */ (0,
|
|
3622
|
+
children: loggingOut ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.ActivityIndicator, { color: t.live, size: "small" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native10.Text, { style: [styles4.logoutText, { color: t.live }], children: "Log Out" })
|
|
3487
3623
|
}
|
|
3488
3624
|
),
|
|
3489
|
-
appVersion ? /* @__PURE__ */ (0,
|
|
3625
|
+
appVersion ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native10.Text, { style: [styles4.version, { color: t.textDim }], children: [
|
|
3490
3626
|
"v",
|
|
3491
3627
|
appVersion
|
|
3492
3628
|
] }) : null
|
|
@@ -3494,7 +3630,7 @@ function SettingsSheet({
|
|
|
3494
3630
|
}
|
|
3495
3631
|
);
|
|
3496
3632
|
}
|
|
3497
|
-
var
|
|
3633
|
+
var styles4 = import_react_native10.StyleSheet.create({
|
|
3498
3634
|
container: {
|
|
3499
3635
|
flex: 1
|
|
3500
3636
|
},
|
|
@@ -3558,31 +3694,8 @@ var styles3 = import_react_native9.StyleSheet.create({
|
|
|
3558
3694
|
|
|
3559
3695
|
// src/ui/UserProfileSheet.tsx
|
|
3560
3696
|
var import_react20 = require("react");
|
|
3561
|
-
var
|
|
3562
|
-
var
|
|
3563
|
-
var DICEBEAR_STYLES2 = [
|
|
3564
|
-
"adventurer",
|
|
3565
|
-
"avataaars",
|
|
3566
|
-
"fun-emoji",
|
|
3567
|
-
"bottts",
|
|
3568
|
-
"big-smile",
|
|
3569
|
-
"thumbs"
|
|
3570
|
-
];
|
|
3571
|
-
function generateSeed2() {
|
|
3572
|
-
return Math.random().toString(36).slice(2, 10);
|
|
3573
|
-
}
|
|
3574
|
-
function getAvatarUrl2(style, seed, size = 256) {
|
|
3575
|
-
return `https://api.dicebear.com/9.x/${style}/png?seed=${seed}&size=${size}`;
|
|
3576
|
-
}
|
|
3577
|
-
function parseAvatarUrl(url) {
|
|
3578
|
-
if (!url) return { style: "adventurer", seed: generateSeed2() };
|
|
3579
|
-
try {
|
|
3580
|
-
const match = url.match(/\/\d+\.x\/([^/]+)\/(?:png|svg)\?seed=([^&]+)/);
|
|
3581
|
-
if (match) return { style: match[1], seed: match[2] };
|
|
3582
|
-
} catch {
|
|
3583
|
-
}
|
|
3584
|
-
return { style: "adventurer", seed: generateSeed2() };
|
|
3585
|
-
}
|
|
3697
|
+
var import_react_native11 = require("react-native");
|
|
3698
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3586
3699
|
function truncateAddress3(address, chars = 4) {
|
|
3587
3700
|
if (address.length <= chars * 2 + 3) return address;
|
|
3588
3701
|
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
@@ -3597,19 +3710,21 @@ function UserProfileSheet({
|
|
|
3597
3710
|
const t = useDubsTheme();
|
|
3598
3711
|
const { client } = useDubs();
|
|
3599
3712
|
const push = usePushNotifications();
|
|
3600
|
-
const overlayOpacity = (0, import_react20.useRef)(new
|
|
3713
|
+
const overlayOpacity = (0, import_react20.useRef)(new import_react_native11.Animated.Value(0)).current;
|
|
3601
3714
|
const parsed = (0, import_react20.useMemo)(() => parseAvatarUrl(user.avatar), [user.avatar]);
|
|
3602
3715
|
const [avatarStyle, setAvatarStyle] = (0, import_react20.useState)(parsed.style);
|
|
3603
3716
|
const [avatarSeed, setAvatarSeed] = (0, import_react20.useState)(parsed.seed);
|
|
3717
|
+
const [bgColor, setBgColor] = (0, import_react20.useState)(parsed.bg);
|
|
3604
3718
|
const [saving, setSaving] = (0, import_react20.useState)(false);
|
|
3605
3719
|
const [error, setError] = (0, import_react20.useState)(null);
|
|
3606
3720
|
(0, import_react20.useEffect)(() => {
|
|
3607
3721
|
const p = parseAvatarUrl(user.avatar);
|
|
3608
3722
|
setAvatarStyle(p.style);
|
|
3609
3723
|
setAvatarSeed(p.seed);
|
|
3724
|
+
setBgColor(p.bg);
|
|
3610
3725
|
}, [user.avatar]);
|
|
3611
3726
|
(0, import_react20.useEffect)(() => {
|
|
3612
|
-
|
|
3727
|
+
import_react_native11.Animated.timing(overlayOpacity, {
|
|
3613
3728
|
toValue: visible ? 1 : 0,
|
|
3614
3729
|
duration: 250,
|
|
3615
3730
|
useNativeDriver: true
|
|
@@ -3618,28 +3733,8 @@ function UserProfileSheet({
|
|
|
3618
3733
|
(0, import_react20.useEffect)(() => {
|
|
3619
3734
|
if (visible) setError(null);
|
|
3620
3735
|
}, [visible]);
|
|
3621
|
-
const currentAvatarUrl =
|
|
3622
|
-
const
|
|
3623
|
-
async (style) => {
|
|
3624
|
-
const newUrl = getAvatarUrl2(style, avatarSeed);
|
|
3625
|
-
setAvatarStyle(style);
|
|
3626
|
-
setSaving(true);
|
|
3627
|
-
setError(null);
|
|
3628
|
-
try {
|
|
3629
|
-
await client.updateProfile({ avatar: newUrl });
|
|
3630
|
-
onAvatarUpdated?.(newUrl);
|
|
3631
|
-
} catch (err) {
|
|
3632
|
-
setError(err instanceof Error ? err.message : "Failed to update avatar");
|
|
3633
|
-
} finally {
|
|
3634
|
-
setSaving(false);
|
|
3635
|
-
}
|
|
3636
|
-
},
|
|
3637
|
-
[avatarSeed, client, onAvatarUpdated]
|
|
3638
|
-
);
|
|
3639
|
-
const handleShuffle = (0, import_react20.useCallback)(async () => {
|
|
3640
|
-
const newSeed = generateSeed2();
|
|
3641
|
-
const newUrl = getAvatarUrl2(avatarStyle, newSeed);
|
|
3642
|
-
setAvatarSeed(newSeed);
|
|
3736
|
+
const currentAvatarUrl = getAvatarUrl(avatarStyle, avatarSeed, bgColor);
|
|
3737
|
+
const saveAvatar = (0, import_react20.useCallback)(async (newUrl) => {
|
|
3643
3738
|
setSaving(true);
|
|
3644
3739
|
setError(null);
|
|
3645
3740
|
try {
|
|
@@ -3650,132 +3745,123 @@ function UserProfileSheet({
|
|
|
3650
3745
|
} finally {
|
|
3651
3746
|
setSaving(false);
|
|
3652
3747
|
}
|
|
3653
|
-
}, [
|
|
3654
|
-
|
|
3655
|
-
|
|
3748
|
+
}, [client, onAvatarUpdated]);
|
|
3749
|
+
const handleStyleChange = (0, import_react20.useCallback)((style) => {
|
|
3750
|
+
setAvatarStyle(style);
|
|
3751
|
+
saveAvatar(getAvatarUrl(style, avatarSeed, bgColor));
|
|
3752
|
+
}, [avatarSeed, bgColor, saveAvatar]);
|
|
3753
|
+
const handleShuffle = (0, import_react20.useCallback)(() => {
|
|
3754
|
+
const newSeed = generateSeed();
|
|
3755
|
+
setAvatarSeed(newSeed);
|
|
3756
|
+
saveAvatar(getAvatarUrl(avatarStyle, newSeed, bgColor));
|
|
3757
|
+
}, [avatarStyle, bgColor, saveAvatar]);
|
|
3758
|
+
const handleBgChange = (0, import_react20.useCallback)((color) => {
|
|
3759
|
+
setBgColor(color);
|
|
3760
|
+
saveAvatar(getAvatarUrl(avatarStyle, avatarSeed, color));
|
|
3761
|
+
}, [avatarStyle, avatarSeed, saveAvatar]);
|
|
3762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3763
|
+
import_react_native11.Modal,
|
|
3656
3764
|
{
|
|
3657
3765
|
visible,
|
|
3658
3766
|
animationType: "slide",
|
|
3659
3767
|
transparent: true,
|
|
3660
3768
|
onRequestClose: onDismiss,
|
|
3661
3769
|
children: [
|
|
3662
|
-
/* @__PURE__ */ (0,
|
|
3663
|
-
/* @__PURE__ */ (0,
|
|
3664
|
-
|
|
3770
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Animated.View, { style: [styles5.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.TouchableOpacity, { style: styles5.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
3771
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3772
|
+
import_react_native11.KeyboardAvoidingView,
|
|
3665
3773
|
{
|
|
3666
|
-
style:
|
|
3667
|
-
behavior:
|
|
3668
|
-
children: /* @__PURE__ */ (0,
|
|
3669
|
-
/* @__PURE__ */ (0,
|
|
3670
|
-
/* @__PURE__ */ (0,
|
|
3671
|
-
/* @__PURE__ */ (0,
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
3774
|
+
style: styles5.keyboardView,
|
|
3775
|
+
behavior: import_react_native11.Platform.OS === "ios" ? "padding" : void 0,
|
|
3776
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.sheet, { backgroundColor: t.background }], children: [
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.handle, { backgroundColor: t.textMuted }] }) }),
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.header, children: [
|
|
3779
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.headerTitle, { color: t.text }], children: "Profile" }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
3673
3781
|
] }),
|
|
3674
|
-
/* @__PURE__ */ (0,
|
|
3675
|
-
|
|
3782
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3783
|
+
import_react_native11.ScrollView,
|
|
3676
3784
|
{
|
|
3677
|
-
style:
|
|
3678
|
-
contentContainerStyle:
|
|
3785
|
+
style: styles5.scrollContent,
|
|
3786
|
+
contentContainerStyle: styles5.scrollContentInner,
|
|
3679
3787
|
showsVerticalScrollIndicator: false,
|
|
3680
3788
|
bounces: false,
|
|
3681
3789
|
children: [
|
|
3682
|
-
/* @__PURE__ */ (0,
|
|
3683
|
-
/* @__PURE__ */ (0,
|
|
3684
|
-
/* @__PURE__ */ (0,
|
|
3685
|
-
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.avatarSection, children: [
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.avatarContainer, { borderColor: t.border }], children: [
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3793
|
+
import_react_native11.Image,
|
|
3686
3794
|
{
|
|
3687
3795
|
source: { uri: currentAvatarUrl },
|
|
3688
|
-
style:
|
|
3796
|
+
style: styles5.avatar
|
|
3689
3797
|
}
|
|
3690
3798
|
),
|
|
3691
|
-
saving && /* @__PURE__ */ (0,
|
|
3799
|
+
saving && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: styles5.avatarLoading, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.ActivityIndicator, { size: "small", color: "#FFFFFF" }) })
|
|
3692
3800
|
] }),
|
|
3693
|
-
user.username ? /* @__PURE__ */ (0,
|
|
3694
|
-
/* @__PURE__ */ (0,
|
|
3801
|
+
user.username ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.username, { color: t.text }], children: user.username }) : null,
|
|
3802
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.walletAddress, { color: t.textMuted }], children: truncateAddress3(user.walletAddress, 6) })
|
|
3695
3803
|
] }),
|
|
3696
|
-
/* @__PURE__ */ (0,
|
|
3697
|
-
/* @__PURE__ */ (0,
|
|
3698
|
-
/* @__PURE__ */ (0,
|
|
3699
|
-
/* @__PURE__ */ (0,
|
|
3700
|
-
|
|
3804
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.section, children: [
|
|
3805
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.sectionHeaderRow, children: [
|
|
3806
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.sectionLabel, { color: t.textSecondary }], children: "Change Avatar" }),
|
|
3807
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3808
|
+
import_react_native11.TouchableOpacity,
|
|
3701
3809
|
{
|
|
3702
|
-
style: [
|
|
3810
|
+
style: [styles5.shuffleButton, { borderColor: t.border }],
|
|
3703
3811
|
onPress: handleShuffle,
|
|
3704
3812
|
activeOpacity: 0.7,
|
|
3705
3813
|
disabled: saving,
|
|
3706
|
-
children: /* @__PURE__ */ (0,
|
|
3814
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.shuffleText, { color: t.accent }], children: "Shuffle" })
|
|
3707
3815
|
}
|
|
3708
3816
|
)
|
|
3709
3817
|
] }),
|
|
3710
|
-
/* @__PURE__ */ (0,
|
|
3711
|
-
|
|
3818
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3819
|
+
AvatarEditor,
|
|
3712
3820
|
{
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
{
|
|
3721
|
-
onPress: () => handleSelectStyle(style),
|
|
3722
|
-
activeOpacity: 0.7,
|
|
3723
|
-
disabled: saving,
|
|
3724
|
-
style: [
|
|
3725
|
-
styles4.styleTile,
|
|
3726
|
-
{
|
|
3727
|
-
borderColor: isSelected ? t.accent : t.border,
|
|
3728
|
-
borderWidth: isSelected ? 2 : 1
|
|
3729
|
-
}
|
|
3730
|
-
],
|
|
3731
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3732
|
-
import_react_native10.Image,
|
|
3733
|
-
{
|
|
3734
|
-
source: { uri: getAvatarUrl2(style, avatarSeed, 80) },
|
|
3735
|
-
style: styles4.styleTileImage
|
|
3736
|
-
}
|
|
3737
|
-
)
|
|
3738
|
-
},
|
|
3739
|
-
style
|
|
3740
|
-
);
|
|
3741
|
-
})
|
|
3821
|
+
style: avatarStyle,
|
|
3822
|
+
seed: avatarSeed,
|
|
3823
|
+
bg: bgColor,
|
|
3824
|
+
onStyleChange: handleStyleChange,
|
|
3825
|
+
onSeedChange: setAvatarSeed,
|
|
3826
|
+
onBgChange: handleBgChange,
|
|
3827
|
+
disabled: saving
|
|
3742
3828
|
}
|
|
3743
3829
|
)
|
|
3744
3830
|
] }),
|
|
3745
|
-
error ? /* @__PURE__ */ (0,
|
|
3746
|
-
push.enabled && /* @__PURE__ */ (0,
|
|
3747
|
-
/* @__PURE__ */ (0,
|
|
3748
|
-
/* @__PURE__ */ (0,
|
|
3749
|
-
/* @__PURE__ */ (0,
|
|
3750
|
-
|
|
3831
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.errorText, { color: t.errorText }], children: error }) }) : null,
|
|
3832
|
+
push.enabled && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: [styles5.notifRow, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
3833
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native11.View, { style: styles5.notifLeft, children: [
|
|
3834
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.notifLabel, { color: t.text }], children: "Push Notifications" }),
|
|
3835
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3836
|
+
import_react_native11.Text,
|
|
3751
3837
|
{
|
|
3752
3838
|
style: [
|
|
3753
|
-
|
|
3839
|
+
styles5.notifStatus,
|
|
3754
3840
|
{ color: push.hasPermission ? t.success : t.textMuted }
|
|
3755
3841
|
],
|
|
3756
3842
|
children: push.hasPermission ? "Enabled" : "Disabled"
|
|
3757
3843
|
}
|
|
3758
3844
|
)
|
|
3759
3845
|
] }),
|
|
3760
|
-
!push.hasPermission && /* @__PURE__ */ (0,
|
|
3761
|
-
|
|
3846
|
+
!push.hasPermission && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3847
|
+
import_react_native11.TouchableOpacity,
|
|
3762
3848
|
{
|
|
3763
|
-
style: [
|
|
3849
|
+
style: [styles5.enableButton, { backgroundColor: t.accent }],
|
|
3764
3850
|
onPress: push.register,
|
|
3765
3851
|
disabled: push.loading,
|
|
3766
3852
|
activeOpacity: 0.8,
|
|
3767
|
-
children: push.loading ? /* @__PURE__ */ (0,
|
|
3853
|
+
children: push.loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.ActivityIndicator, { size: "small", color: "#FFFFFF" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: styles5.enableText, children: "Enable" })
|
|
3768
3854
|
}
|
|
3769
3855
|
)
|
|
3770
3856
|
] }),
|
|
3771
|
-
push.enabled && push.error ? /* @__PURE__ */ (0,
|
|
3772
|
-
onDisconnect ? /* @__PURE__ */ (0,
|
|
3773
|
-
|
|
3857
|
+
push.enabled && push.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.View, { style: [styles5.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.errorText, { color: t.errorText }], children: push.error.message }) }) : null,
|
|
3858
|
+
onDisconnect ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3859
|
+
import_react_native11.TouchableOpacity,
|
|
3774
3860
|
{
|
|
3775
|
-
style: [
|
|
3861
|
+
style: [styles5.disconnectButton, { borderColor: t.live }],
|
|
3776
3862
|
onPress: onDisconnect,
|
|
3777
3863
|
activeOpacity: 0.7,
|
|
3778
|
-
children: /* @__PURE__ */ (0,
|
|
3864
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native11.Text, { style: [styles5.disconnectText, { color: t.live }], children: "Disconnect Wallet" })
|
|
3779
3865
|
}
|
|
3780
3866
|
) : null
|
|
3781
3867
|
]
|
|
@@ -3788,9 +3874,9 @@ function UserProfileSheet({
|
|
|
3788
3874
|
}
|
|
3789
3875
|
);
|
|
3790
3876
|
}
|
|
3791
|
-
var
|
|
3877
|
+
var styles5 = import_react_native11.StyleSheet.create({
|
|
3792
3878
|
overlay: {
|
|
3793
|
-
...
|
|
3879
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3794
3880
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
3795
3881
|
},
|
|
3796
3882
|
overlayTap: {
|
|
@@ -3808,7 +3894,7 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3808
3894
|
borderTopRightRadius: 24,
|
|
3809
3895
|
paddingHorizontal: 20,
|
|
3810
3896
|
paddingBottom: 0,
|
|
3811
|
-
height:
|
|
3897
|
+
height: import_react_native11.Dimensions.get("window").height * 0.7
|
|
3812
3898
|
},
|
|
3813
3899
|
handleRow: {
|
|
3814
3900
|
alignItems: "center",
|
|
@@ -3841,7 +3927,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3841
3927
|
scrollContentInner: {
|
|
3842
3928
|
paddingBottom: 8
|
|
3843
3929
|
},
|
|
3844
|
-
// Avatar
|
|
3845
3930
|
avatarSection: {
|
|
3846
3931
|
alignItems: "center",
|
|
3847
3932
|
paddingTop: 8,
|
|
@@ -3857,11 +3942,10 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3857
3942
|
},
|
|
3858
3943
|
avatar: {
|
|
3859
3944
|
width: "100%",
|
|
3860
|
-
height: "100%"
|
|
3861
|
-
backgroundColor: "#1a1a2e"
|
|
3945
|
+
height: "100%"
|
|
3862
3946
|
},
|
|
3863
3947
|
avatarLoading: {
|
|
3864
|
-
...
|
|
3948
|
+
...import_react_native11.StyleSheet.absoluteFillObject,
|
|
3865
3949
|
backgroundColor: "rgba(0,0,0,0.35)",
|
|
3866
3950
|
justifyContent: "center",
|
|
3867
3951
|
alignItems: "center"
|
|
@@ -3874,7 +3958,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3874
3958
|
fontSize: 13,
|
|
3875
3959
|
fontFamily: "monospace"
|
|
3876
3960
|
},
|
|
3877
|
-
// Change Avatar
|
|
3878
3961
|
section: {
|
|
3879
3962
|
marginBottom: 20,
|
|
3880
3963
|
gap: 12
|
|
@@ -3898,21 +3981,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3898
3981
|
fontSize: 13,
|
|
3899
3982
|
fontWeight: "600"
|
|
3900
3983
|
},
|
|
3901
|
-
stylePickerContent: {
|
|
3902
|
-
gap: 10
|
|
3903
|
-
},
|
|
3904
|
-
styleTile: {
|
|
3905
|
-
width: 72,
|
|
3906
|
-
height: 72,
|
|
3907
|
-
borderRadius: 16,
|
|
3908
|
-
overflow: "hidden"
|
|
3909
|
-
},
|
|
3910
|
-
styleTileImage: {
|
|
3911
|
-
width: "100%",
|
|
3912
|
-
height: "100%",
|
|
3913
|
-
backgroundColor: "#1a1a2e"
|
|
3914
|
-
},
|
|
3915
|
-
// Error
|
|
3916
3984
|
errorBox: {
|
|
3917
3985
|
marginBottom: 16,
|
|
3918
3986
|
borderRadius: 12,
|
|
@@ -3923,7 +3991,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3923
3991
|
fontSize: 13,
|
|
3924
3992
|
fontWeight: "500"
|
|
3925
3993
|
},
|
|
3926
|
-
// Push Notifications
|
|
3927
3994
|
notifRow: {
|
|
3928
3995
|
flexDirection: "row",
|
|
3929
3996
|
alignItems: "center",
|
|
@@ -3954,7 +4021,6 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3954
4021
|
fontSize: 14,
|
|
3955
4022
|
fontWeight: "700"
|
|
3956
4023
|
},
|
|
3957
|
-
// Disconnect
|
|
3958
4024
|
disconnectButton: {
|
|
3959
4025
|
height: 52,
|
|
3960
4026
|
borderRadius: 16,
|
|
@@ -3970,8 +4036,8 @@ var styles4 = import_react_native10.StyleSheet.create({
|
|
|
3970
4036
|
|
|
3971
4037
|
// src/ui/game/GamePoster.tsx
|
|
3972
4038
|
var import_react21 = require("react");
|
|
3973
|
-
var
|
|
3974
|
-
var
|
|
4039
|
+
var import_react_native12 = require("react-native");
|
|
4040
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3975
4041
|
function computeCountdown(lockTimestamp) {
|
|
3976
4042
|
if (!lockTimestamp) return "";
|
|
3977
4043
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -3992,27 +4058,27 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
3992
4058
|
const away = opponents[1];
|
|
3993
4059
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
3994
4060
|
const isLive = countdown === "LIVE";
|
|
3995
|
-
return /* @__PURE__ */ (0,
|
|
3996
|
-
game.media?.poster ? /* @__PURE__ */ (0,
|
|
4061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.container, children: [
|
|
4062
|
+
game.media?.poster ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3997
4063
|
Img,
|
|
3998
4064
|
{
|
|
3999
4065
|
source: { uri: game.media.poster },
|
|
4000
|
-
style:
|
|
4066
|
+
style: styles6.image,
|
|
4001
4067
|
resizeMode: "cover"
|
|
4002
4068
|
}
|
|
4003
|
-
) : /* @__PURE__ */ (0,
|
|
4004
|
-
/* @__PURE__ */ (0,
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4006
|
-
/* @__PURE__ */ (0,
|
|
4069
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.image, { backgroundColor: t.surface }], children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.fallback, children: [
|
|
4070
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: home?.imageUrl, size: 56, Img }),
|
|
4071
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.vs, children: "VS" }),
|
|
4072
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TeamLogoInternal, { url: away?.imageUrl, size: 56, Img })
|
|
4007
4073
|
] }) }),
|
|
4008
|
-
/* @__PURE__ */ (0,
|
|
4009
|
-
/* @__PURE__ */ (0,
|
|
4010
|
-
/* @__PURE__ */ (0,
|
|
4011
|
-
/* @__PURE__ */ (0,
|
|
4012
|
-
/* @__PURE__ */ (0,
|
|
4074
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.overlay }),
|
|
4075
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.teamNames, children: [
|
|
4076
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: home?.name || "Home" }),
|
|
4077
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameVs, children: "vs" }),
|
|
4078
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: styles6.teamNameText, numberOfLines: 1, children: away?.name || "Away" })
|
|
4013
4079
|
] }),
|
|
4014
|
-
countdown ? /* @__PURE__ */ (0,
|
|
4015
|
-
/* @__PURE__ */ (0,
|
|
4080
|
+
countdown ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.countdownPill, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.countdownText, isLive && styles6.countdownLive], children: countdown }) }) : null,
|
|
4081
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.poolPill, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: styles6.poolText, children: [
|
|
4016
4082
|
game.totalPool || 0,
|
|
4017
4083
|
" SOL"
|
|
4018
4084
|
] }) })
|
|
@@ -4021,9 +4087,9 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4021
4087
|
function TeamLogoInternal({ url, size, Img }) {
|
|
4022
4088
|
const [failed, setFailed] = (0, import_react21.useState)(false);
|
|
4023
4089
|
if (!url || failed) {
|
|
4024
|
-
return /* @__PURE__ */ (0,
|
|
4090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
4025
4091
|
}
|
|
4026
|
-
return /* @__PURE__ */ (0,
|
|
4092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4027
4093
|
Img,
|
|
4028
4094
|
{
|
|
4029
4095
|
source: { uri: url },
|
|
@@ -4033,7 +4099,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
4033
4099
|
}
|
|
4034
4100
|
);
|
|
4035
4101
|
}
|
|
4036
|
-
var
|
|
4102
|
+
var styles6 = import_react_native12.StyleSheet.create({
|
|
4037
4103
|
container: {
|
|
4038
4104
|
height: 200,
|
|
4039
4105
|
borderRadius: 16,
|
|
@@ -4041,12 +4107,12 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4041
4107
|
position: "relative"
|
|
4042
4108
|
},
|
|
4043
4109
|
image: {
|
|
4044
|
-
...
|
|
4110
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4045
4111
|
justifyContent: "center",
|
|
4046
4112
|
alignItems: "center"
|
|
4047
4113
|
},
|
|
4048
4114
|
overlay: {
|
|
4049
|
-
...
|
|
4115
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4050
4116
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4051
4117
|
},
|
|
4052
4118
|
fallback: {
|
|
@@ -4121,8 +4187,8 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4121
4187
|
|
|
4122
4188
|
// src/ui/game/LivePoolsCard.tsx
|
|
4123
4189
|
var import_react22 = require("react");
|
|
4124
|
-
var
|
|
4125
|
-
var
|
|
4190
|
+
var import_react_native13 = require("react-native");
|
|
4191
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4126
4192
|
function LivePoolsCard({
|
|
4127
4193
|
game,
|
|
4128
4194
|
shortName,
|
|
@@ -4144,29 +4210,29 @@ function LivePoolsCard({
|
|
|
4144
4210
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4145
4211
|
};
|
|
4146
4212
|
}, [homePool, awayPool, totalPool]);
|
|
4147
|
-
return /* @__PURE__ */ (0,
|
|
4148
|
-
/* @__PURE__ */ (0,
|
|
4149
|
-
/* @__PURE__ */ (0,
|
|
4213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: [styles7.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4214
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.title, { color: t.text }], children: "Live Pools" }),
|
|
4215
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.total, { color: t.accent }], children: [
|
|
4150
4216
|
totalPool,
|
|
4151
4217
|
" SOL total"
|
|
4152
4218
|
] }),
|
|
4153
|
-
/* @__PURE__ */ (0,
|
|
4154
|
-
/* @__PURE__ */ (0,
|
|
4155
|
-
/* @__PURE__ */ (0,
|
|
4219
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.bars, children: [
|
|
4220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: homeName, amount: homePool, percent: homePercent, color: homeColor, t }),
|
|
4221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PoolBar, { name: awayName, amount: awayPool, percent: awayPercent, color: awayColor, t })
|
|
4156
4222
|
] }),
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4223
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.oddsRow, children: [
|
|
4224
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4159
4225
|
homeName,
|
|
4160
4226
|
": ",
|
|
4161
|
-
/* @__PURE__ */ (0,
|
|
4227
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4162
4228
|
homeOdds,
|
|
4163
4229
|
"x"
|
|
4164
4230
|
] })
|
|
4165
4231
|
] }),
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.oddsText, { color: t.textMuted }], children: [
|
|
4167
4233
|
awayName,
|
|
4168
4234
|
": ",
|
|
4169
|
-
/* @__PURE__ */ (0,
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4170
4236
|
awayOdds,
|
|
4171
4237
|
"x"
|
|
4172
4238
|
] })
|
|
@@ -4175,16 +4241,16 @@ function LivePoolsCard({
|
|
|
4175
4241
|
] });
|
|
4176
4242
|
}
|
|
4177
4243
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4178
|
-
return /* @__PURE__ */ (0,
|
|
4179
|
-
/* @__PURE__ */ (0,
|
|
4180
|
-
/* @__PURE__ */ (0,
|
|
4181
|
-
/* @__PURE__ */ (0,
|
|
4244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.barRow, children: [
|
|
4245
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.barLabel, { color: t.textSecondary }], numberOfLines: 1, children: name }),
|
|
4246
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.barTrack, { backgroundColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.barFill, { width: `${Math.max(percent, 2)}%`, backgroundColor: color }] }) }),
|
|
4247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: [styles7.barAmount, { color: t.text }], children: [
|
|
4182
4248
|
amount,
|
|
4183
4249
|
" SOL"
|
|
4184
4250
|
] })
|
|
4185
4251
|
] });
|
|
4186
4252
|
}
|
|
4187
|
-
var
|
|
4253
|
+
var styles7 = import_react_native13.StyleSheet.create({
|
|
4188
4254
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4189
4255
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4190
4256
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4200,8 +4266,8 @@ var styles6 = import_react_native12.StyleSheet.create({
|
|
|
4200
4266
|
|
|
4201
4267
|
// src/ui/game/PickWinnerCard.tsx
|
|
4202
4268
|
var import_react23 = require("react");
|
|
4203
|
-
var
|
|
4204
|
-
var
|
|
4269
|
+
var import_react_native14 = require("react-native");
|
|
4270
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4205
4271
|
function PickWinnerCard({
|
|
4206
4272
|
game,
|
|
4207
4273
|
selectedTeam,
|
|
@@ -4225,10 +4291,10 @@ function PickWinnerCard({
|
|
|
4225
4291
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4226
4292
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4227
4293
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4228
|
-
return /* @__PURE__ */ (0,
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4230
|
-
/* @__PURE__ */ (0,
|
|
4231
|
-
/* @__PURE__ */ (0,
|
|
4294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: [styles8.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4295
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.title, { color: t.text }], children: "Pick Your Winner" }),
|
|
4296
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.row, children: [
|
|
4297
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4232
4298
|
TeamOption,
|
|
4233
4299
|
{
|
|
4234
4300
|
name: homeName,
|
|
@@ -4242,7 +4308,7 @@ function PickWinnerCard({
|
|
|
4242
4308
|
t
|
|
4243
4309
|
}
|
|
4244
4310
|
),
|
|
4245
|
-
/* @__PURE__ */ (0,
|
|
4311
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4246
4312
|
TeamOption,
|
|
4247
4313
|
{
|
|
4248
4314
|
name: awayName,
|
|
@@ -4273,30 +4339,30 @@ function TeamOption({
|
|
|
4273
4339
|
const [imgFailed, setImgFailed] = (0, import_react23.useState)(false);
|
|
4274
4340
|
const Img = ImageComponent || require("react-native").Image;
|
|
4275
4341
|
const showImage = imageUrl && !imgFailed;
|
|
4276
|
-
return /* @__PURE__ */ (0,
|
|
4277
|
-
|
|
4342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
4343
|
+
import_react_native14.TouchableOpacity,
|
|
4278
4344
|
{
|
|
4279
|
-
style: [
|
|
4345
|
+
style: [styles8.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4280
4346
|
onPress,
|
|
4281
4347
|
activeOpacity: 0.7,
|
|
4282
4348
|
children: [
|
|
4283
|
-
showImage ? /* @__PURE__ */ (0,
|
|
4284
|
-
/* @__PURE__ */ (0,
|
|
4285
|
-
/* @__PURE__ */ (0,
|
|
4349
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Img, { source: { uri: imageUrl }, style: styles8.logo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.logo, styles8.logoPlaceholder] }),
|
|
4350
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.name, { color: t.text }], numberOfLines: 1, children: name }),
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.odds, { color }], children: [
|
|
4286
4352
|
odds,
|
|
4287
4353
|
"x"
|
|
4288
4354
|
] }),
|
|
4289
|
-
/* @__PURE__ */ (0,
|
|
4355
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.bets, { color: t.textMuted }], children: [
|
|
4290
4356
|
bets,
|
|
4291
4357
|
" ",
|
|
4292
4358
|
bets === 1 ? "bet" : "bets"
|
|
4293
4359
|
] }),
|
|
4294
|
-
selected && /* @__PURE__ */ (0,
|
|
4360
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.badge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: styles8.badgeText, children: "Selected" }) })
|
|
4295
4361
|
]
|
|
4296
4362
|
}
|
|
4297
4363
|
);
|
|
4298
4364
|
}
|
|
4299
|
-
var
|
|
4365
|
+
var styles8 = import_react_native14.StyleSheet.create({
|
|
4300
4366
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4301
4367
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4302
4368
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4312,8 +4378,8 @@ var styles7 = import_react_native13.StyleSheet.create({
|
|
|
4312
4378
|
|
|
4313
4379
|
// src/ui/game/PlayersCard.tsx
|
|
4314
4380
|
var import_react24 = require("react");
|
|
4315
|
-
var
|
|
4316
|
-
var
|
|
4381
|
+
var import_react_native15 = require("react-native");
|
|
4382
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4317
4383
|
function truncateWallet(addr, chars) {
|
|
4318
4384
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4319
4385
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4333,12 +4399,12 @@ function PlayersCard({
|
|
|
4333
4399
|
if (team === "away") return awayColor;
|
|
4334
4400
|
return drawColor;
|
|
4335
4401
|
};
|
|
4336
|
-
return /* @__PURE__ */ (0,
|
|
4337
|
-
/* @__PURE__ */ (0,
|
|
4402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.title, { color: t.text }], children: [
|
|
4338
4404
|
"Players",
|
|
4339
4405
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4340
4406
|
] }),
|
|
4341
|
-
bettors.length === 0 ? /* @__PURE__ */ (0,
|
|
4407
|
+
bettors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.empty, { color: t.textMuted }], children: "No players yet \u2014 be the first!" }) : bettors.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4342
4408
|
BettorRow,
|
|
4343
4409
|
{
|
|
4344
4410
|
bettor: b,
|
|
@@ -4363,17 +4429,17 @@ function BettorRow({
|
|
|
4363
4429
|
const [imgFailed, setImgFailed] = (0, import_react24.useState)(false);
|
|
4364
4430
|
const Img = ImageComponent || require("react-native").Image;
|
|
4365
4431
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4366
|
-
return /* @__PURE__ */ (0,
|
|
4367
|
-
/* @__PURE__ */ (0,
|
|
4368
|
-
showAvatar ? /* @__PURE__ */ (0,
|
|
4369
|
-
/* @__PURE__ */ (0,
|
|
4370
|
-
/* @__PURE__ */ (0,
|
|
4432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4433
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.dot, { backgroundColor: dotColor }] }),
|
|
4434
|
+
showAvatar ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Img, { source: { uri: ensurePngAvatar(bettor.avatar) }, style: styles9.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.avatar, styles9.avatarPlaceholder] }),
|
|
4435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: styles9.nameCol, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.username, { color: t.text }], numberOfLines: 1, children: bettor.username || truncateWallet(bettor.wallet, truncateChars) }) }),
|
|
4436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.amount, { color: t.textSecondary }], children: [
|
|
4371
4437
|
bettor.amount,
|
|
4372
4438
|
" SOL"
|
|
4373
4439
|
] })
|
|
4374
4440
|
] });
|
|
4375
4441
|
}
|
|
4376
|
-
var
|
|
4442
|
+
var styles9 = import_react_native15.StyleSheet.create({
|
|
4377
4443
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4378
4444
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4379
4445
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4388,8 +4454,8 @@ var styles8 = import_react_native14.StyleSheet.create({
|
|
|
4388
4454
|
|
|
4389
4455
|
// src/ui/game/JoinGameButton.tsx
|
|
4390
4456
|
var import_react25 = require("react");
|
|
4391
|
-
var
|
|
4392
|
-
var
|
|
4457
|
+
var import_react_native16 = require("react-native");
|
|
4458
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4393
4459
|
var STATUS_LABELS = {
|
|
4394
4460
|
building: "Building transaction...",
|
|
4395
4461
|
signing: "Approve in wallet...",
|
|
@@ -4405,30 +4471,30 @@ function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
|
4405
4471
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4406
4472
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4407
4473
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4408
|
-
return /* @__PURE__ */ (0,
|
|
4409
|
-
/* @__PURE__ */ (0,
|
|
4410
|
-
/* @__PURE__ */ (0,
|
|
4411
|
-
/* @__PURE__ */ (0,
|
|
4474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: [styles10.bar, { backgroundColor: t.background, borderTopColor: t.border }], children: [
|
|
4475
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.buyInRow, children: [
|
|
4476
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.buyInLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4477
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.Text, { style: [styles10.buyInValue, { color: t.text }], children: [
|
|
4412
4478
|
game.buyIn,
|
|
4413
4479
|
" SOL"
|
|
4414
4480
|
] })
|
|
4415
4481
|
] }),
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4417
|
-
|
|
4482
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4483
|
+
import_react_native16.TouchableOpacity,
|
|
4418
4484
|
{
|
|
4419
|
-
style: [
|
|
4485
|
+
style: [styles10.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4420
4486
|
disabled: !selectedTeam || isJoining,
|
|
4421
4487
|
onPress: onJoin,
|
|
4422
4488
|
activeOpacity: 0.8,
|
|
4423
|
-
children: isJoining ? /* @__PURE__ */ (0,
|
|
4424
|
-
/* @__PURE__ */ (0,
|
|
4425
|
-
/* @__PURE__ */ (0,
|
|
4426
|
-
] }) : /* @__PURE__ */ (0,
|
|
4489
|
+
children: isJoining ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: styles10.joiningRow, children: [
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.ActivityIndicator, { size: "small", color: "#000" }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: styles10.buttonText, children: statusLabel })
|
|
4492
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.buttonText, !selectedTeam && { color: t.textMuted }], children: selectedTeam ? `Join Bet \u2014 ${game.buyIn} SOL` : "Pick a team to bet" })
|
|
4427
4493
|
}
|
|
4428
4494
|
)
|
|
4429
4495
|
] });
|
|
4430
4496
|
}
|
|
4431
|
-
var
|
|
4497
|
+
var styles10 = import_react_native16.StyleSheet.create({
|
|
4432
4498
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4433
4499
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4434
4500
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4440,8 +4506,8 @@ var styles9 = import_react_native15.StyleSheet.create({
|
|
|
4440
4506
|
|
|
4441
4507
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4442
4508
|
var import_react26 = require("react");
|
|
4443
|
-
var
|
|
4444
|
-
var
|
|
4509
|
+
var import_react_native17 = require("react-native");
|
|
4510
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4445
4511
|
var STATUS_LABELS2 = {
|
|
4446
4512
|
building: "Building transaction...",
|
|
4447
4513
|
signing: "Approve in wallet...",
|
|
@@ -4468,9 +4534,9 @@ function CreateCustomGameSheet({
|
|
|
4468
4534
|
const [selectedAmount, setSelectedAmount] = (0, import_react26.useState)(null);
|
|
4469
4535
|
const [customAmount, setCustomAmount] = (0, import_react26.useState)("");
|
|
4470
4536
|
const [isCustom, setIsCustom] = (0, import_react26.useState)(false);
|
|
4471
|
-
const overlayOpacity = (0, import_react26.useRef)(new
|
|
4537
|
+
const overlayOpacity = (0, import_react26.useRef)(new import_react_native17.Animated.Value(0)).current;
|
|
4472
4538
|
(0, import_react26.useEffect)(() => {
|
|
4473
|
-
|
|
4539
|
+
import_react_native17.Animated.timing(overlayOpacity, {
|
|
4474
4540
|
toValue: visible ? 1 : 0,
|
|
4475
4541
|
duration: 250,
|
|
4476
4542
|
useNativeDriver: true
|
|
@@ -4540,42 +4606,42 @@ function CreateCustomGameSheet({
|
|
|
4540
4606
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4541
4607
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4542
4608
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4543
|
-
return /* @__PURE__ */ (0,
|
|
4544
|
-
|
|
4609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
4610
|
+
import_react_native17.Modal,
|
|
4545
4611
|
{
|
|
4546
4612
|
visible,
|
|
4547
4613
|
animationType: "slide",
|
|
4548
4614
|
transparent: true,
|
|
4549
4615
|
onRequestClose: onDismiss,
|
|
4550
4616
|
children: [
|
|
4551
|
-
/* @__PURE__ */ (0,
|
|
4552
|
-
/* @__PURE__ */ (0,
|
|
4553
|
-
|
|
4617
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Animated.View, { style: [styles11.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.TouchableOpacity, { style: styles11.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4618
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4619
|
+
import_react_native17.KeyboardAvoidingView,
|
|
4554
4620
|
{
|
|
4555
|
-
style:
|
|
4556
|
-
behavior:
|
|
4557
|
-
children: /* @__PURE__ */ (0,
|
|
4558
|
-
/* @__PURE__ */ (0,
|
|
4559
|
-
/* @__PURE__ */ (0,
|
|
4560
|
-
/* @__PURE__ */ (0,
|
|
4561
|
-
/* @__PURE__ */ (0,
|
|
4621
|
+
style: styles11.keyboardView,
|
|
4622
|
+
behavior: import_react_native17.Platform.OS === "ios" ? "padding" : void 0,
|
|
4623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: styles11.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.sheet, { backgroundColor: t.background }], children: [
|
|
4624
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: styles11.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4625
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.header, children: [
|
|
4626
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Create Pool" : "New Game" }),
|
|
4627
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4562
4628
|
] }),
|
|
4563
|
-
!isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4564
|
-
/* @__PURE__ */ (0,
|
|
4565
|
-
/* @__PURE__ */ (0,
|
|
4629
|
+
!isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.section, children: [
|
|
4630
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.sectionLabel, { color: t.textSecondary }], children: "Buy-In Amount" }),
|
|
4631
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.chipsRow, children: [
|
|
4566
4632
|
presetAmounts.map((amount) => {
|
|
4567
4633
|
const active = !isCustom && selectedAmount === amount;
|
|
4568
|
-
return /* @__PURE__ */ (0,
|
|
4569
|
-
|
|
4634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4635
|
+
import_react_native17.TouchableOpacity,
|
|
4570
4636
|
{
|
|
4571
4637
|
style: [
|
|
4572
|
-
|
|
4638
|
+
styles11.chip,
|
|
4573
4639
|
{ borderColor: active ? t.accent : t.border },
|
|
4574
4640
|
active && { backgroundColor: t.accent }
|
|
4575
4641
|
],
|
|
4576
4642
|
onPress: () => handlePresetSelect(amount),
|
|
4577
4643
|
activeOpacity: 0.8,
|
|
4578
|
-
children: /* @__PURE__ */ (0,
|
|
4644
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4579
4645
|
amount,
|
|
4580
4646
|
" SOL"
|
|
4581
4647
|
] })
|
|
@@ -4583,24 +4649,24 @@ function CreateCustomGameSheet({
|
|
|
4583
4649
|
amount
|
|
4584
4650
|
);
|
|
4585
4651
|
}),
|
|
4586
|
-
/* @__PURE__ */ (0,
|
|
4587
|
-
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4653
|
+
import_react_native17.TouchableOpacity,
|
|
4588
4654
|
{
|
|
4589
4655
|
style: [
|
|
4590
|
-
|
|
4656
|
+
styles11.chip,
|
|
4591
4657
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4592
4658
|
isCustom && { backgroundColor: t.accent }
|
|
4593
4659
|
],
|
|
4594
4660
|
onPress: handleCustomSelect,
|
|
4595
4661
|
activeOpacity: 0.8,
|
|
4596
|
-
children: /* @__PURE__ */ (0,
|
|
4662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4597
4663
|
}
|
|
4598
4664
|
)
|
|
4599
4665
|
] }),
|
|
4600
|
-
isCustom && /* @__PURE__ */ (0,
|
|
4601
|
-
|
|
4666
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4667
|
+
import_react_native17.TextInput,
|
|
4602
4668
|
{
|
|
4603
|
-
style: [
|
|
4669
|
+
style: [styles11.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4604
4670
|
placeholder: "Enter amount in SOL",
|
|
4605
4671
|
placeholderTextColor: t.textDim,
|
|
4606
4672
|
keyboardType: "decimal-pad",
|
|
@@ -4610,43 +4676,43 @@ function CreateCustomGameSheet({
|
|
|
4610
4676
|
}
|
|
4611
4677
|
)
|
|
4612
4678
|
] }),
|
|
4613
|
-
/* @__PURE__ */ (0,
|
|
4614
|
-
/* @__PURE__ */ (0,
|
|
4615
|
-
/* @__PURE__ */ (0,
|
|
4616
|
-
/* @__PURE__ */ (0,
|
|
4679
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4680
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4682
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: finalAmount ? `${finalAmount} SOL` : "\u2014" })
|
|
4617
4683
|
] }),
|
|
4618
|
-
/* @__PURE__ */ (0,
|
|
4619
|
-
/* @__PURE__ */ (0,
|
|
4620
|
-
/* @__PURE__ */ (0,
|
|
4621
|
-
/* @__PURE__ */ (0,
|
|
4684
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4685
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max players" : "Players" }),
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.text }], children: isPoolModeEnabled ? playerCount : playersLabel })
|
|
4622
4688
|
] }),
|
|
4623
|
-
/* @__PURE__ */ (0,
|
|
4624
|
-
/* @__PURE__ */ (0,
|
|
4625
|
-
/* @__PURE__ */ (0,
|
|
4626
|
-
/* @__PURE__ */ (0,
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4628
|
-
finalAmount ? /* @__PURE__ */ (0,
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.summarySep, { backgroundColor: t.border }] }),
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.summaryRow, children: [
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max pot" : "Winner Takes" }),
|
|
4692
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.winnerCol, children: [
|
|
4693
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.summaryValue, { color: t.success }], children: finalAmount ? `${(finalAmount * playerCount * (1 - fee / 100)).toFixed(4)} SOL` : "\u2014" }),
|
|
4694
|
+
finalAmount ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.feeNote, { color: t.textDim }], children: [
|
|
4629
4695
|
fee,
|
|
4630
4696
|
"% platform fee"
|
|
4631
4697
|
] }) : null
|
|
4632
4698
|
] })
|
|
4633
4699
|
] })
|
|
4634
4700
|
] }),
|
|
4635
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
4636
|
-
/* @__PURE__ */ (0,
|
|
4637
|
-
|
|
4701
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.View, { style: [styles11.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
4702
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4703
|
+
import_react_native17.TouchableOpacity,
|
|
4638
4704
|
{
|
|
4639
4705
|
style: [
|
|
4640
|
-
|
|
4706
|
+
styles11.ctaButton,
|
|
4641
4707
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4642
4708
|
],
|
|
4643
4709
|
disabled: !canCreate,
|
|
4644
4710
|
onPress: handleCreate,
|
|
4645
4711
|
activeOpacity: 0.8,
|
|
4646
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
4647
|
-
/* @__PURE__ */ (0,
|
|
4648
|
-
/* @__PURE__ */ (0,
|
|
4649
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
4712
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.ctaLoading, children: [
|
|
4713
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
4714
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.ctaText, children: statusLabel })
|
|
4715
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.ctaText, children: isPoolModeEnabled ? "Pool Created!" : STATUS_LABELS2.success }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.ctaText, !canCreate && { opacity: 0.5 }], children: isPoolModeEnabled ? `Create Pool \u2014 ${finalAmount} SOL` : effectiveAmount ? `Create Game \u2014 ${effectiveAmount} SOL` : "Select buy-in amount" })
|
|
4650
4716
|
}
|
|
4651
4717
|
)
|
|
4652
4718
|
] }) })
|
|
@@ -4656,9 +4722,9 @@ function CreateCustomGameSheet({
|
|
|
4656
4722
|
}
|
|
4657
4723
|
);
|
|
4658
4724
|
}
|
|
4659
|
-
var
|
|
4725
|
+
var styles11 = import_react_native17.StyleSheet.create({
|
|
4660
4726
|
overlay: {
|
|
4661
|
-
...
|
|
4727
|
+
...import_react_native17.StyleSheet.absoluteFillObject,
|
|
4662
4728
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4663
4729
|
},
|
|
4664
4730
|
overlayTap: {
|
|
@@ -4794,8 +4860,8 @@ var styles10 = import_react_native16.StyleSheet.create({
|
|
|
4794
4860
|
|
|
4795
4861
|
// src/ui/game/JoinGameSheet.tsx
|
|
4796
4862
|
var import_react27 = require("react");
|
|
4797
|
-
var
|
|
4798
|
-
var
|
|
4863
|
+
var import_react_native18 = require("react-native");
|
|
4864
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4799
4865
|
var STATUS_LABELS3 = {
|
|
4800
4866
|
building: "Building transaction...",
|
|
4801
4867
|
signing: "Approve in wallet...",
|
|
@@ -4820,9 +4886,9 @@ function JoinGameSheet({
|
|
|
4820
4886
|
const mutation = useJoinGame();
|
|
4821
4887
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
4822
4888
|
const [selectedTeam, setSelectedTeam] = (0, import_react27.useState)(null);
|
|
4823
|
-
const overlayOpacity = (0, import_react27.useRef)(new
|
|
4889
|
+
const overlayOpacity = (0, import_react27.useRef)(new import_react_native18.Animated.Value(0)).current;
|
|
4824
4890
|
(0, import_react27.useEffect)(() => {
|
|
4825
|
-
|
|
4891
|
+
import_react_native18.Animated.timing(overlayOpacity, {
|
|
4826
4892
|
toValue: visible ? 1 : 0,
|
|
4827
4893
|
duration: 250,
|
|
4828
4894
|
useNativeDriver: true
|
|
@@ -4886,30 +4952,30 @@ function JoinGameSheet({
|
|
|
4886
4952
|
}
|
|
4887
4953
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4888
4954
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4889
|
-
return /* @__PURE__ */ (0,
|
|
4890
|
-
|
|
4955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4956
|
+
import_react_native18.Modal,
|
|
4891
4957
|
{
|
|
4892
4958
|
visible,
|
|
4893
4959
|
animationType: "slide",
|
|
4894
4960
|
transparent: true,
|
|
4895
4961
|
onRequestClose: onDismiss,
|
|
4896
4962
|
children: [
|
|
4897
|
-
/* @__PURE__ */ (0,
|
|
4898
|
-
/* @__PURE__ */ (0,
|
|
4899
|
-
|
|
4963
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Animated.View, { style: [styles12.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { style: styles12.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4965
|
+
import_react_native18.KeyboardAvoidingView,
|
|
4900
4966
|
{
|
|
4901
|
-
style:
|
|
4902
|
-
behavior:
|
|
4903
|
-
children: /* @__PURE__ */ (0,
|
|
4904
|
-
/* @__PURE__ */ (0,
|
|
4905
|
-
/* @__PURE__ */ (0,
|
|
4906
|
-
/* @__PURE__ */ (0,
|
|
4907
|
-
/* @__PURE__ */ (0,
|
|
4967
|
+
style: styles12.keyboardView,
|
|
4968
|
+
behavior: import_react_native18.Platform.OS === "ios" ? "padding" : void 0,
|
|
4969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.sheet, { backgroundColor: t.background }], children: [
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.header, children: [
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4908
4974
|
] }),
|
|
4909
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4910
|
-
/* @__PURE__ */ (0,
|
|
4911
|
-
/* @__PURE__ */ (0,
|
|
4912
|
-
/* @__PURE__ */ (0,
|
|
4975
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.section, children: [
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.teamsRow, children: [
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4913
4979
|
TeamButton,
|
|
4914
4980
|
{
|
|
4915
4981
|
name: homeName,
|
|
@@ -4923,7 +4989,7 @@ function JoinGameSheet({
|
|
|
4923
4989
|
t
|
|
4924
4990
|
}
|
|
4925
4991
|
),
|
|
4926
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4927
4993
|
TeamButton,
|
|
4928
4994
|
{
|
|
4929
4995
|
name: awayName,
|
|
@@ -4939,64 +5005,64 @@ function JoinGameSheet({
|
|
|
4939
5005
|
)
|
|
4940
5006
|
] })
|
|
4941
5007
|
] }),
|
|
4942
|
-
/* @__PURE__ */ (0,
|
|
4943
|
-
/* @__PURE__ */ (0,
|
|
4944
|
-
/* @__PURE__ */ (0,
|
|
4945
|
-
/* @__PURE__ */ (0,
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5009
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
4946
5012
|
buyIn,
|
|
4947
5013
|
" SOL"
|
|
4948
5014
|
] })
|
|
4949
5015
|
] }),
|
|
4950
|
-
/* @__PURE__ */ (0,
|
|
4951
|
-
isPoolModeEnabled ? /* @__PURE__ */ (0,
|
|
4952
|
-
/* @__PURE__ */ (0,
|
|
4953
|
-
/* @__PURE__ */ (0,
|
|
4954
|
-
/* @__PURE__ */ (0,
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5017
|
+
isPoolModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: bettors.length })
|
|
4955
5021
|
] }),
|
|
4956
|
-
/* @__PURE__ */ (0,
|
|
4957
|
-
/* @__PURE__ */ (0,
|
|
4958
|
-
/* @__PURE__ */ (0,
|
|
4959
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5024
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5025
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: [
|
|
4960
5026
|
totalPool,
|
|
4961
5027
|
" SOL"
|
|
4962
5028
|
] })
|
|
4963
5029
|
] })
|
|
4964
|
-
] }) : /* @__PURE__ */ (0,
|
|
4965
|
-
/* @__PURE__ */ (0,
|
|
4966
|
-
/* @__PURE__ */ (0,
|
|
4967
|
-
/* @__PURE__ */ (0,
|
|
5030
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
5031
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5032
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: selectedName })
|
|
4968
5034
|
] }),
|
|
4969
|
-
/* @__PURE__ */ (0,
|
|
4970
|
-
/* @__PURE__ */ (0,
|
|
4971
|
-
/* @__PURE__ */ (0,
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5036
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5037
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5038
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: [
|
|
4973
5039
|
poolAfterJoin,
|
|
4974
5040
|
" SOL"
|
|
4975
5041
|
] })
|
|
4976
5042
|
] }),
|
|
4977
|
-
/* @__PURE__ */ (0,
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5044
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5046
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
4981
5047
|
] })
|
|
4982
5048
|
] })
|
|
4983
5049
|
] }),
|
|
4984
|
-
alreadyJoined && /* @__PURE__ */ (0,
|
|
4985
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
4986
|
-
/* @__PURE__ */ (0,
|
|
4987
|
-
|
|
5050
|
+
alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5051
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5052
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5053
|
+
import_react_native18.TouchableOpacity,
|
|
4988
5054
|
{
|
|
4989
5055
|
style: [
|
|
4990
|
-
|
|
5056
|
+
styles12.ctaButton,
|
|
4991
5057
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
4992
5058
|
],
|
|
4993
5059
|
disabled: !canJoin,
|
|
4994
5060
|
onPress: handleJoin,
|
|
4995
5061
|
activeOpacity: 0.8,
|
|
4996
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
4997
|
-
/* @__PURE__ */ (0,
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
4999
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5062
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.ctaLoading, children: [
|
|
5063
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5064
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: statusLabel })
|
|
5065
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.ctaText, !canJoin && { opacity: 0.5 }], children: alreadyJoined ? "Already Joined" : isPoolModeEnabled ? `Join Pool \u2014 ${buyIn} SOL` : selectedTeam ? `Join Game \u2014 ${buyIn} SOL` : "Pick a side to join" })
|
|
5000
5066
|
}
|
|
5001
5067
|
)
|
|
5002
5068
|
] }) })
|
|
@@ -5020,32 +5086,32 @@ function TeamButton({
|
|
|
5020
5086
|
const [imgFailed, setImgFailed] = (0, import_react27.useState)(false);
|
|
5021
5087
|
const Img = ImageComponent || require("react-native").Image;
|
|
5022
5088
|
const showImage = imageUrl && !imgFailed;
|
|
5023
|
-
return /* @__PURE__ */ (0,
|
|
5024
|
-
|
|
5089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
5090
|
+
import_react_native18.TouchableOpacity,
|
|
5025
5091
|
{
|
|
5026
|
-
style: [
|
|
5092
|
+
style: [styles12.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5027
5093
|
onPress,
|
|
5028
5094
|
activeOpacity: 0.7,
|
|
5029
5095
|
children: [
|
|
5030
|
-
showImage ? /* @__PURE__ */ (0,
|
|
5031
|
-
/* @__PURE__ */ (0,
|
|
5032
|
-
/* @__PURE__ */ (0,
|
|
5096
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Img, { source: { uri: imageUrl }, style: styles12.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.teamLogo, styles12.teamLogoPlaceholder] }),
|
|
5097
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamOdds, { color }], children: [
|
|
5033
5099
|
odds,
|
|
5034
5100
|
"x"
|
|
5035
5101
|
] }),
|
|
5036
|
-
/* @__PURE__ */ (0,
|
|
5102
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.teamBets, { color: t.textMuted }], children: [
|
|
5037
5103
|
bets,
|
|
5038
5104
|
" ",
|
|
5039
5105
|
bets === 1 ? "bet" : "bets"
|
|
5040
5106
|
] }),
|
|
5041
|
-
selected && /* @__PURE__ */ (0,
|
|
5107
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.teamBadgeText, children: "Selected" }) })
|
|
5042
5108
|
]
|
|
5043
5109
|
}
|
|
5044
5110
|
);
|
|
5045
5111
|
}
|
|
5046
|
-
var
|
|
5112
|
+
var styles12 = import_react_native18.StyleSheet.create({
|
|
5047
5113
|
overlay: {
|
|
5048
|
-
...
|
|
5114
|
+
...import_react_native18.StyleSheet.absoluteFillObject,
|
|
5049
5115
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5050
5116
|
},
|
|
5051
5117
|
overlayTap: {
|
|
@@ -5195,8 +5261,8 @@ var styles11 = import_react_native17.StyleSheet.create({
|
|
|
5195
5261
|
|
|
5196
5262
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5197
5263
|
var import_react28 = require("react");
|
|
5198
|
-
var
|
|
5199
|
-
var
|
|
5264
|
+
var import_react_native19 = require("react-native");
|
|
5265
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5200
5266
|
var STATUS_LABELS4 = {
|
|
5201
5267
|
building: "Building transaction...",
|
|
5202
5268
|
signing: "Approve in wallet...",
|
|
@@ -5215,12 +5281,12 @@ function ClaimPrizeSheet({
|
|
|
5215
5281
|
const t = useDubsTheme();
|
|
5216
5282
|
const { wallet } = useDubs();
|
|
5217
5283
|
const mutation = useClaim();
|
|
5218
|
-
const overlayOpacity = (0, import_react28.useRef)(new
|
|
5219
|
-
const celebrationScale = (0, import_react28.useRef)(new
|
|
5220
|
-
const celebrationOpacity = (0, import_react28.useRef)(new
|
|
5284
|
+
const overlayOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5285
|
+
const celebrationScale = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5286
|
+
const celebrationOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5221
5287
|
const [showCelebration, setShowCelebration] = (0, import_react28.useState)(false);
|
|
5222
5288
|
(0, import_react28.useEffect)(() => {
|
|
5223
|
-
|
|
5289
|
+
import_react_native19.Animated.timing(overlayOpacity, {
|
|
5224
5290
|
toValue: visible ? 1 : 0,
|
|
5225
5291
|
duration: 250,
|
|
5226
5292
|
useNativeDriver: true
|
|
@@ -5237,14 +5303,14 @@ function ClaimPrizeSheet({
|
|
|
5237
5303
|
(0, import_react28.useEffect)(() => {
|
|
5238
5304
|
if (mutation.status === "success" && mutation.data) {
|
|
5239
5305
|
setShowCelebration(true);
|
|
5240
|
-
|
|
5241
|
-
|
|
5306
|
+
import_react_native19.Animated.parallel([
|
|
5307
|
+
import_react_native19.Animated.spring(celebrationScale, {
|
|
5242
5308
|
toValue: 1,
|
|
5243
5309
|
tension: 50,
|
|
5244
5310
|
friction: 6,
|
|
5245
5311
|
useNativeDriver: true
|
|
5246
5312
|
}),
|
|
5247
|
-
|
|
5313
|
+
import_react_native19.Animated.timing(celebrationOpacity, {
|
|
5248
5314
|
toValue: 1,
|
|
5249
5315
|
duration: 300,
|
|
5250
5316
|
useNativeDriver: true
|
|
@@ -5276,62 +5342,62 @@ function ClaimPrizeSheet({
|
|
|
5276
5342
|
}
|
|
5277
5343
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5278
5344
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5279
|
-
return /* @__PURE__ */ (0,
|
|
5280
|
-
|
|
5345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5346
|
+
import_react_native19.Modal,
|
|
5281
5347
|
{
|
|
5282
5348
|
visible,
|
|
5283
5349
|
animationType: "slide",
|
|
5284
5350
|
transparent: true,
|
|
5285
5351
|
onRequestClose: onDismiss,
|
|
5286
5352
|
children: [
|
|
5287
|
-
/* @__PURE__ */ (0,
|
|
5288
|
-
/* @__PURE__ */ (0,
|
|
5289
|
-
|
|
5353
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Animated.View, { style: [styles13.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { style: styles13.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5354
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5355
|
+
import_react_native19.KeyboardAvoidingView,
|
|
5290
5356
|
{
|
|
5291
|
-
style:
|
|
5292
|
-
behavior:
|
|
5293
|
-
children: /* @__PURE__ */ (0,
|
|
5294
|
-
/* @__PURE__ */ (0,
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5296
|
-
/* @__PURE__ */ (0,
|
|
5297
|
-
/* @__PURE__ */ (0,
|
|
5357
|
+
style: styles13.keyboardView,
|
|
5358
|
+
behavior: import_react_native19.Platform.OS === "ios" ? "padding" : void 0,
|
|
5359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.sheet, { backgroundColor: t.background }], children: [
|
|
5360
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5361
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.header, children: [
|
|
5362
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
5363
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5298
5364
|
] }),
|
|
5299
|
-
showCelebration && /* @__PURE__ */ (0,
|
|
5300
|
-
|
|
5365
|
+
showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5366
|
+
import_react_native19.Animated.View,
|
|
5301
5367
|
{
|
|
5302
5368
|
style: [
|
|
5303
|
-
|
|
5369
|
+
styles13.celebrationContainer,
|
|
5304
5370
|
{
|
|
5305
5371
|
opacity: celebrationOpacity,
|
|
5306
5372
|
transform: [{ scale: celebrationScale }]
|
|
5307
5373
|
}
|
|
5308
5374
|
],
|
|
5309
5375
|
children: [
|
|
5310
|
-
/* @__PURE__ */ (0,
|
|
5311
|
-
/* @__PURE__ */ (0,
|
|
5376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.celebrationText, { color: t.success }], children: [
|
|
5312
5378
|
"+",
|
|
5313
5379
|
prizeAmount,
|
|
5314
5380
|
" SOL"
|
|
5315
5381
|
] }),
|
|
5316
|
-
/* @__PURE__ */ (0,
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5317
5383
|
]
|
|
5318
5384
|
}
|
|
5319
5385
|
),
|
|
5320
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5321
|
-
/* @__PURE__ */ (0,
|
|
5322
|
-
/* @__PURE__ */ (0,
|
|
5323
|
-
/* @__PURE__ */ (0,
|
|
5386
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.success }], children: [
|
|
5324
5390
|
prizeAmount,
|
|
5325
5391
|
" SOL"
|
|
5326
5392
|
] })
|
|
5327
5393
|
] }),
|
|
5328
|
-
/* @__PURE__ */ (0,
|
|
5329
|
-
/* @__PURE__ */ (0,
|
|
5330
|
-
/* @__PURE__ */ (0,
|
|
5331
|
-
/* @__PURE__ */ (0,
|
|
5332
|
-
|
|
5394
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5396
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
5397
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5398
|
+
import_react_native19.Text,
|
|
5333
5399
|
{
|
|
5334
|
-
style: [
|
|
5400
|
+
style: [styles13.summaryValue, { color: t.text }],
|
|
5335
5401
|
numberOfLines: 1,
|
|
5336
5402
|
children: [
|
|
5337
5403
|
gameId.slice(0, 8),
|
|
@@ -5342,21 +5408,21 @@ function ClaimPrizeSheet({
|
|
|
5342
5408
|
)
|
|
5343
5409
|
] })
|
|
5344
5410
|
] }),
|
|
5345
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5346
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5347
|
-
|
|
5411
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5412
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5413
|
+
import_react_native19.TouchableOpacity,
|
|
5348
5414
|
{
|
|
5349
5415
|
style: [
|
|
5350
|
-
|
|
5416
|
+
styles13.ctaButton,
|
|
5351
5417
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5352
5418
|
],
|
|
5353
5419
|
disabled: !canClaim,
|
|
5354
5420
|
onPress: handleClaim,
|
|
5355
5421
|
activeOpacity: 0.8,
|
|
5356
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5357
|
-
/* @__PURE__ */ (0,
|
|
5358
|
-
/* @__PURE__ */ (0,
|
|
5359
|
-
] }) : /* @__PURE__ */ (0,
|
|
5422
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.ctaLoading, children: [
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.ctaText, children: statusLabel })
|
|
5425
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
5360
5426
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5361
5427
|
" \u2014 ",
|
|
5362
5428
|
prizeAmount,
|
|
@@ -5364,7 +5430,7 @@ function ClaimPrizeSheet({
|
|
|
5364
5430
|
] })
|
|
5365
5431
|
}
|
|
5366
5432
|
),
|
|
5367
|
-
mutation.data?.explorerUrl && /* @__PURE__ */ (0,
|
|
5433
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5368
5434
|
] }) })
|
|
5369
5435
|
}
|
|
5370
5436
|
)
|
|
@@ -5372,9 +5438,9 @@ function ClaimPrizeSheet({
|
|
|
5372
5438
|
}
|
|
5373
5439
|
);
|
|
5374
5440
|
}
|
|
5375
|
-
var
|
|
5441
|
+
var styles13 = import_react_native19.StyleSheet.create({
|
|
5376
5442
|
overlay: {
|
|
5377
|
-
...
|
|
5443
|
+
...import_react_native19.StyleSheet.absoluteFillObject,
|
|
5378
5444
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5379
5445
|
},
|
|
5380
5446
|
overlayTap: {
|
|
@@ -5498,8 +5564,8 @@ var styles12 = import_react_native18.StyleSheet.create({
|
|
|
5498
5564
|
|
|
5499
5565
|
// src/ui/game/ClaimButton.tsx
|
|
5500
5566
|
var import_react29 = require("react");
|
|
5501
|
-
var
|
|
5502
|
-
var
|
|
5567
|
+
var import_react_native20 = require("react-native");
|
|
5568
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5503
5569
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5504
5570
|
const t = useDubsTheme();
|
|
5505
5571
|
const { wallet } = useDubs();
|
|
@@ -5529,13 +5595,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5529
5595
|
}
|
|
5530
5596
|
const label = isRefund ? "Refund" : "Prize";
|
|
5531
5597
|
if (claimStatus.hasClaimed) {
|
|
5532
|
-
return /* @__PURE__ */ (0,
|
|
5533
|
-
|
|
5598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5599
|
+
import_react_native20.TouchableOpacity,
|
|
5534
5600
|
{
|
|
5535
|
-
style: [
|
|
5601
|
+
style: [styles14.badge, { borderColor: t.accent }, style],
|
|
5536
5602
|
activeOpacity: 1,
|
|
5537
5603
|
disabled: true,
|
|
5538
|
-
children: /* @__PURE__ */ (0,
|
|
5604
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.badgeText, { color: t.accent }], children: [
|
|
5539
5605
|
label,
|
|
5540
5606
|
" Claimed!"
|
|
5541
5607
|
] })
|
|
@@ -5545,14 +5611,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5545
5611
|
if (!isEligible) {
|
|
5546
5612
|
return null;
|
|
5547
5613
|
}
|
|
5548
|
-
return /* @__PURE__ */ (0,
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
5550
|
-
|
|
5614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5616
|
+
import_react_native20.TouchableOpacity,
|
|
5551
5617
|
{
|
|
5552
|
-
style: [
|
|
5618
|
+
style: [styles14.button, { backgroundColor: t.accent }, style],
|
|
5553
5619
|
activeOpacity: 0.8,
|
|
5554
5620
|
onPress: () => setSheetVisible(true),
|
|
5555
|
-
children: /* @__PURE__ */ (0,
|
|
5621
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: styles14.buttonText, children: [
|
|
5556
5622
|
"Claim ",
|
|
5557
5623
|
label,
|
|
5558
5624
|
" \u2014 ",
|
|
@@ -5561,7 +5627,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5561
5627
|
] })
|
|
5562
5628
|
}
|
|
5563
5629
|
),
|
|
5564
|
-
/* @__PURE__ */ (0,
|
|
5630
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5565
5631
|
ClaimPrizeSheet,
|
|
5566
5632
|
{
|
|
5567
5633
|
visible: sheetVisible,
|
|
@@ -5575,7 +5641,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5575
5641
|
)
|
|
5576
5642
|
] });
|
|
5577
5643
|
}
|
|
5578
|
-
var
|
|
5644
|
+
var styles14 = import_react_native20.StyleSheet.create({
|
|
5579
5645
|
button: {
|
|
5580
5646
|
height: 52,
|
|
5581
5647
|
borderRadius: 14,
|