@dubsdotapp/expo 0.5.12 → 0.5.14
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 +420 -434
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +366 -381
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/game/CreateGameSheet.tsx +20 -60
- package/src/ui/game/JoinGameSheet.tsx +1 -74
- package/src/ui/game/TeamButton.tsx +85 -0
package/dist/index.mjs
CHANGED
|
@@ -5320,16 +5320,16 @@ var styles12 = StyleSheet13.create({
|
|
|
5320
5320
|
});
|
|
5321
5321
|
|
|
5322
5322
|
// src/ui/game/JoinGameSheet.tsx
|
|
5323
|
-
import { useState as
|
|
5323
|
+
import { useState as useState29, useEffect as useEffect17, useRef as useRef10, useCallback as useCallback24, useMemo as useMemo9 } from "react";
|
|
5324
5324
|
import {
|
|
5325
|
-
View as
|
|
5326
|
-
Text as
|
|
5325
|
+
View as View16,
|
|
5326
|
+
Text as Text16,
|
|
5327
5327
|
Image as Image6,
|
|
5328
|
-
TouchableOpacity as
|
|
5328
|
+
TouchableOpacity as TouchableOpacity11,
|
|
5329
5329
|
ActivityIndicator as ActivityIndicator8,
|
|
5330
5330
|
Modal as Modal3,
|
|
5331
5331
|
Animated as Animated4,
|
|
5332
|
-
StyleSheet as
|
|
5332
|
+
StyleSheet as StyleSheet16,
|
|
5333
5333
|
KeyboardAvoidingView as KeyboardAvoidingView4,
|
|
5334
5334
|
Platform as Platform8
|
|
5335
5335
|
} from "react-native";
|
|
@@ -5529,8 +5529,90 @@ var styles13 = StyleSheet14.create({
|
|
|
5529
5529
|
}
|
|
5530
5530
|
});
|
|
5531
5531
|
|
|
5532
|
+
// src/ui/game/TeamButton.tsx
|
|
5533
|
+
import { useState as useState28 } from "react";
|
|
5534
|
+
import { View as View15, Text as Text15, TouchableOpacity as TouchableOpacity10, StyleSheet as StyleSheet15 } from "react-native";
|
|
5535
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5536
|
+
function TeamButton({
|
|
5537
|
+
name,
|
|
5538
|
+
imageUrl,
|
|
5539
|
+
odds,
|
|
5540
|
+
bets,
|
|
5541
|
+
color,
|
|
5542
|
+
selected,
|
|
5543
|
+
onPress,
|
|
5544
|
+
ImageComponent,
|
|
5545
|
+
t
|
|
5546
|
+
}) {
|
|
5547
|
+
const [imgFailed, setImgFailed] = useState28(false);
|
|
5548
|
+
const Img = ImageComponent || __require("react-native").Image;
|
|
5549
|
+
const showImage = imageUrl && !imgFailed;
|
|
5550
|
+
return /* @__PURE__ */ jsxs14(
|
|
5551
|
+
TouchableOpacity10,
|
|
5552
|
+
{
|
|
5553
|
+
style: [styles14.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5554
|
+
onPress,
|
|
5555
|
+
activeOpacity: 0.7,
|
|
5556
|
+
children: [
|
|
5557
|
+
showImage ? /* @__PURE__ */ jsx17(Img, { source: { uri: imageUrl }, style: styles14.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx17(View15, { style: [styles14.teamLogo, styles14.teamLogoPlaceholder] }),
|
|
5558
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5559
|
+
odds !== "\u2014" && /* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamOdds, { color }], children: [
|
|
5560
|
+
odds,
|
|
5561
|
+
"x"
|
|
5562
|
+
] }),
|
|
5563
|
+
bets > 0 && /* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamBets, { color: t.textMuted }], children: [
|
|
5564
|
+
bets,
|
|
5565
|
+
" ",
|
|
5566
|
+
bets === 1 ? "bet" : "bets"
|
|
5567
|
+
] }),
|
|
5568
|
+
selected && /* @__PURE__ */ jsx17(View15, { style: [styles14.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ jsx17(Text15, { style: styles14.teamBadgeText, children: "Selected" }) })
|
|
5569
|
+
]
|
|
5570
|
+
}
|
|
5571
|
+
);
|
|
5572
|
+
}
|
|
5573
|
+
var styles14 = StyleSheet15.create({
|
|
5574
|
+
teamOption: {
|
|
5575
|
+
flex: 1,
|
|
5576
|
+
borderWidth: 2,
|
|
5577
|
+
borderRadius: 16,
|
|
5578
|
+
padding: 16,
|
|
5579
|
+
alignItems: "center",
|
|
5580
|
+
gap: 8
|
|
5581
|
+
},
|
|
5582
|
+
teamLogo: {
|
|
5583
|
+
width: 48,
|
|
5584
|
+
height: 48,
|
|
5585
|
+
borderRadius: 24
|
|
5586
|
+
},
|
|
5587
|
+
teamLogoPlaceholder: {
|
|
5588
|
+
backgroundColor: "rgba(128,128,128,0.2)"
|
|
5589
|
+
},
|
|
5590
|
+
teamName: {
|
|
5591
|
+
fontSize: 15,
|
|
5592
|
+
fontWeight: "700"
|
|
5593
|
+
},
|
|
5594
|
+
teamOdds: {
|
|
5595
|
+
fontSize: 20,
|
|
5596
|
+
fontWeight: "800"
|
|
5597
|
+
},
|
|
5598
|
+
teamBets: {
|
|
5599
|
+
fontSize: 12
|
|
5600
|
+
},
|
|
5601
|
+
teamBadge: {
|
|
5602
|
+
borderRadius: 8,
|
|
5603
|
+
paddingHorizontal: 12,
|
|
5604
|
+
paddingVertical: 4,
|
|
5605
|
+
marginTop: 4
|
|
5606
|
+
},
|
|
5607
|
+
teamBadgeText: {
|
|
5608
|
+
color: "#FFF",
|
|
5609
|
+
fontSize: 12,
|
|
5610
|
+
fontWeight: "700"
|
|
5611
|
+
}
|
|
5612
|
+
});
|
|
5613
|
+
|
|
5532
5614
|
// src/ui/game/JoinGameSheet.tsx
|
|
5533
|
-
import { Fragment as Fragment4, jsx as
|
|
5615
|
+
import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5534
5616
|
var STATUS_LABELS3 = {
|
|
5535
5617
|
building: "Building transaction...",
|
|
5536
5618
|
signing: "Approve in wallet...",
|
|
@@ -5565,9 +5647,9 @@ function JoinGameSheet({
|
|
|
5565
5647
|
const { wallet } = useDubs();
|
|
5566
5648
|
const mutation = useJoinGame();
|
|
5567
5649
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
5568
|
-
const [selectedTeam, setSelectedTeam] =
|
|
5569
|
-
const [wager, setWager] =
|
|
5570
|
-
const [showSuccess, setShowSuccess] =
|
|
5650
|
+
const [selectedTeam, setSelectedTeam] = useState29(null);
|
|
5651
|
+
const [wager, setWager] = useState29(game.buyIn);
|
|
5652
|
+
const [showSuccess, setShowSuccess] = useState29(false);
|
|
5571
5653
|
const overlayOpacity = useRef10(new Animated4.Value(0)).current;
|
|
5572
5654
|
const successScale = useRef10(new Animated4.Value(0)).current;
|
|
5573
5655
|
const successOpacity = useRef10(new Animated4.Value(0)).current;
|
|
@@ -5651,7 +5733,7 @@ function JoinGameSheet({
|
|
|
5651
5733
|
}
|
|
5652
5734
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, wager]);
|
|
5653
5735
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
5654
|
-
return /* @__PURE__ */
|
|
5736
|
+
return /* @__PURE__ */ jsxs15(
|
|
5655
5737
|
Modal3,
|
|
5656
5738
|
{
|
|
5657
5739
|
visible,
|
|
@@ -5659,49 +5741,49 @@ function JoinGameSheet({
|
|
|
5659
5741
|
transparent: true,
|
|
5660
5742
|
onRequestClose: onDismiss,
|
|
5661
5743
|
children: [
|
|
5662
|
-
/* @__PURE__ */
|
|
5663
|
-
showSuccess && /* @__PURE__ */
|
|
5664
|
-
/* @__PURE__ */
|
|
5665
|
-
/* @__PURE__ */
|
|
5666
|
-
/* @__PURE__ */
|
|
5744
|
+
/* @__PURE__ */ jsx18(Animated4.View, { style: [styles15.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx18(TouchableOpacity11, { style: styles15.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5745
|
+
showSuccess && /* @__PURE__ */ jsx18(View16, { style: styles15.successOverlay, children: /* @__PURE__ */ jsxs15(Animated4.View, { style: [styles15.successContent, { opacity: successOpacity, transform: [{ scale: successScale }] }], children: [
|
|
5746
|
+
/* @__PURE__ */ jsx18(Text16, { style: styles15.successEmoji, children: "\u{1F389}" }),
|
|
5747
|
+
/* @__PURE__ */ jsx18(Text16, { style: styles15.successTitle, children: "You're in!" }),
|
|
5748
|
+
/* @__PURE__ */ jsxs15(Text16, { style: styles15.successSub, children: [
|
|
5667
5749
|
formatSol(wager),
|
|
5668
5750
|
" SOL on ",
|
|
5669
5751
|
selectedTeam === "home" ? homeName : awayName
|
|
5670
5752
|
] })
|
|
5671
5753
|
] }) }),
|
|
5672
|
-
/* @__PURE__ */
|
|
5754
|
+
/* @__PURE__ */ jsx18(
|
|
5673
5755
|
KeyboardAvoidingView4,
|
|
5674
5756
|
{
|
|
5675
|
-
style:
|
|
5757
|
+
style: styles15.keyboardView,
|
|
5676
5758
|
behavior: Platform8.OS === "ios" ? "padding" : void 0,
|
|
5677
|
-
children: /* @__PURE__ */
|
|
5678
|
-
/* @__PURE__ */
|
|
5679
|
-
/* @__PURE__ */
|
|
5680
|
-
/* @__PURE__ */
|
|
5681
|
-
/* @__PURE__ */
|
|
5759
|
+
children: /* @__PURE__ */ jsx18(View16, { style: styles15.sheetPositioner, children: /* @__PURE__ */ jsxs15(View16, { style: [styles15.sheet, { backgroundColor: t.background }], children: [
|
|
5760
|
+
/* @__PURE__ */ jsx18(View16, { style: styles15.handleRow, children: /* @__PURE__ */ jsx18(View16, { style: [styles15.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5761
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.header, children: [
|
|
5762
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
5763
|
+
/* @__PURE__ */ jsx18(TouchableOpacity11, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx18(Text16, { style: [styles15.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5682
5764
|
] }),
|
|
5683
|
-
bettors.length > 0 && /* @__PURE__ */
|
|
5684
|
-
/* @__PURE__ */
|
|
5765
|
+
bettors.length > 0 && /* @__PURE__ */ jsxs15(View16, { style: styles15.bettorsSection, children: [
|
|
5766
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.bettorsLabel, { color: t.textMuted }], children: [
|
|
5685
5767
|
bettors.length,
|
|
5686
5768
|
" ",
|
|
5687
5769
|
bettors.length === 1 ? "player" : "players",
|
|
5688
5770
|
" in this game"
|
|
5689
5771
|
] }),
|
|
5690
|
-
/* @__PURE__ */
|
|
5772
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.bettorsRow, children: [
|
|
5691
5773
|
bettors.slice(0, 6).map((b, i) => {
|
|
5692
5774
|
const pngUrl = toPng(b.avatar);
|
|
5693
|
-
return /* @__PURE__ */
|
|
5775
|
+
return /* @__PURE__ */ jsx18(View16, { style: [styles15.bettorCircle, { backgroundColor: ["#EF4444", "#3B82F6", "#22C55E", "#F59E0B", "#A855F7", "#EC4899"][i % 6] }], children: pngUrl ? /* @__PURE__ */ jsx18(Image6, { source: { uri: pngUrl }, style: styles15.bettorImg }) : /* @__PURE__ */ jsx18(Text16, { style: styles15.bettorInitial, children: (b.username ?? b.wallet).charAt(0).toUpperCase() }) }, b.wallet);
|
|
5694
5776
|
}),
|
|
5695
|
-
bettors.length > 6 && /* @__PURE__ */
|
|
5777
|
+
bettors.length > 6 && /* @__PURE__ */ jsx18(View16, { style: [styles15.bettorCircle, { backgroundColor: "#2C2C2E" }], children: /* @__PURE__ */ jsxs15(Text16, { style: styles15.bettorOverflow, children: [
|
|
5696
5778
|
"+",
|
|
5697
5779
|
bettors.length - 6
|
|
5698
5780
|
] }) })
|
|
5699
5781
|
] })
|
|
5700
5782
|
] }),
|
|
5701
|
-
!isCustomGame && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */
|
|
5702
|
-
/* @__PURE__ */
|
|
5703
|
-
/* @__PURE__ */
|
|
5704
|
-
/* @__PURE__ */
|
|
5783
|
+
!isCustomGame && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsxs15(View16, { style: styles15.section, children: [
|
|
5784
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5785
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.teamsRow, children: [
|
|
5786
|
+
/* @__PURE__ */ jsx18(
|
|
5705
5787
|
TeamButton,
|
|
5706
5788
|
{
|
|
5707
5789
|
name: homeName,
|
|
@@ -5718,7 +5800,7 @@ function JoinGameSheet({
|
|
|
5718
5800
|
t
|
|
5719
5801
|
}
|
|
5720
5802
|
),
|
|
5721
|
-
/* @__PURE__ */
|
|
5803
|
+
/* @__PURE__ */ jsx18(
|
|
5722
5804
|
TeamButton,
|
|
5723
5805
|
{
|
|
5724
5806
|
name: awayName,
|
|
@@ -5737,52 +5819,52 @@ function JoinGameSheet({
|
|
|
5737
5819
|
)
|
|
5738
5820
|
] })
|
|
5739
5821
|
] }),
|
|
5740
|
-
alreadyJoined && myBet && /* @__PURE__ */
|
|
5741
|
-
/* @__PURE__ */
|
|
5742
|
-
/* @__PURE__ */
|
|
5743
|
-
/* @__PURE__ */
|
|
5822
|
+
alreadyJoined && myBet && /* @__PURE__ */ jsxs15(View16, { style: [styles15.myBetCard, { backgroundColor: (myBet.team === "home" ? homeColor : awayColor) + "15", borderColor: myBet.team === "home" ? homeColor : awayColor }], children: [
|
|
5823
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.myBetLabel, { color: myBet.team === "home" ? homeColor : awayColor }], children: "YOUR BET" }),
|
|
5824
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.myBetTeam, { color: t.text }], children: myBet.team === "home" ? homeName : awayName }),
|
|
5825
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.myBetAmount, { color: t.textMuted }], children: [
|
|
5744
5826
|
formatSol(myBet.amount),
|
|
5745
5827
|
" SOL"
|
|
5746
5828
|
] })
|
|
5747
5829
|
] }),
|
|
5748
|
-
/* @__PURE__ */
|
|
5749
|
-
/* @__PURE__ */
|
|
5750
|
-
/* @__PURE__ */
|
|
5751
|
-
/* @__PURE__ */
|
|
5830
|
+
/* @__PURE__ */ jsxs15(View16, { style: [styles15.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5831
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
5832
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
5833
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.summaryValue, { color: t.text }], children: [
|
|
5752
5834
|
formatSol(wager),
|
|
5753
5835
|
" SOL"
|
|
5754
5836
|
] })
|
|
5755
5837
|
] }),
|
|
5756
|
-
/* @__PURE__ */
|
|
5757
|
-
isPoolModeEnabled ? /* @__PURE__ */
|
|
5758
|
-
/* @__PURE__ */
|
|
5759
|
-
/* @__PURE__ */
|
|
5760
|
-
/* @__PURE__ */
|
|
5838
|
+
/* @__PURE__ */ jsx18(View16, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
|
|
5839
|
+
isPoolModeEnabled ? /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
5840
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
5841
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5842
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryValue, { color: t.text }], children: bettors.length })
|
|
5761
5843
|
] }),
|
|
5762
|
-
/* @__PURE__ */
|
|
5763
|
-
/* @__PURE__ */
|
|
5764
|
-
/* @__PURE__ */
|
|
5765
|
-
/* @__PURE__ */
|
|
5844
|
+
/* @__PURE__ */ jsx18(View16, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
|
|
5845
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
5846
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5847
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.summaryValue, { color: t.success }], children: [
|
|
5766
5848
|
formatSol(totalPool),
|
|
5767
5849
|
" SOL"
|
|
5768
5850
|
] })
|
|
5769
5851
|
] })
|
|
5770
|
-
] }) : /* @__PURE__ */
|
|
5771
|
-
/* @__PURE__ */
|
|
5772
|
-
/* @__PURE__ */
|
|
5773
|
-
/* @__PURE__ */
|
|
5852
|
+
] }) : /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
5853
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
5854
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5855
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.summaryValue, { color: t.text }], children: [
|
|
5774
5856
|
formatSol(poolAfterJoin),
|
|
5775
5857
|
" SOL"
|
|
5776
5858
|
] })
|
|
5777
5859
|
] }),
|
|
5778
|
-
/* @__PURE__ */
|
|
5779
|
-
/* @__PURE__ */
|
|
5780
|
-
/* @__PURE__ */
|
|
5781
|
-
/* @__PURE__ */
|
|
5860
|
+
/* @__PURE__ */ jsx18(View16, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
|
|
5861
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
5862
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5863
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5782
5864
|
] })
|
|
5783
5865
|
] })
|
|
5784
5866
|
] }),
|
|
5785
|
-
selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */
|
|
5867
|
+
selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsx18(
|
|
5786
5868
|
SolSlider,
|
|
5787
5869
|
{
|
|
5788
5870
|
value: wager,
|
|
@@ -5794,22 +5876,22 @@ function JoinGameSheet({
|
|
|
5794
5876
|
onTick: onSliderTick
|
|
5795
5877
|
}
|
|
5796
5878
|
),
|
|
5797
|
-
alreadyJoined && /* @__PURE__ */
|
|
5798
|
-
mutation.error && /* @__PURE__ */
|
|
5799
|
-
/* @__PURE__ */
|
|
5800
|
-
|
|
5879
|
+
alreadyJoined && /* @__PURE__ */ jsx18(View16, { style: [styles15.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ jsx18(Text16, { style: [styles15.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5880
|
+
mutation.error && /* @__PURE__ */ jsx18(View16, { style: [styles15.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx18(Text16, { style: [styles15.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5881
|
+
/* @__PURE__ */ jsx18(
|
|
5882
|
+
TouchableOpacity11,
|
|
5801
5883
|
{
|
|
5802
5884
|
style: [
|
|
5803
|
-
|
|
5885
|
+
styles15.ctaButton,
|
|
5804
5886
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5805
5887
|
],
|
|
5806
5888
|
disabled: !canJoin,
|
|
5807
5889
|
onPress: handleJoin,
|
|
5808
5890
|
activeOpacity: 0.8,
|
|
5809
|
-
children: isMutating ? /* @__PURE__ */
|
|
5810
|
-
/* @__PURE__ */
|
|
5811
|
-
/* @__PURE__ */
|
|
5812
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
5891
|
+
children: isMutating ? /* @__PURE__ */ jsxs15(View16, { style: styles15.ctaLoading, children: [
|
|
5892
|
+
/* @__PURE__ */ jsx18(ActivityIndicator8, { size: "small", color: "#FFFFFF" }),
|
|
5893
|
+
/* @__PURE__ */ jsx18(Text16, { style: styles15.ctaText, children: statusLabel })
|
|
5894
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx18(Text16, { style: styles15.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ jsx18(Text16, { style: [styles15.ctaText, !canJoin && { opacity: 0.5 }], children: alreadyJoined ? "Already Joined" : isPoolModeEnabled ? `Join Pool \u2014 ${formatSol(wager)} SOL` : selectedTeam ? `Join Game \u2014 ${formatSol(wager)} SOL` : "Pick a side to join" })
|
|
5813
5895
|
}
|
|
5814
5896
|
)
|
|
5815
5897
|
] }) })
|
|
@@ -5819,46 +5901,9 @@ function JoinGameSheet({
|
|
|
5819
5901
|
}
|
|
5820
5902
|
);
|
|
5821
5903
|
}
|
|
5822
|
-
|
|
5823
|
-
name,
|
|
5824
|
-
imageUrl,
|
|
5825
|
-
odds,
|
|
5826
|
-
bets,
|
|
5827
|
-
color,
|
|
5828
|
-
selected,
|
|
5829
|
-
onPress,
|
|
5830
|
-
ImageComponent,
|
|
5831
|
-
t
|
|
5832
|
-
}) {
|
|
5833
|
-
const [imgFailed, setImgFailed] = useState28(false);
|
|
5834
|
-
const Img = ImageComponent || __require("react-native").Image;
|
|
5835
|
-
const showImage = imageUrl && !imgFailed;
|
|
5836
|
-
return /* @__PURE__ */ jsxs14(
|
|
5837
|
-
TouchableOpacity10,
|
|
5838
|
-
{
|
|
5839
|
-
style: [styles14.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5840
|
-
onPress,
|
|
5841
|
-
activeOpacity: 0.7,
|
|
5842
|
-
children: [
|
|
5843
|
-
showImage ? /* @__PURE__ */ jsx17(Img, { source: { uri: imageUrl }, style: styles14.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx17(View15, { style: [styles14.teamLogo, styles14.teamLogoPlaceholder] }),
|
|
5844
|
-
/* @__PURE__ */ jsx17(Text15, { style: [styles14.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5845
|
-
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamOdds, { color }], children: [
|
|
5846
|
-
odds,
|
|
5847
|
-
"x"
|
|
5848
|
-
] }),
|
|
5849
|
-
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamBets, { color: t.textMuted }], children: [
|
|
5850
|
-
bets,
|
|
5851
|
-
" ",
|
|
5852
|
-
bets === 1 ? "bet" : "bets"
|
|
5853
|
-
] }),
|
|
5854
|
-
selected && /* @__PURE__ */ jsx17(View15, { style: [styles14.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ jsx17(Text15, { style: styles14.teamBadgeText, children: "Selected" }) })
|
|
5855
|
-
]
|
|
5856
|
-
}
|
|
5857
|
-
);
|
|
5858
|
-
}
|
|
5859
|
-
var styles14 = StyleSheet15.create({
|
|
5904
|
+
var styles15 = StyleSheet16.create({
|
|
5860
5905
|
overlay: {
|
|
5861
|
-
...
|
|
5906
|
+
...StyleSheet16.absoluteFillObject,
|
|
5862
5907
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5863
5908
|
},
|
|
5864
5909
|
overlayTap: {
|
|
@@ -5941,7 +5986,7 @@ var styles14 = StyleSheet15.create({
|
|
|
5941
5986
|
},
|
|
5942
5987
|
// Success overlay
|
|
5943
5988
|
successOverlay: {
|
|
5944
|
-
...
|
|
5989
|
+
...StyleSheet16.absoluteFillObject,
|
|
5945
5990
|
zIndex: 100,
|
|
5946
5991
|
alignItems: "center",
|
|
5947
5992
|
justifyContent: "center",
|
|
@@ -6046,62 +6091,23 @@ var styles14 = StyleSheet15.create({
|
|
|
6046
6091
|
flexDirection: "row",
|
|
6047
6092
|
alignItems: "center",
|
|
6048
6093
|
gap: 10
|
|
6049
|
-
},
|
|
6050
|
-
// Team button styles
|
|
6051
|
-
teamOption: {
|
|
6052
|
-
flex: 1,
|
|
6053
|
-
borderWidth: 2,
|
|
6054
|
-
borderRadius: 16,
|
|
6055
|
-
padding: 16,
|
|
6056
|
-
alignItems: "center",
|
|
6057
|
-
gap: 8
|
|
6058
|
-
},
|
|
6059
|
-
teamLogo: {
|
|
6060
|
-
width: 48,
|
|
6061
|
-
height: 48,
|
|
6062
|
-
borderRadius: 24
|
|
6063
|
-
},
|
|
6064
|
-
teamLogoPlaceholder: {
|
|
6065
|
-
backgroundColor: "rgba(128,128,128,0.2)"
|
|
6066
|
-
},
|
|
6067
|
-
teamName: {
|
|
6068
|
-
fontSize: 15,
|
|
6069
|
-
fontWeight: "700"
|
|
6070
|
-
},
|
|
6071
|
-
teamOdds: {
|
|
6072
|
-
fontSize: 20,
|
|
6073
|
-
fontWeight: "800"
|
|
6074
|
-
},
|
|
6075
|
-
teamBets: {
|
|
6076
|
-
fontSize: 12
|
|
6077
|
-
},
|
|
6078
|
-
teamBadge: {
|
|
6079
|
-
borderRadius: 8,
|
|
6080
|
-
paddingHorizontal: 12,
|
|
6081
|
-
paddingVertical: 4,
|
|
6082
|
-
marginTop: 4
|
|
6083
|
-
},
|
|
6084
|
-
teamBadgeText: {
|
|
6085
|
-
color: "#FFF",
|
|
6086
|
-
fontSize: 12,
|
|
6087
|
-
fontWeight: "700"
|
|
6088
6094
|
}
|
|
6089
6095
|
});
|
|
6090
6096
|
|
|
6091
6097
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
6092
|
-
import { useState as
|
|
6098
|
+
import { useState as useState30, useEffect as useEffect18, useRef as useRef11, useCallback as useCallback25 } from "react";
|
|
6093
6099
|
import {
|
|
6094
|
-
View as
|
|
6095
|
-
Text as
|
|
6096
|
-
TouchableOpacity as
|
|
6100
|
+
View as View17,
|
|
6101
|
+
Text as Text17,
|
|
6102
|
+
TouchableOpacity as TouchableOpacity12,
|
|
6097
6103
|
ActivityIndicator as ActivityIndicator9,
|
|
6098
6104
|
Modal as Modal4,
|
|
6099
6105
|
Animated as Animated5,
|
|
6100
|
-
StyleSheet as
|
|
6106
|
+
StyleSheet as StyleSheet17,
|
|
6101
6107
|
KeyboardAvoidingView as KeyboardAvoidingView5,
|
|
6102
6108
|
Platform as Platform9
|
|
6103
6109
|
} from "react-native";
|
|
6104
|
-
import { jsx as
|
|
6110
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6105
6111
|
var STATUS_LABELS4 = {
|
|
6106
6112
|
building: "Building transaction...",
|
|
6107
6113
|
signing: "Approve in wallet...",
|
|
@@ -6123,7 +6129,7 @@ function ClaimPrizeSheet({
|
|
|
6123
6129
|
const overlayOpacity = useRef11(new Animated5.Value(0)).current;
|
|
6124
6130
|
const celebrationScale = useRef11(new Animated5.Value(0)).current;
|
|
6125
6131
|
const celebrationOpacity = useRef11(new Animated5.Value(0)).current;
|
|
6126
|
-
const [showCelebration, setShowCelebration] =
|
|
6132
|
+
const [showCelebration, setShowCelebration] = useState30(false);
|
|
6127
6133
|
useEffect18(() => {
|
|
6128
6134
|
Animated5.timing(overlayOpacity, {
|
|
6129
6135
|
toValue: visible ? 1 : 0,
|
|
@@ -6181,7 +6187,7 @@ function ClaimPrizeSheet({
|
|
|
6181
6187
|
}
|
|
6182
6188
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
6183
6189
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
6184
|
-
return /* @__PURE__ */
|
|
6190
|
+
return /* @__PURE__ */ jsxs16(
|
|
6185
6191
|
Modal4,
|
|
6186
6192
|
{
|
|
6187
6193
|
visible,
|
|
@@ -6189,54 +6195,54 @@ function ClaimPrizeSheet({
|
|
|
6189
6195
|
transparent: true,
|
|
6190
6196
|
onRequestClose: onDismiss,
|
|
6191
6197
|
children: [
|
|
6192
|
-
/* @__PURE__ */
|
|
6193
|
-
/* @__PURE__ */
|
|
6198
|
+
/* @__PURE__ */ jsx19(Animated5.View, { style: [styles16.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx19(TouchableOpacity12, { style: styles16.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6199
|
+
/* @__PURE__ */ jsx19(
|
|
6194
6200
|
KeyboardAvoidingView5,
|
|
6195
6201
|
{
|
|
6196
|
-
style:
|
|
6202
|
+
style: styles16.keyboardView,
|
|
6197
6203
|
behavior: Platform9.OS === "ios" ? "padding" : void 0,
|
|
6198
|
-
children: /* @__PURE__ */
|
|
6199
|
-
/* @__PURE__ */
|
|
6200
|
-
/* @__PURE__ */
|
|
6201
|
-
/* @__PURE__ */
|
|
6202
|
-
/* @__PURE__ */
|
|
6204
|
+
children: /* @__PURE__ */ jsx19(View17, { style: styles16.sheetPositioner, children: /* @__PURE__ */ jsxs16(View17, { style: [styles16.sheet, { backgroundColor: t.background }], children: [
|
|
6205
|
+
/* @__PURE__ */ jsx19(View17, { style: styles16.handleRow, children: /* @__PURE__ */ jsx19(View17, { style: [styles16.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6206
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles16.header, children: [
|
|
6207
|
+
/* @__PURE__ */ jsx19(Text17, { style: [styles16.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
6208
|
+
/* @__PURE__ */ jsx19(TouchableOpacity12, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx19(Text17, { style: [styles16.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6203
6209
|
] }),
|
|
6204
|
-
showCelebration && /* @__PURE__ */
|
|
6210
|
+
showCelebration && /* @__PURE__ */ jsxs16(
|
|
6205
6211
|
Animated5.View,
|
|
6206
6212
|
{
|
|
6207
6213
|
style: [
|
|
6208
|
-
|
|
6214
|
+
styles16.celebrationContainer,
|
|
6209
6215
|
{
|
|
6210
6216
|
opacity: celebrationOpacity,
|
|
6211
6217
|
transform: [{ scale: celebrationScale }]
|
|
6212
6218
|
}
|
|
6213
6219
|
],
|
|
6214
6220
|
children: [
|
|
6215
|
-
/* @__PURE__ */
|
|
6216
|
-
/* @__PURE__ */
|
|
6221
|
+
/* @__PURE__ */ jsx19(Text17, { style: styles16.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
6222
|
+
/* @__PURE__ */ jsxs16(Text17, { style: [styles16.celebrationText, { color: t.success }], children: [
|
|
6217
6223
|
"+",
|
|
6218
6224
|
prizeAmount,
|
|
6219
6225
|
" SOL"
|
|
6220
6226
|
] }),
|
|
6221
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ jsx19(Text17, { style: [styles16.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
6222
6228
|
]
|
|
6223
6229
|
}
|
|
6224
6230
|
),
|
|
6225
|
-
!showCelebration && /* @__PURE__ */
|
|
6226
|
-
/* @__PURE__ */
|
|
6227
|
-
/* @__PURE__ */
|
|
6228
|
-
/* @__PURE__ */
|
|
6231
|
+
!showCelebration && /* @__PURE__ */ jsxs16(View17, { style: [styles16.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6232
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles16.summaryRow, children: [
|
|
6233
|
+
/* @__PURE__ */ jsx19(Text17, { style: [styles16.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
6234
|
+
/* @__PURE__ */ jsxs16(Text17, { style: [styles16.summaryValue, { color: t.success }], children: [
|
|
6229
6235
|
prizeAmount,
|
|
6230
6236
|
" SOL"
|
|
6231
6237
|
] })
|
|
6232
6238
|
] }),
|
|
6233
|
-
/* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6235
|
-
/* @__PURE__ */
|
|
6236
|
-
/* @__PURE__ */
|
|
6237
|
-
|
|
6239
|
+
/* @__PURE__ */ jsx19(View17, { style: [styles16.summarySep, { backgroundColor: t.border }] }),
|
|
6240
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles16.summaryRow, children: [
|
|
6241
|
+
/* @__PURE__ */ jsx19(Text17, { style: [styles16.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
6242
|
+
/* @__PURE__ */ jsxs16(
|
|
6243
|
+
Text17,
|
|
6238
6244
|
{
|
|
6239
|
-
style: [
|
|
6245
|
+
style: [styles16.summaryValue, { color: t.text }],
|
|
6240
6246
|
numberOfLines: 1,
|
|
6241
6247
|
children: [
|
|
6242
6248
|
gameId.slice(0, 8),
|
|
@@ -6247,21 +6253,21 @@ function ClaimPrizeSheet({
|
|
|
6247
6253
|
)
|
|
6248
6254
|
] })
|
|
6249
6255
|
] }),
|
|
6250
|
-
mutation.error && /* @__PURE__ */
|
|
6251
|
-
!showCelebration && /* @__PURE__ */
|
|
6252
|
-
|
|
6256
|
+
mutation.error && /* @__PURE__ */ jsx19(View17, { style: [styles16.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx19(Text17, { style: [styles16.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
6257
|
+
!showCelebration && /* @__PURE__ */ jsx19(
|
|
6258
|
+
TouchableOpacity12,
|
|
6253
6259
|
{
|
|
6254
6260
|
style: [
|
|
6255
|
-
|
|
6261
|
+
styles16.ctaButton,
|
|
6256
6262
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
6257
6263
|
],
|
|
6258
6264
|
disabled: !canClaim,
|
|
6259
6265
|
onPress: handleClaim,
|
|
6260
6266
|
activeOpacity: 0.8,
|
|
6261
|
-
children: isMutating ? /* @__PURE__ */
|
|
6262
|
-
/* @__PURE__ */
|
|
6263
|
-
/* @__PURE__ */
|
|
6264
|
-
] }) : /* @__PURE__ */
|
|
6267
|
+
children: isMutating ? /* @__PURE__ */ jsxs16(View17, { style: styles16.ctaLoading, children: [
|
|
6268
|
+
/* @__PURE__ */ jsx19(ActivityIndicator9, { size: "small", color: "#FFFFFF" }),
|
|
6269
|
+
/* @__PURE__ */ jsx19(Text17, { style: styles16.ctaText, children: statusLabel })
|
|
6270
|
+
] }) : /* @__PURE__ */ jsxs16(Text17, { style: [styles16.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
6265
6271
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
6266
6272
|
" \u2014 ",
|
|
6267
6273
|
prizeAmount,
|
|
@@ -6269,7 +6275,7 @@ function ClaimPrizeSheet({
|
|
|
6269
6275
|
] })
|
|
6270
6276
|
}
|
|
6271
6277
|
),
|
|
6272
|
-
mutation.data?.explorerUrl && /* @__PURE__ */
|
|
6278
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ jsx19(Text17, { style: [styles16.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
6273
6279
|
] }) })
|
|
6274
6280
|
}
|
|
6275
6281
|
)
|
|
@@ -6277,9 +6283,9 @@ function ClaimPrizeSheet({
|
|
|
6277
6283
|
}
|
|
6278
6284
|
);
|
|
6279
6285
|
}
|
|
6280
|
-
var
|
|
6286
|
+
var styles16 = StyleSheet17.create({
|
|
6281
6287
|
overlay: {
|
|
6282
|
-
...
|
|
6288
|
+
...StyleSheet17.absoluteFillObject,
|
|
6283
6289
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6284
6290
|
},
|
|
6285
6291
|
overlayTap: {
|
|
@@ -6402,15 +6408,15 @@ var styles15 = StyleSheet16.create({
|
|
|
6402
6408
|
});
|
|
6403
6409
|
|
|
6404
6410
|
// src/ui/game/ClaimButton.tsx
|
|
6405
|
-
import { useState as
|
|
6406
|
-
import { StyleSheet as
|
|
6407
|
-
import { Fragment as Fragment5, jsx as
|
|
6411
|
+
import { useState as useState31, useMemo as useMemo10, useCallback as useCallback26 } from "react";
|
|
6412
|
+
import { StyleSheet as StyleSheet18, Text as Text18, TouchableOpacity as TouchableOpacity13 } from "react-native";
|
|
6413
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6408
6414
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
6409
6415
|
const t = useDubsTheme();
|
|
6410
6416
|
const { wallet } = useDubs();
|
|
6411
6417
|
const game = useGame(gameId);
|
|
6412
6418
|
const claimStatus = useHasClaimed(gameId);
|
|
6413
|
-
const [sheetVisible, setSheetVisible] =
|
|
6419
|
+
const [sheetVisible, setSheetVisible] = useState31(false);
|
|
6414
6420
|
const walletAddress = wallet.publicKey?.toBase58() ?? null;
|
|
6415
6421
|
const myBet = useMemo10(() => {
|
|
6416
6422
|
if (!walletAddress || !game.data?.bettors) return null;
|
|
@@ -6434,13 +6440,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6434
6440
|
}
|
|
6435
6441
|
const label = isRefund ? "Refund" : "Prize";
|
|
6436
6442
|
if (claimStatus.hasClaimed) {
|
|
6437
|
-
return /* @__PURE__ */
|
|
6438
|
-
|
|
6443
|
+
return /* @__PURE__ */ jsx20(
|
|
6444
|
+
TouchableOpacity13,
|
|
6439
6445
|
{
|
|
6440
|
-
style: [
|
|
6446
|
+
style: [styles17.badge, { borderColor: t.accent }, style],
|
|
6441
6447
|
activeOpacity: 1,
|
|
6442
6448
|
disabled: true,
|
|
6443
|
-
children: /* @__PURE__ */
|
|
6449
|
+
children: /* @__PURE__ */ jsxs17(Text18, { style: [styles17.badgeText, { color: t.accent }], children: [
|
|
6444
6450
|
label,
|
|
6445
6451
|
" Claimed!"
|
|
6446
6452
|
] })
|
|
@@ -6450,14 +6456,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6450
6456
|
if (!isEligible) {
|
|
6451
6457
|
return null;
|
|
6452
6458
|
}
|
|
6453
|
-
return /* @__PURE__ */
|
|
6454
|
-
/* @__PURE__ */
|
|
6455
|
-
|
|
6459
|
+
return /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
6460
|
+
/* @__PURE__ */ jsx20(
|
|
6461
|
+
TouchableOpacity13,
|
|
6456
6462
|
{
|
|
6457
|
-
style: [
|
|
6463
|
+
style: [styles17.button, { backgroundColor: t.accent }, style],
|
|
6458
6464
|
activeOpacity: 0.8,
|
|
6459
6465
|
onPress: () => setSheetVisible(true),
|
|
6460
|
-
children: /* @__PURE__ */
|
|
6466
|
+
children: /* @__PURE__ */ jsxs17(Text18, { style: styles17.buttonText, children: [
|
|
6461
6467
|
"Claim ",
|
|
6462
6468
|
label,
|
|
6463
6469
|
" \u2014 ",
|
|
@@ -6466,7 +6472,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6466
6472
|
] })
|
|
6467
6473
|
}
|
|
6468
6474
|
),
|
|
6469
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ jsx20(
|
|
6470
6476
|
ClaimPrizeSheet,
|
|
6471
6477
|
{
|
|
6472
6478
|
visible: sheetVisible,
|
|
@@ -6480,7 +6486,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6480
6486
|
)
|
|
6481
6487
|
] });
|
|
6482
6488
|
}
|
|
6483
|
-
var
|
|
6489
|
+
var styles17 = StyleSheet18.create({
|
|
6484
6490
|
button: {
|
|
6485
6491
|
height: 52,
|
|
6486
6492
|
borderRadius: 14,
|
|
@@ -6510,17 +6516,17 @@ var styles16 = StyleSheet17.create({
|
|
|
6510
6516
|
// src/ui/game/EnterArcadePoolSheet.tsx
|
|
6511
6517
|
import { useEffect as useEffect19, useRef as useRef12, useCallback as useCallback27 } from "react";
|
|
6512
6518
|
import {
|
|
6513
|
-
View as
|
|
6514
|
-
Text as
|
|
6515
|
-
TouchableOpacity as
|
|
6519
|
+
View as View18,
|
|
6520
|
+
Text as Text19,
|
|
6521
|
+
TouchableOpacity as TouchableOpacity14,
|
|
6516
6522
|
ActivityIndicator as ActivityIndicator10,
|
|
6517
6523
|
Modal as Modal5,
|
|
6518
6524
|
Animated as Animated6,
|
|
6519
|
-
StyleSheet as
|
|
6525
|
+
StyleSheet as StyleSheet19,
|
|
6520
6526
|
KeyboardAvoidingView as KeyboardAvoidingView6,
|
|
6521
6527
|
Platform as Platform10
|
|
6522
6528
|
} from "react-native";
|
|
6523
|
-
import { Fragment as Fragment6, jsx as
|
|
6529
|
+
import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6524
6530
|
var STATUS_LABELS5 = {
|
|
6525
6531
|
building: "Building transaction...",
|
|
6526
6532
|
signing: "Approve in wallet...",
|
|
@@ -6585,7 +6591,7 @@ function EnterArcadePoolSheet({
|
|
|
6585
6591
|
const headerTitle = isRejoin ? "Play Again" : "Join Pool";
|
|
6586
6592
|
const ctaLabel = isRejoin ? `Play Again \u2014 ${buyInSol} SOL` : `Join Pool \u2014 ${buyInSol} SOL`;
|
|
6587
6593
|
const successLabel = isRejoin ? "Lives refilled!" : "Joined!";
|
|
6588
|
-
return /* @__PURE__ */
|
|
6594
|
+
return /* @__PURE__ */ jsxs18(
|
|
6589
6595
|
Modal5,
|
|
6590
6596
|
{
|
|
6591
6597
|
visible,
|
|
@@ -6593,68 +6599,68 @@ function EnterArcadePoolSheet({
|
|
|
6593
6599
|
transparent: true,
|
|
6594
6600
|
onRequestClose: onDismiss,
|
|
6595
6601
|
children: [
|
|
6596
|
-
/* @__PURE__ */
|
|
6597
|
-
/* @__PURE__ */
|
|
6602
|
+
/* @__PURE__ */ jsx21(Animated6.View, { style: [styles18.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx21(TouchableOpacity14, { style: styles18.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6603
|
+
/* @__PURE__ */ jsx21(
|
|
6598
6604
|
KeyboardAvoidingView6,
|
|
6599
6605
|
{
|
|
6600
|
-
style:
|
|
6606
|
+
style: styles18.keyboardView,
|
|
6601
6607
|
behavior: Platform10.OS === "ios" ? "padding" : void 0,
|
|
6602
|
-
children: /* @__PURE__ */
|
|
6603
|
-
/* @__PURE__ */
|
|
6604
|
-
/* @__PURE__ */
|
|
6605
|
-
/* @__PURE__ */
|
|
6606
|
-
/* @__PURE__ */
|
|
6608
|
+
children: /* @__PURE__ */ jsx21(View18, { style: styles18.sheetPositioner, children: /* @__PURE__ */ jsxs18(View18, { style: [styles18.sheet, { backgroundColor: t.background }], children: [
|
|
6609
|
+
/* @__PURE__ */ jsx21(View18, { style: styles18.handleRow, children: /* @__PURE__ */ jsx21(View18, { style: [styles18.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6610
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.header, children: [
|
|
6611
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.headerTitle, { color: t.text }], children: headerTitle }),
|
|
6612
|
+
/* @__PURE__ */ jsx21(TouchableOpacity14, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx21(Text19, { style: [styles18.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6607
6613
|
] }),
|
|
6608
|
-
/* @__PURE__ */
|
|
6609
|
-
/* @__PURE__ */
|
|
6610
|
-
/* @__PURE__ */
|
|
6611
|
-
/* @__PURE__ */
|
|
6612
|
-
/* @__PURE__ */
|
|
6614
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.poolName, { color: t.textSecondary }], children: pool.name }),
|
|
6615
|
+
/* @__PURE__ */ jsxs18(View18, { style: [styles18.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6616
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.summaryRow, children: [
|
|
6617
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
6618
|
+
/* @__PURE__ */ jsxs18(Text19, { style: [styles18.summaryValue, { color: t.text }], children: [
|
|
6613
6619
|
buyInSol,
|
|
6614
6620
|
" SOL"
|
|
6615
6621
|
] })
|
|
6616
6622
|
] }),
|
|
6617
|
-
/* @__PURE__ */
|
|
6618
|
-
/* @__PURE__ */
|
|
6619
|
-
/* @__PURE__ */
|
|
6620
|
-
/* @__PURE__ */
|
|
6623
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.summarySep, { backgroundColor: t.border }] }),
|
|
6624
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.summaryRow, children: [
|
|
6625
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
6626
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryValue, { color: t.text }], children: totalPlayers })
|
|
6621
6627
|
] }),
|
|
6622
|
-
/* @__PURE__ */
|
|
6623
|
-
/* @__PURE__ */
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
/* @__PURE__ */
|
|
6628
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.summarySep, { backgroundColor: t.border }] }),
|
|
6629
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.summaryRow, children: [
|
|
6630
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
6631
|
+
/* @__PURE__ */ jsxs18(Text19, { style: [styles18.summaryValue, { color: t.success }], children: [
|
|
6626
6632
|
potSol,
|
|
6627
6633
|
" SOL"
|
|
6628
6634
|
] })
|
|
6629
6635
|
] }),
|
|
6630
|
-
/* @__PURE__ */
|
|
6631
|
-
/* @__PURE__ */
|
|
6632
|
-
/* @__PURE__ */
|
|
6633
|
-
/* @__PURE__ */
|
|
6636
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.summarySep, { backgroundColor: t.border }] }),
|
|
6637
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.summaryRow, children: [
|
|
6638
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryLabel, { color: t.textMuted }], children: "Lives" }),
|
|
6639
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryValue, { color: t.text }], children: pool.max_lives })
|
|
6634
6640
|
] }),
|
|
6635
|
-
topScore > 0 && /* @__PURE__ */
|
|
6636
|
-
/* @__PURE__ */
|
|
6637
|
-
/* @__PURE__ */
|
|
6638
|
-
/* @__PURE__ */
|
|
6639
|
-
/* @__PURE__ */
|
|
6641
|
+
topScore > 0 && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
6642
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.summarySep, { backgroundColor: t.border }] }),
|
|
6643
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.summaryRow, children: [
|
|
6644
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryLabel, { color: t.textMuted }], children: "Top score" }),
|
|
6645
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.summaryValue, { color: t.text }], children: topScore })
|
|
6640
6646
|
] })
|
|
6641
6647
|
] })
|
|
6642
6648
|
] }),
|
|
6643
|
-
mutation.error && /* @__PURE__ */
|
|
6644
|
-
/* @__PURE__ */
|
|
6645
|
-
|
|
6649
|
+
mutation.error && /* @__PURE__ */ jsx21(View18, { style: [styles18.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx21(Text19, { style: [styles18.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
6650
|
+
/* @__PURE__ */ jsx21(
|
|
6651
|
+
TouchableOpacity14,
|
|
6646
6652
|
{
|
|
6647
6653
|
style: [
|
|
6648
|
-
|
|
6654
|
+
styles18.ctaButton,
|
|
6649
6655
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
6650
6656
|
],
|
|
6651
6657
|
disabled: !canJoin,
|
|
6652
6658
|
onPress: handleJoin,
|
|
6653
6659
|
activeOpacity: 0.8,
|
|
6654
|
-
children: isMutating ? /* @__PURE__ */
|
|
6655
|
-
/* @__PURE__ */
|
|
6656
|
-
/* @__PURE__ */
|
|
6657
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
6660
|
+
children: isMutating ? /* @__PURE__ */ jsxs18(View18, { style: styles18.ctaLoading, children: [
|
|
6661
|
+
/* @__PURE__ */ jsx21(ActivityIndicator10, { size: "small", color: "#FFFFFF" }),
|
|
6662
|
+
/* @__PURE__ */ jsx21(Text19, { style: styles18.ctaText, children: statusLabel })
|
|
6663
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx21(Text19, { style: styles18.ctaText, children: successLabel }) : /* @__PURE__ */ jsx21(Text19, { style: [styles18.ctaText, !canJoin && { opacity: 0.5 }], children: ctaLabel })
|
|
6658
6664
|
}
|
|
6659
6665
|
)
|
|
6660
6666
|
] }) })
|
|
@@ -6664,9 +6670,9 @@ function EnterArcadePoolSheet({
|
|
|
6664
6670
|
}
|
|
6665
6671
|
);
|
|
6666
6672
|
}
|
|
6667
|
-
var
|
|
6673
|
+
var styles18 = StyleSheet19.create({
|
|
6668
6674
|
overlay: {
|
|
6669
|
-
...
|
|
6675
|
+
...StyleSheet19.absoluteFillObject,
|
|
6670
6676
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6671
6677
|
},
|
|
6672
6678
|
overlayTap: { flex: 1 },
|
|
@@ -6726,23 +6732,23 @@ var styles17 = StyleSheet18.create({
|
|
|
6726
6732
|
// src/ui/game/ArcadeLeaderboardSheet.tsx
|
|
6727
6733
|
import { useEffect as useEffect20, useRef as useRef13 } from "react";
|
|
6728
6734
|
import {
|
|
6729
|
-
View as
|
|
6730
|
-
Text as
|
|
6731
|
-
TouchableOpacity as
|
|
6735
|
+
View as View19,
|
|
6736
|
+
Text as Text20,
|
|
6737
|
+
TouchableOpacity as TouchableOpacity15,
|
|
6732
6738
|
Modal as Modal6,
|
|
6733
6739
|
Animated as Animated7,
|
|
6734
|
-
StyleSheet as
|
|
6740
|
+
StyleSheet as StyleSheet20,
|
|
6735
6741
|
KeyboardAvoidingView as KeyboardAvoidingView7,
|
|
6736
6742
|
Platform as Platform11,
|
|
6737
6743
|
Image as Image7,
|
|
6738
6744
|
FlatList
|
|
6739
6745
|
} from "react-native";
|
|
6740
|
-
import { jsx as
|
|
6746
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6741
6747
|
function RankLabel({ index }) {
|
|
6742
|
-
if (index === 0) return /* @__PURE__ */
|
|
6743
|
-
if (index === 1) return /* @__PURE__ */
|
|
6744
|
-
if (index === 2) return /* @__PURE__ */
|
|
6745
|
-
return /* @__PURE__ */
|
|
6748
|
+
if (index === 0) return /* @__PURE__ */ jsx22(Text20, { style: styles19.rankEmoji, children: "\u{1F947}" });
|
|
6749
|
+
if (index === 1) return /* @__PURE__ */ jsx22(Text20, { style: styles19.rankEmoji, children: "\u{1F948}" });
|
|
6750
|
+
if (index === 2) return /* @__PURE__ */ jsx22(Text20, { style: styles19.rankEmoji, children: "\u{1F949}" });
|
|
6751
|
+
return /* @__PURE__ */ jsx22(Text20, { style: styles19.rankNum, children: index + 1 });
|
|
6746
6752
|
}
|
|
6747
6753
|
function ArcadeLeaderboardSheet({
|
|
6748
6754
|
visible,
|
|
@@ -6765,32 +6771,32 @@ function ArcadeLeaderboardSheet({
|
|
|
6765
6771
|
}, [visible]);
|
|
6766
6772
|
const renderItem = ({ item, index }) => {
|
|
6767
6773
|
const isMe = highlightWallet && item.wallet_address === highlightWallet;
|
|
6768
|
-
return /* @__PURE__ */
|
|
6769
|
-
|
|
6774
|
+
return /* @__PURE__ */ jsxs19(
|
|
6775
|
+
View19,
|
|
6770
6776
|
{
|
|
6771
6777
|
style: [
|
|
6772
|
-
|
|
6778
|
+
styles19.row,
|
|
6773
6779
|
{ backgroundColor: isMe ? `${t.accent}18` : index % 2 === 0 ? t.surface : "transparent" },
|
|
6774
6780
|
isMe ? { borderWidth: 1, borderColor: t.accent } : void 0
|
|
6775
6781
|
],
|
|
6776
6782
|
children: [
|
|
6777
|
-
/* @__PURE__ */
|
|
6778
|
-
item.avatar ? /* @__PURE__ */
|
|
6779
|
-
/* @__PURE__ */
|
|
6780
|
-
/* @__PURE__ */
|
|
6781
|
-
/* @__PURE__ */
|
|
6783
|
+
/* @__PURE__ */ jsx22(View19, { style: styles19.rankCol, children: /* @__PURE__ */ jsx22(RankLabel, { index }) }),
|
|
6784
|
+
item.avatar ? /* @__PURE__ */ jsx22(Image7, { source: { uri: ensurePngAvatar(item.avatar) }, style: styles19.avatar }) : /* @__PURE__ */ jsx22(View19, { style: [styles19.avatar, { backgroundColor: t.border }] }),
|
|
6785
|
+
/* @__PURE__ */ jsxs19(View19, { style: styles19.nameCol, children: [
|
|
6786
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.name, { color: t.text }], numberOfLines: 1, children: item.username || `${item.wallet_address.slice(0, 4)}...${item.wallet_address.slice(-4)}` }),
|
|
6787
|
+
/* @__PURE__ */ jsxs19(Text20, { style: [styles19.lives, { color: t.textMuted }], children: [
|
|
6782
6788
|
item.lives_used,
|
|
6783
6789
|
" ",
|
|
6784
6790
|
item.lives_used === 1 ? "life" : "lives",
|
|
6785
6791
|
" used"
|
|
6786
6792
|
] })
|
|
6787
6793
|
] }),
|
|
6788
|
-
/* @__PURE__ */
|
|
6794
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.score, { color: t.accent }], children: item.best_score })
|
|
6789
6795
|
]
|
|
6790
6796
|
}
|
|
6791
6797
|
);
|
|
6792
6798
|
};
|
|
6793
|
-
return /* @__PURE__ */
|
|
6799
|
+
return /* @__PURE__ */ jsxs19(
|
|
6794
6800
|
Modal6,
|
|
6795
6801
|
{
|
|
6796
6802
|
visible,
|
|
@@ -6798,46 +6804,46 @@ function ArcadeLeaderboardSheet({
|
|
|
6798
6804
|
transparent: true,
|
|
6799
6805
|
onRequestClose: onDismiss,
|
|
6800
6806
|
children: [
|
|
6801
|
-
/* @__PURE__ */
|
|
6802
|
-
/* @__PURE__ */
|
|
6807
|
+
/* @__PURE__ */ jsx22(Animated7.View, { style: [styles19.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx22(TouchableOpacity15, { style: styles19.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6808
|
+
/* @__PURE__ */ jsx22(
|
|
6803
6809
|
KeyboardAvoidingView7,
|
|
6804
6810
|
{
|
|
6805
|
-
style:
|
|
6811
|
+
style: styles19.keyboardView,
|
|
6806
6812
|
behavior: Platform11.OS === "ios" ? "padding" : void 0,
|
|
6807
|
-
children: /* @__PURE__ */
|
|
6808
|
-
/* @__PURE__ */
|
|
6809
|
-
/* @__PURE__ */
|
|
6810
|
-
/* @__PURE__ */
|
|
6811
|
-
/* @__PURE__ */
|
|
6812
|
-
pool && /* @__PURE__ */
|
|
6813
|
+
children: /* @__PURE__ */ jsx22(View19, { style: styles19.sheetPositioner, children: /* @__PURE__ */ jsxs19(View19, { style: [styles19.sheet, { backgroundColor: t.background }], children: [
|
|
6814
|
+
/* @__PURE__ */ jsx22(View19, { style: styles19.handleRow, children: /* @__PURE__ */ jsx22(View19, { style: [styles19.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6815
|
+
/* @__PURE__ */ jsxs19(View19, { style: styles19.header, children: [
|
|
6816
|
+
/* @__PURE__ */ jsxs19(View19, { children: [
|
|
6817
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.headerTitle, { color: t.text }], children: "Leaderboard" }),
|
|
6818
|
+
pool && /* @__PURE__ */ jsx22(Text20, { style: [styles19.poolName, { color: t.textMuted }], children: pool.name })
|
|
6813
6819
|
] }),
|
|
6814
|
-
/* @__PURE__ */
|
|
6820
|
+
/* @__PURE__ */ jsx22(TouchableOpacity15, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx22(Text20, { style: [styles19.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6815
6821
|
] }),
|
|
6816
|
-
stats && /* @__PURE__ */
|
|
6817
|
-
/* @__PURE__ */
|
|
6818
|
-
/* @__PURE__ */
|
|
6819
|
-
/* @__PURE__ */
|
|
6822
|
+
stats && /* @__PURE__ */ jsxs19(View19, { style: [styles19.statsBar, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6823
|
+
/* @__PURE__ */ jsxs19(View19, { style: styles19.statItem, children: [
|
|
6824
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statValue, { color: t.text }], children: stats.total_entries }),
|
|
6825
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statLabel, { color: t.textMuted }], children: "Players" })
|
|
6820
6826
|
] }),
|
|
6821
|
-
/* @__PURE__ */
|
|
6822
|
-
/* @__PURE__ */
|
|
6823
|
-
/* @__PURE__ */
|
|
6824
|
-
/* @__PURE__ */
|
|
6827
|
+
/* @__PURE__ */ jsx22(View19, { style: [styles19.statDivider, { backgroundColor: t.border }] }),
|
|
6828
|
+
/* @__PURE__ */ jsxs19(View19, { style: styles19.statItem, children: [
|
|
6829
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statValue, { color: t.accent }], children: stats.top_score }),
|
|
6830
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statLabel, { color: t.textMuted }], children: "Top Score" })
|
|
6825
6831
|
] }),
|
|
6826
|
-
/* @__PURE__ */
|
|
6827
|
-
/* @__PURE__ */
|
|
6828
|
-
/* @__PURE__ */
|
|
6829
|
-
/* @__PURE__ */
|
|
6832
|
+
/* @__PURE__ */ jsx22(View19, { style: [styles19.statDivider, { backgroundColor: t.border }] }),
|
|
6833
|
+
/* @__PURE__ */ jsxs19(View19, { style: styles19.statItem, children: [
|
|
6834
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statValue, { color: t.text }], children: Math.round(stats.avg_score) }),
|
|
6835
|
+
/* @__PURE__ */ jsx22(Text20, { style: [styles19.statLabel, { color: t.textMuted }], children: "Avg Score" })
|
|
6830
6836
|
] })
|
|
6831
6837
|
] }),
|
|
6832
|
-
/* @__PURE__ */
|
|
6838
|
+
/* @__PURE__ */ jsx22(
|
|
6833
6839
|
FlatList,
|
|
6834
6840
|
{
|
|
6835
6841
|
data: leaderboard,
|
|
6836
6842
|
renderItem,
|
|
6837
6843
|
keyExtractor: (item) => String(item.id),
|
|
6838
|
-
style:
|
|
6839
|
-
contentContainerStyle:
|
|
6840
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
6844
|
+
style: styles19.list,
|
|
6845
|
+
contentContainerStyle: styles19.listContent,
|
|
6846
|
+
ListEmptyComponent: /* @__PURE__ */ jsx22(View19, { style: styles19.emptyState, children: /* @__PURE__ */ jsx22(Text20, { style: [styles19.emptyText, { color: t.textMuted }], children: loading ? "Loading..." : "No scores yet" }) })
|
|
6841
6847
|
}
|
|
6842
6848
|
)
|
|
6843
6849
|
] }) })
|
|
@@ -6847,9 +6853,9 @@ function ArcadeLeaderboardSheet({
|
|
|
6847
6853
|
}
|
|
6848
6854
|
);
|
|
6849
6855
|
}
|
|
6850
|
-
var
|
|
6856
|
+
var styles19 = StyleSheet20.create({
|
|
6851
6857
|
overlay: {
|
|
6852
|
-
...
|
|
6858
|
+
...StyleSheet20.absoluteFillObject,
|
|
6853
6859
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6854
6860
|
},
|
|
6855
6861
|
overlayTap: { flex: 1 },
|
|
@@ -6907,20 +6913,19 @@ var styles18 = StyleSheet19.create({
|
|
|
6907
6913
|
});
|
|
6908
6914
|
|
|
6909
6915
|
// src/ui/game/CreateGameSheet.tsx
|
|
6910
|
-
import { useState as
|
|
6916
|
+
import { useState as useState33, useEffect as useEffect21, useRef as useRef14, useCallback as useCallback28 } from "react";
|
|
6911
6917
|
import {
|
|
6912
|
-
View as
|
|
6913
|
-
Text as
|
|
6914
|
-
|
|
6915
|
-
TouchableOpacity as TouchableOpacity15,
|
|
6918
|
+
View as View20,
|
|
6919
|
+
Text as Text21,
|
|
6920
|
+
TouchableOpacity as TouchableOpacity16,
|
|
6916
6921
|
ActivityIndicator as ActivityIndicator11,
|
|
6917
6922
|
Modal as Modal7,
|
|
6918
6923
|
Animated as Animated8,
|
|
6919
|
-
StyleSheet as
|
|
6924
|
+
StyleSheet as StyleSheet21,
|
|
6920
6925
|
KeyboardAvoidingView as KeyboardAvoidingView8,
|
|
6921
6926
|
Platform as Platform12
|
|
6922
6927
|
} from "react-native";
|
|
6923
|
-
import { jsx as
|
|
6928
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6924
6929
|
var STATUS_LABELS6 = {
|
|
6925
6930
|
building: "Building transaction...",
|
|
6926
6931
|
signing: "Approve in wallet...",
|
|
@@ -6947,9 +6952,9 @@ function CreateGameSheet({
|
|
|
6947
6952
|
const t = useDubsTheme();
|
|
6948
6953
|
const { wallet } = useDubs();
|
|
6949
6954
|
const mutation = useCreateGame();
|
|
6950
|
-
const [selectedTeam, setSelectedTeam] =
|
|
6951
|
-
const [wager, setWager] =
|
|
6952
|
-
const [showSuccess, setShowSuccess] =
|
|
6955
|
+
const [selectedTeam, setSelectedTeam] = useState33(null);
|
|
6956
|
+
const [wager, setWager] = useState33(0.01);
|
|
6957
|
+
const [showSuccess, setShowSuccess] = useState33(false);
|
|
6953
6958
|
const overlayOpacity = useRef14(new Animated8.Value(0)).current;
|
|
6954
6959
|
const successScale = useRef14(new Animated8.Value(0)).current;
|
|
6955
6960
|
const successOpacity = useRef14(new Animated8.Value(0)).current;
|
|
@@ -7012,87 +7017,78 @@ function CreateGameSheet({
|
|
|
7012
7017
|
const statusLabel = STATUS_LABELS6[mutation.status] || "";
|
|
7013
7018
|
const startTime = event.startTime ? new Date(event.startTime) : null;
|
|
7014
7019
|
const timeLabel = startTime ? startTime.toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric" }) + " at " + startTime.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" }) : "TBD";
|
|
7015
|
-
return /* @__PURE__ */
|
|
7016
|
-
/* @__PURE__ */
|
|
7017
|
-
showSuccess && /* @__PURE__ */
|
|
7018
|
-
/* @__PURE__ */
|
|
7019
|
-
/* @__PURE__ */
|
|
7020
|
-
/* @__PURE__ */
|
|
7020
|
+
return /* @__PURE__ */ jsxs20(Modal7, { visible, animationType: "slide", transparent: true, onRequestClose: onDismiss, children: [
|
|
7021
|
+
/* @__PURE__ */ jsx23(Animated8.View, { style: [styles20.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx23(TouchableOpacity16, { style: styles20.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
7022
|
+
showSuccess && /* @__PURE__ */ jsx23(View20, { style: styles20.successOverlay, children: /* @__PURE__ */ jsxs20(Animated8.View, { style: [styles20.successContent, { opacity: successOpacity, transform: [{ scale: successScale }] }], children: [
|
|
7023
|
+
/* @__PURE__ */ jsx23(Text21, { style: styles20.successEmoji, children: "\u{1F3AF}" }),
|
|
7024
|
+
/* @__PURE__ */ jsx23(Text21, { style: styles20.successTitle, children: "Game Created!" }),
|
|
7025
|
+
/* @__PURE__ */ jsxs20(Text21, { style: styles20.successSub, children: [
|
|
7021
7026
|
formatSol2(wager),
|
|
7022
7027
|
" SOL on ",
|
|
7023
7028
|
selectedTeam === "home" ? homeName : awayName
|
|
7024
7029
|
] })
|
|
7025
7030
|
] }) }),
|
|
7026
|
-
/* @__PURE__ */
|
|
7027
|
-
/* @__PURE__ */
|
|
7028
|
-
/* @__PURE__ */
|
|
7029
|
-
/* @__PURE__ */
|
|
7030
|
-
/* @__PURE__ */
|
|
7031
|
-
/* @__PURE__ */
|
|
7032
|
-
] }),
|
|
7033
|
-
/* @__PURE__ */ jsx22(TouchableOpacity15, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx22(Text20, { style: [styles19.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
7034
|
-
] }),
|
|
7035
|
-
/* @__PURE__ */ jsxs19(View19, { style: [styles19.matchupBanner, { borderColor: t.border }], children: [
|
|
7036
|
-
/* @__PURE__ */ jsxs19(View19, { style: styles19.matchupTeam, children: [
|
|
7037
|
-
opponents[0]?.imageUrl ? /* @__PURE__ */ jsx22(Image8, { source: { uri: opponents[0].imageUrl }, style: styles19.matchupLogo, resizeMode: "contain" }) : /* @__PURE__ */ jsx22(View19, { style: [styles19.matchupPlaceholder, { backgroundColor: homeColor + "20" }], children: /* @__PURE__ */ jsx22(Text20, { style: [styles19.matchupInitial, { color: homeColor }], children: homeName.charAt(0) }) }),
|
|
7038
|
-
/* @__PURE__ */ jsx22(Text20, { style: [styles19.matchupName, { color: t.text }], numberOfLines: 1, children: homeName })
|
|
7031
|
+
/* @__PURE__ */ jsx23(KeyboardAvoidingView8, { style: styles20.keyboardView, behavior: Platform12.OS === "ios" ? "padding" : void 0, children: /* @__PURE__ */ jsx23(View20, { style: styles20.sheetPositioner, children: /* @__PURE__ */ jsxs20(View20, { style: [styles20.sheet, { backgroundColor: t.background }], children: [
|
|
7032
|
+
/* @__PURE__ */ jsx23(View20, { style: styles20.handleRow, children: /* @__PURE__ */ jsx23(View20, { style: [styles20.handle, { backgroundColor: t.textMuted }] }) }),
|
|
7033
|
+
/* @__PURE__ */ jsxs20(View20, { style: styles20.header, children: [
|
|
7034
|
+
/* @__PURE__ */ jsxs20(View20, { children: [
|
|
7035
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.headerTitle, { color: t.text }], children: "Create Game" }),
|
|
7036
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.headerSub, { color: t.textMuted }], children: timeLabel })
|
|
7039
7037
|
] }),
|
|
7040
|
-
/* @__PURE__ */
|
|
7041
|
-
/* @__PURE__ */ jsxs19(View19, { style: styles19.matchupTeam, children: [
|
|
7042
|
-
opponents[1]?.imageUrl ? /* @__PURE__ */ jsx22(Image8, { source: { uri: opponents[1].imageUrl }, style: styles19.matchupLogo, resizeMode: "contain" }) : /* @__PURE__ */ jsx22(View19, { style: [styles19.matchupPlaceholder, { backgroundColor: awayColor + "20" }], children: /* @__PURE__ */ jsx22(Text20, { style: [styles19.matchupInitial, { color: awayColor }], children: awayName.charAt(0) }) }),
|
|
7043
|
-
/* @__PURE__ */ jsx22(Text20, { style: [styles19.matchupName, { color: t.text }], numberOfLines: 1, children: awayName })
|
|
7044
|
-
] })
|
|
7038
|
+
/* @__PURE__ */ jsx23(TouchableOpacity16, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx23(Text21, { style: [styles20.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
7045
7039
|
] }),
|
|
7046
|
-
/* @__PURE__ */
|
|
7047
|
-
/* @__PURE__ */
|
|
7048
|
-
/* @__PURE__ */
|
|
7049
|
-
/* @__PURE__ */
|
|
7050
|
-
|
|
7040
|
+
/* @__PURE__ */ jsxs20(View20, { style: styles20.section, children: [
|
|
7041
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
7042
|
+
/* @__PURE__ */ jsxs20(View20, { style: styles20.teamsRow, children: [
|
|
7043
|
+
/* @__PURE__ */ jsx23(
|
|
7044
|
+
TeamButton,
|
|
7051
7045
|
{
|
|
7052
|
-
|
|
7046
|
+
name: homeName,
|
|
7047
|
+
imageUrl: opponents[0]?.imageUrl,
|
|
7048
|
+
odds: "\u2014",
|
|
7049
|
+
bets: 0,
|
|
7050
|
+
color: homeColor,
|
|
7051
|
+
selected: selectedTeam === "home",
|
|
7053
7052
|
onPress: () => {
|
|
7054
7053
|
setSelectedTeam("home");
|
|
7055
7054
|
onTeamSelect?.("home");
|
|
7056
7055
|
},
|
|
7057
|
-
|
|
7058
|
-
children: [
|
|
7059
|
-
/* @__PURE__ */ jsx22(Text20, { style: [styles19.teamLabel, { color: t.text }], children: homeName }),
|
|
7060
|
-
selectedTeam === "home" && /* @__PURE__ */ jsx22(View19, { style: [styles19.teamBadge, { backgroundColor: homeColor }], children: /* @__PURE__ */ jsx22(Text20, { style: styles19.teamBadgeText, children: "Selected" }) })
|
|
7061
|
-
]
|
|
7056
|
+
t
|
|
7062
7057
|
}
|
|
7063
7058
|
),
|
|
7064
|
-
/* @__PURE__ */
|
|
7065
|
-
|
|
7059
|
+
/* @__PURE__ */ jsx23(
|
|
7060
|
+
TeamButton,
|
|
7066
7061
|
{
|
|
7067
|
-
|
|
7062
|
+
name: awayName,
|
|
7063
|
+
imageUrl: opponents[1]?.imageUrl,
|
|
7064
|
+
odds: "\u2014",
|
|
7065
|
+
bets: 0,
|
|
7066
|
+
color: awayColor,
|
|
7067
|
+
selected: selectedTeam === "away",
|
|
7068
7068
|
onPress: () => {
|
|
7069
7069
|
setSelectedTeam("away");
|
|
7070
7070
|
onTeamSelect?.("away");
|
|
7071
7071
|
},
|
|
7072
|
-
|
|
7073
|
-
children: [
|
|
7074
|
-
/* @__PURE__ */ jsx22(Text20, { style: [styles19.teamLabel, { color: t.text }], children: awayName }),
|
|
7075
|
-
selectedTeam === "away" && /* @__PURE__ */ jsx22(View19, { style: [styles19.teamBadge, { backgroundColor: awayColor }], children: /* @__PURE__ */ jsx22(Text20, { style: styles19.teamBadgeText, children: "Selected" }) })
|
|
7076
|
-
]
|
|
7072
|
+
t
|
|
7077
7073
|
}
|
|
7078
7074
|
)
|
|
7079
7075
|
] })
|
|
7080
7076
|
] }),
|
|
7081
|
-
/* @__PURE__ */
|
|
7082
|
-
/* @__PURE__ */
|
|
7083
|
-
/* @__PURE__ */
|
|
7084
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsxs20(View20, { style: [styles20.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
7078
|
+
/* @__PURE__ */ jsxs20(View20, { style: styles20.summaryRow, children: [
|
|
7079
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
7080
|
+
/* @__PURE__ */ jsxs20(Text21, { style: [styles20.summaryValue, { color: t.text }], children: [
|
|
7085
7081
|
formatSol2(wager),
|
|
7086
7082
|
" SOL"
|
|
7087
7083
|
] })
|
|
7088
7084
|
] }),
|
|
7089
|
-
/* @__PURE__ */
|
|
7090
|
-
/* @__PURE__ */
|
|
7091
|
-
/* @__PURE__ */
|
|
7092
|
-
/* @__PURE__ */
|
|
7085
|
+
/* @__PURE__ */ jsx23(View20, { style: [styles20.summarySep, { backgroundColor: t.border }] }),
|
|
7086
|
+
/* @__PURE__ */ jsxs20(View20, { style: styles20.summaryRow, children: [
|
|
7087
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.summaryLabel, { color: t.textMuted }], children: "You're the first" }),
|
|
7088
|
+
/* @__PURE__ */ jsx23(Text21, { style: [styles20.summaryValue, { color: t.success }], children: "Set the odds" })
|
|
7093
7089
|
] })
|
|
7094
7090
|
] }),
|
|
7095
|
-
selectedTeam && /* @__PURE__ */
|
|
7091
|
+
selectedTeam && /* @__PURE__ */ jsx23(
|
|
7096
7092
|
SolSlider,
|
|
7097
7093
|
{
|
|
7098
7094
|
value: wager,
|
|
@@ -7104,25 +7100,25 @@ function CreateGameSheet({
|
|
|
7104
7100
|
onTick: onSliderTick
|
|
7105
7101
|
}
|
|
7106
7102
|
),
|
|
7107
|
-
mutation.error && /* @__PURE__ */
|
|
7108
|
-
/* @__PURE__ */
|
|
7109
|
-
|
|
7103
|
+
mutation.error && /* @__PURE__ */ jsx23(View20, { style: [styles20.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx23(Text21, { style: [styles20.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
7104
|
+
/* @__PURE__ */ jsx23(
|
|
7105
|
+
TouchableOpacity16,
|
|
7110
7106
|
{
|
|
7111
|
-
style: [
|
|
7107
|
+
style: [styles20.ctaButton, { backgroundColor: canCreate ? t.accent : t.border }],
|
|
7112
7108
|
disabled: !canCreate,
|
|
7113
7109
|
onPress: handleCreate,
|
|
7114
7110
|
activeOpacity: 0.8,
|
|
7115
|
-
children: isMutating ? /* @__PURE__ */
|
|
7116
|
-
/* @__PURE__ */
|
|
7117
|
-
/* @__PURE__ */
|
|
7118
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
7111
|
+
children: isMutating ? /* @__PURE__ */ jsxs20(View20, { style: styles20.ctaLoading, children: [
|
|
7112
|
+
/* @__PURE__ */ jsx23(ActivityIndicator11, { size: "small", color: "#FFFFFF" }),
|
|
7113
|
+
/* @__PURE__ */ jsx23(Text21, { style: styles20.ctaText, children: statusLabel })
|
|
7114
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx23(Text21, { style: styles20.ctaText, children: "Game Created!" }) : /* @__PURE__ */ jsx23(Text21, { style: [styles20.ctaText, !canCreate && { opacity: 0.5 }], children: selectedTeam ? `Create Game \u2014 ${formatSol2(wager)} SOL` : "Pick a side to start" })
|
|
7119
7115
|
}
|
|
7120
7116
|
)
|
|
7121
7117
|
] }) }) })
|
|
7122
7118
|
] });
|
|
7123
7119
|
}
|
|
7124
|
-
var
|
|
7125
|
-
overlay: { ...
|
|
7120
|
+
var styles20 = StyleSheet21.create({
|
|
7121
|
+
overlay: { ...StyleSheet21.absoluteFillObject, backgroundColor: "rgba(0,0,0,0.5)" },
|
|
7126
7122
|
overlayTap: { flex: 1 },
|
|
7127
7123
|
keyboardView: { flex: 1, justifyContent: "flex-end" },
|
|
7128
7124
|
sheetPositioner: { justifyContent: "flex-end" },
|
|
@@ -7133,20 +7129,9 @@ var styles19 = StyleSheet20.create({
|
|
|
7133
7129
|
headerTitle: { fontSize: 20, fontWeight: "700" },
|
|
7134
7130
|
headerSub: { fontSize: 13, marginTop: 2 },
|
|
7135
7131
|
closeButton: { fontSize: 20, padding: 4 },
|
|
7136
|
-
matchupBanner: { flexDirection: "row", alignItems: "center", justifyContent: "center", paddingVertical: 16, borderBottomWidth: 1, gap: 16 },
|
|
7137
|
-
matchupTeam: { flex: 1, alignItems: "center", gap: 6 },
|
|
7138
|
-
matchupLogo: { width: 40, height: 40 },
|
|
7139
|
-
matchupPlaceholder: { width: 40, height: 40, borderRadius: 20, alignItems: "center", justifyContent: "center" },
|
|
7140
|
-
matchupInitial: { fontSize: 18, fontWeight: "800" },
|
|
7141
|
-
matchupName: { fontSize: 13, fontWeight: "600", textAlign: "center" },
|
|
7142
|
-
matchupVs: { fontSize: 13, fontWeight: "600" },
|
|
7143
7132
|
section: { gap: 10, paddingTop: 12 },
|
|
7144
7133
|
sectionLabel: { fontSize: 14, fontWeight: "600" },
|
|
7145
|
-
teamsRow: { flexDirection: "row", gap:
|
|
7146
|
-
teamOption: { flex: 1, borderWidth: 2, borderRadius: 14, paddingVertical: 14, alignItems: "center", gap: 6 },
|
|
7147
|
-
teamLabel: { fontSize: 15, fontWeight: "700" },
|
|
7148
|
-
teamBadge: { borderRadius: 8, paddingHorizontal: 10, paddingVertical: 3 },
|
|
7149
|
-
teamBadgeText: { color: "#FFF", fontSize: 11, fontWeight: "700" },
|
|
7134
|
+
teamsRow: { flexDirection: "row", gap: 12 },
|
|
7150
7135
|
summaryCard: { marginTop: 12, borderRadius: 14, borderWidth: 1, overflow: "hidden" },
|
|
7151
7136
|
summaryRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", paddingHorizontal: 16, paddingVertical: 12 },
|
|
7152
7137
|
summaryLabel: { fontSize: 14 },
|
|
@@ -7157,7 +7142,7 @@ var styles19 = StyleSheet20.create({
|
|
|
7157
7142
|
ctaButton: { marginTop: 16, height: 54, borderRadius: 14, justifyContent: "center", alignItems: "center" },
|
|
7158
7143
|
ctaText: { color: "#FFFFFF", fontSize: 16, fontWeight: "700" },
|
|
7159
7144
|
ctaLoading: { flexDirection: "row", alignItems: "center", gap: 10 },
|
|
7160
|
-
successOverlay: { ...
|
|
7145
|
+
successOverlay: { ...StyleSheet21.absoluteFillObject, zIndex: 100, alignItems: "center", justifyContent: "center", backgroundColor: "rgba(0,0,0,0.85)" },
|
|
7161
7146
|
successContent: { alignItems: "center", gap: 12 },
|
|
7162
7147
|
successEmoji: { fontSize: 64 },
|
|
7163
7148
|
successTitle: { color: "#FFFFFF", fontSize: 28, fontWeight: "900" },
|