@dubsdotapp/expo 0.5.7 → 0.5.9
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 +486 -280
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +457 -246
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/ui/game/JoinGameSheet.tsx +40 -20
- package/src/ui/game/SolSlider.tsx +233 -0
- package/src/ui/game/index.ts +2 -0
- package/src/ui/index.ts +2 -1
- package/dist/index.d.mts +0 -1451
- package/dist/index.d.ts +0 -1451
package/dist/index.mjs
CHANGED
|
@@ -5320,20 +5320,217 @@ var styles12 = StyleSheet13.create({
|
|
|
5320
5320
|
});
|
|
5321
5321
|
|
|
5322
5322
|
// src/ui/game/JoinGameSheet.tsx
|
|
5323
|
-
import { useState as useState28, useEffect as useEffect17, useRef as
|
|
5323
|
+
import { useState as useState28, 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 View15,
|
|
5326
|
+
Text as Text15,
|
|
5327
5327
|
Image as Image6,
|
|
5328
5328
|
TouchableOpacity as TouchableOpacity10,
|
|
5329
5329
|
ActivityIndicator as ActivityIndicator8,
|
|
5330
5330
|
Modal as Modal3,
|
|
5331
5331
|
Animated as Animated4,
|
|
5332
|
-
StyleSheet as
|
|
5332
|
+
StyleSheet as StyleSheet15,
|
|
5333
5333
|
KeyboardAvoidingView as KeyboardAvoidingView4,
|
|
5334
|
+
Platform as Platform8
|
|
5335
|
+
} from "react-native";
|
|
5336
|
+
|
|
5337
|
+
// src/ui/game/SolSlider.tsx
|
|
5338
|
+
import { useRef as useRef9 } from "react";
|
|
5339
|
+
import {
|
|
5340
|
+
View as View14,
|
|
5341
|
+
Text as Text14,
|
|
5342
|
+
StyleSheet as StyleSheet14,
|
|
5343
|
+
PanResponder,
|
|
5334
5344
|
Platform as Platform7
|
|
5335
5345
|
} from "react-native";
|
|
5336
|
-
import {
|
|
5346
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5347
|
+
var THUMB_SIZE = 32;
|
|
5348
|
+
var TRACK_HEIGHT = 6;
|
|
5349
|
+
var TICK_INTERVAL = 0.01;
|
|
5350
|
+
function SolSlider({
|
|
5351
|
+
value,
|
|
5352
|
+
min = 0.01,
|
|
5353
|
+
max = 5,
|
|
5354
|
+
step = 0.01,
|
|
5355
|
+
accentColor,
|
|
5356
|
+
onValueChange,
|
|
5357
|
+
onSlidingComplete,
|
|
5358
|
+
onTick,
|
|
5359
|
+
disabled = false
|
|
5360
|
+
}) {
|
|
5361
|
+
const t = useDubsTheme();
|
|
5362
|
+
const accent = accentColor || t.accent;
|
|
5363
|
+
const trackRef = useRef9(null);
|
|
5364
|
+
const trackWidth = useRef9(0);
|
|
5365
|
+
const lastTickValue = useRef9(value);
|
|
5366
|
+
const clamp = (v) => {
|
|
5367
|
+
const stepped = Math.round(v / step) * step;
|
|
5368
|
+
return Math.max(min, Math.min(max, parseFloat(stepped.toFixed(4))));
|
|
5369
|
+
};
|
|
5370
|
+
const valueToPosition = (v) => {
|
|
5371
|
+
const ratio2 = (v - min) / (max - min);
|
|
5372
|
+
return ratio2 * trackWidth.current;
|
|
5373
|
+
};
|
|
5374
|
+
const positionToValue = (x) => {
|
|
5375
|
+
const ratio2 = Math.max(0, Math.min(1, x / trackWidth.current));
|
|
5376
|
+
return clamp(min + ratio2 * (max - min));
|
|
5377
|
+
};
|
|
5378
|
+
const panResponder = useRef9(
|
|
5379
|
+
PanResponder.create({
|
|
5380
|
+
onStartShouldSetPanResponder: () => !disabled,
|
|
5381
|
+
onMoveShouldSetPanResponder: () => !disabled,
|
|
5382
|
+
onPanResponderGrant: (_, gestureState) => {
|
|
5383
|
+
lastTickValue.current = value;
|
|
5384
|
+
},
|
|
5385
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
5386
|
+
const touchX = gestureState.moveX;
|
|
5387
|
+
trackRef.current?.measureInWindow((trackX) => {
|
|
5388
|
+
const relX = touchX - trackX;
|
|
5389
|
+
const newVal = positionToValue(relX);
|
|
5390
|
+
const tickDelta = Math.abs(newVal - lastTickValue.current);
|
|
5391
|
+
if (tickDelta >= TICK_INTERVAL) {
|
|
5392
|
+
lastTickValue.current = newVal;
|
|
5393
|
+
onTick?.(newVal);
|
|
5394
|
+
}
|
|
5395
|
+
onValueChange(newVal);
|
|
5396
|
+
});
|
|
5397
|
+
},
|
|
5398
|
+
onPanResponderRelease: () => {
|
|
5399
|
+
onSlidingComplete?.(value);
|
|
5400
|
+
}
|
|
5401
|
+
})
|
|
5402
|
+
).current;
|
|
5403
|
+
const ratio = (value - min) / (max - min);
|
|
5404
|
+
const filledWidth = `${ratio * 100}%`;
|
|
5405
|
+
const markers = [min, max * 0.25, max * 0.5, max * 0.75, max];
|
|
5406
|
+
return /* @__PURE__ */ jsxs13(View14, { style: styles13.container, children: [
|
|
5407
|
+
/* @__PURE__ */ jsxs13(
|
|
5408
|
+
View14,
|
|
5409
|
+
{
|
|
5410
|
+
ref: trackRef,
|
|
5411
|
+
style: styles13.trackContainer,
|
|
5412
|
+
onLayout: (e) => {
|
|
5413
|
+
trackWidth.current = e.nativeEvent.layout.width;
|
|
5414
|
+
},
|
|
5415
|
+
...panResponder.panHandlers,
|
|
5416
|
+
children: [
|
|
5417
|
+
/* @__PURE__ */ jsx16(View14, { style: [styles13.track, { backgroundColor: "#2C2C2E" }], children: /* @__PURE__ */ jsx16(View14, { style: [styles13.trackFilled, { width: filledWidth, backgroundColor: accent }] }) }),
|
|
5418
|
+
/* @__PURE__ */ jsx16(View14, { style: styles13.markerRow, children: markers.map((m, i) => {
|
|
5419
|
+
const mRatio = (m - min) / (max - min);
|
|
5420
|
+
return /* @__PURE__ */ jsx16(
|
|
5421
|
+
View14,
|
|
5422
|
+
{
|
|
5423
|
+
style: [
|
|
5424
|
+
styles13.marker,
|
|
5425
|
+
{
|
|
5426
|
+
left: `${mRatio * 100}%`,
|
|
5427
|
+
backgroundColor: value >= m ? accent : "#3A3A3C"
|
|
5428
|
+
}
|
|
5429
|
+
]
|
|
5430
|
+
},
|
|
5431
|
+
i
|
|
5432
|
+
);
|
|
5433
|
+
}) }),
|
|
5434
|
+
/* @__PURE__ */ jsx16(
|
|
5435
|
+
View14,
|
|
5436
|
+
{
|
|
5437
|
+
style: [
|
|
5438
|
+
styles13.thumb,
|
|
5439
|
+
{
|
|
5440
|
+
left: filledWidth,
|
|
5441
|
+
backgroundColor: accent,
|
|
5442
|
+
shadowColor: accent
|
|
5443
|
+
}
|
|
5444
|
+
],
|
|
5445
|
+
children: /* @__PURE__ */ jsx16(View14, { style: styles13.thumbInner })
|
|
5446
|
+
}
|
|
5447
|
+
)
|
|
5448
|
+
]
|
|
5449
|
+
}
|
|
5450
|
+
),
|
|
5451
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles13.rangeRow, children: [
|
|
5452
|
+
/* @__PURE__ */ jsx16(Text14, { style: styles13.rangeText, children: min }),
|
|
5453
|
+
/* @__PURE__ */ jsxs13(Text14, { style: styles13.rangeText, children: [
|
|
5454
|
+
max,
|
|
5455
|
+
" SOL"
|
|
5456
|
+
] })
|
|
5457
|
+
] })
|
|
5458
|
+
] });
|
|
5459
|
+
}
|
|
5460
|
+
var styles13 = StyleSheet14.create({
|
|
5461
|
+
container: {
|
|
5462
|
+
paddingVertical: 4
|
|
5463
|
+
},
|
|
5464
|
+
trackContainer: {
|
|
5465
|
+
height: THUMB_SIZE + 16,
|
|
5466
|
+
justifyContent: "center",
|
|
5467
|
+
paddingHorizontal: THUMB_SIZE / 2
|
|
5468
|
+
},
|
|
5469
|
+
track: {
|
|
5470
|
+
height: TRACK_HEIGHT,
|
|
5471
|
+
borderRadius: TRACK_HEIGHT / 2,
|
|
5472
|
+
overflow: "hidden"
|
|
5473
|
+
},
|
|
5474
|
+
trackFilled: {
|
|
5475
|
+
height: "100%",
|
|
5476
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
5477
|
+
},
|
|
5478
|
+
markerRow: {
|
|
5479
|
+
position: "absolute",
|
|
5480
|
+
left: THUMB_SIZE / 2,
|
|
5481
|
+
right: THUMB_SIZE / 2,
|
|
5482
|
+
height: TRACK_HEIGHT,
|
|
5483
|
+
top: (THUMB_SIZE + 16 - TRACK_HEIGHT) / 2
|
|
5484
|
+
},
|
|
5485
|
+
marker: {
|
|
5486
|
+
position: "absolute",
|
|
5487
|
+
width: 3,
|
|
5488
|
+
height: 12,
|
|
5489
|
+
borderRadius: 1.5,
|
|
5490
|
+
top: -3,
|
|
5491
|
+
marginLeft: -1.5
|
|
5492
|
+
},
|
|
5493
|
+
thumb: {
|
|
5494
|
+
position: "absolute",
|
|
5495
|
+
width: THUMB_SIZE,
|
|
5496
|
+
height: THUMB_SIZE,
|
|
5497
|
+
borderRadius: THUMB_SIZE / 2,
|
|
5498
|
+
top: 8,
|
|
5499
|
+
marginLeft: 0,
|
|
5500
|
+
alignItems: "center",
|
|
5501
|
+
justifyContent: "center",
|
|
5502
|
+
...Platform7.select({
|
|
5503
|
+
ios: {
|
|
5504
|
+
shadowOffset: { width: 0, height: 0 },
|
|
5505
|
+
shadowOpacity: 0.6,
|
|
5506
|
+
shadowRadius: 10
|
|
5507
|
+
},
|
|
5508
|
+
android: {
|
|
5509
|
+
elevation: 8
|
|
5510
|
+
}
|
|
5511
|
+
})
|
|
5512
|
+
},
|
|
5513
|
+
thumbInner: {
|
|
5514
|
+
width: 12,
|
|
5515
|
+
height: 12,
|
|
5516
|
+
borderRadius: 6,
|
|
5517
|
+
backgroundColor: "#FFFFFF"
|
|
5518
|
+
},
|
|
5519
|
+
rangeRow: {
|
|
5520
|
+
flexDirection: "row",
|
|
5521
|
+
justifyContent: "space-between",
|
|
5522
|
+
paddingHorizontal: THUMB_SIZE / 2,
|
|
5523
|
+
marginTop: 4
|
|
5524
|
+
},
|
|
5525
|
+
rangeText: {
|
|
5526
|
+
color: "#5A5A5E",
|
|
5527
|
+
fontSize: 11,
|
|
5528
|
+
fontWeight: "600"
|
|
5529
|
+
}
|
|
5530
|
+
});
|
|
5531
|
+
|
|
5532
|
+
// src/ui/game/JoinGameSheet.tsx
|
|
5533
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
5337
5534
|
var STATUS_LABELS3 = {
|
|
5338
5535
|
building: "Building transaction...",
|
|
5339
5536
|
signing: "Approve in wallet...",
|
|
@@ -5360,6 +5557,8 @@ function JoinGameSheet({
|
|
|
5360
5557
|
onError,
|
|
5361
5558
|
onTeamSelect,
|
|
5362
5559
|
onJoinSuccess,
|
|
5560
|
+
onSliderTick,
|
|
5561
|
+
maxWager = 5,
|
|
5363
5562
|
isPoolModeEnabled = false
|
|
5364
5563
|
}) {
|
|
5365
5564
|
const t = useDubsTheme();
|
|
@@ -5367,10 +5566,11 @@ function JoinGameSheet({
|
|
|
5367
5566
|
const mutation = useJoinGame();
|
|
5368
5567
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
5369
5568
|
const [selectedTeam, setSelectedTeam] = useState28(null);
|
|
5569
|
+
const [wager, setWager] = useState28(game.buyIn);
|
|
5370
5570
|
const [showSuccess, setShowSuccess] = useState28(false);
|
|
5371
|
-
const overlayOpacity =
|
|
5372
|
-
const successScale =
|
|
5373
|
-
const successOpacity =
|
|
5571
|
+
const overlayOpacity = useRef10(new Animated4.Value(0)).current;
|
|
5572
|
+
const successScale = useRef10(new Animated4.Value(0)).current;
|
|
5573
|
+
const successOpacity = useRef10(new Animated4.Value(0)).current;
|
|
5374
5574
|
useEffect17(() => {
|
|
5375
5575
|
Animated4.timing(overlayOpacity, {
|
|
5376
5576
|
toValue: visible ? 1 : 0,
|
|
@@ -5381,6 +5581,7 @@ function JoinGameSheet({
|
|
|
5381
5581
|
useEffect17(() => {
|
|
5382
5582
|
if (visible) {
|
|
5383
5583
|
setSelectedTeam(isPoolModeEnabled ? "home" : isCustomGame ? "away" : null);
|
|
5584
|
+
setWager(game.buyIn);
|
|
5384
5585
|
setShowSuccess(false);
|
|
5385
5586
|
successScale.setValue(0);
|
|
5386
5587
|
successOpacity.setValue(0);
|
|
@@ -5415,18 +5616,20 @@ function JoinGameSheet({
|
|
|
5415
5616
|
const homePool = game.homePool || 0;
|
|
5416
5617
|
const awayPool = game.awayPool || 0;
|
|
5417
5618
|
const buyIn = game.buyIn;
|
|
5418
|
-
const
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5619
|
+
const poolAfterJoin = totalPool + wager;
|
|
5620
|
+
const { homeOdds, awayOdds, homeBets, awayBets } = useMemo9(() => {
|
|
5621
|
+
const newPool = totalPool + wager;
|
|
5622
|
+
return {
|
|
5623
|
+
homeOdds: homePool > 0 ? (newPool / (homePool + (selectedTeam === "home" ? wager : 0))).toFixed(2) : "\u2014",
|
|
5624
|
+
awayOdds: awayPool > 0 ? (newPool / (awayPool + (selectedTeam === "away" ? wager : 0))).toFixed(2) : "\u2014",
|
|
5625
|
+
homeBets: bettors.filter((b) => b.team === "home").length,
|
|
5626
|
+
awayBets: bettors.filter((b) => b.team === "away").length
|
|
5627
|
+
};
|
|
5628
|
+
}, [totalPool, homePool, awayPool, bettors, wager, selectedTeam]);
|
|
5425
5629
|
const selectedOdds = selectedTeam === "home" ? homeOdds : selectedTeam === "away" ? awayOdds : "\u2014";
|
|
5426
|
-
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) *
|
|
5630
|
+
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
|
|
5427
5631
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
5428
5632
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
5429
|
-
const selectedName = selectedTeam === "home" ? homeName : selectedTeam === "away" ? awayName : "\u2014";
|
|
5430
5633
|
const alreadyJoined = useMemo9(() => {
|
|
5431
5634
|
if (!wallet.publicKey) return false;
|
|
5432
5635
|
const addr = wallet.publicKey.toBase58();
|
|
@@ -5434,20 +5637,20 @@ function JoinGameSheet({
|
|
|
5434
5637
|
}, [bettors, wallet.publicKey]);
|
|
5435
5638
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5436
5639
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
|
|
5437
|
-
const handleJoin =
|
|
5640
|
+
const handleJoin = useCallback24(async () => {
|
|
5438
5641
|
if (!selectedTeam || !wallet.publicKey) return;
|
|
5439
5642
|
try {
|
|
5440
5643
|
await mutation.execute({
|
|
5441
5644
|
playerWallet: wallet.publicKey.toBase58(),
|
|
5442
5645
|
gameId: game.gameId,
|
|
5443
5646
|
teamChoice: selectedTeam,
|
|
5444
|
-
amount:
|
|
5647
|
+
amount: wager
|
|
5445
5648
|
});
|
|
5446
5649
|
} catch {
|
|
5447
5650
|
}
|
|
5448
|
-
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId,
|
|
5651
|
+
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, wager]);
|
|
5449
5652
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
5450
|
-
return /* @__PURE__ */
|
|
5653
|
+
return /* @__PURE__ */ jsxs14(
|
|
5451
5654
|
Modal3,
|
|
5452
5655
|
{
|
|
5453
5656
|
visible,
|
|
@@ -5455,49 +5658,49 @@ function JoinGameSheet({
|
|
|
5455
5658
|
transparent: true,
|
|
5456
5659
|
onRequestClose: onDismiss,
|
|
5457
5660
|
children: [
|
|
5458
|
-
/* @__PURE__ */
|
|
5459
|
-
showSuccess && /* @__PURE__ */
|
|
5460
|
-
/* @__PURE__ */
|
|
5461
|
-
/* @__PURE__ */
|
|
5462
|
-
/* @__PURE__ */
|
|
5661
|
+
/* @__PURE__ */ jsx17(Animated4.View, { style: [styles14.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx17(TouchableOpacity10, { style: styles14.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5662
|
+
showSuccess && /* @__PURE__ */ jsx17(View15, { style: styles14.successOverlay, children: /* @__PURE__ */ jsxs14(Animated4.View, { style: [styles14.successContent, { opacity: successOpacity, transform: [{ scale: successScale }] }], children: [
|
|
5663
|
+
/* @__PURE__ */ jsx17(Text15, { style: styles14.successEmoji, children: "\u{1F389}" }),
|
|
5664
|
+
/* @__PURE__ */ jsx17(Text15, { style: styles14.successTitle, children: "You're in!" }),
|
|
5665
|
+
/* @__PURE__ */ jsxs14(Text15, { style: styles14.successSub, children: [
|
|
5463
5666
|
formatSol(buyIn),
|
|
5464
5667
|
" SOL on ",
|
|
5465
5668
|
selectedName
|
|
5466
5669
|
] })
|
|
5467
5670
|
] }) }),
|
|
5468
|
-
/* @__PURE__ */
|
|
5671
|
+
/* @__PURE__ */ jsx17(
|
|
5469
5672
|
KeyboardAvoidingView4,
|
|
5470
5673
|
{
|
|
5471
|
-
style:
|
|
5472
|
-
behavior:
|
|
5473
|
-
children: /* @__PURE__ */
|
|
5474
|
-
/* @__PURE__ */
|
|
5475
|
-
/* @__PURE__ */
|
|
5476
|
-
/* @__PURE__ */
|
|
5477
|
-
/* @__PURE__ */
|
|
5674
|
+
style: styles14.keyboardView,
|
|
5675
|
+
behavior: Platform8.OS === "ios" ? "padding" : void 0,
|
|
5676
|
+
children: /* @__PURE__ */ jsx17(View15, { style: styles14.sheetPositioner, children: /* @__PURE__ */ jsxs14(View15, { style: [styles14.sheet, { backgroundColor: t.background }], children: [
|
|
5677
|
+
/* @__PURE__ */ jsx17(View15, { style: styles14.handleRow, children: /* @__PURE__ */ jsx17(View15, { style: [styles14.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5678
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.header, children: [
|
|
5679
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
5680
|
+
/* @__PURE__ */ jsx17(TouchableOpacity10, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx17(Text15, { style: [styles14.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5478
5681
|
] }),
|
|
5479
|
-
bettors.length > 0 && /* @__PURE__ */
|
|
5480
|
-
/* @__PURE__ */
|
|
5682
|
+
bettors.length > 0 && /* @__PURE__ */ jsxs14(View15, { style: styles14.bettorsSection, children: [
|
|
5683
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.bettorsLabel, { color: t.textMuted }], children: [
|
|
5481
5684
|
bettors.length,
|
|
5482
5685
|
" ",
|
|
5483
5686
|
bettors.length === 1 ? "player" : "players",
|
|
5484
5687
|
" in this game"
|
|
5485
5688
|
] }),
|
|
5486
|
-
/* @__PURE__ */
|
|
5689
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.bettorsRow, children: [
|
|
5487
5690
|
bettors.slice(0, 6).map((b, i) => {
|
|
5488
5691
|
const pngUrl = toPng(b.avatar);
|
|
5489
|
-
return /* @__PURE__ */
|
|
5692
|
+
return /* @__PURE__ */ jsx17(View15, { style: [styles14.bettorCircle, { backgroundColor: ["#EF4444", "#3B82F6", "#22C55E", "#F59E0B", "#A855F7", "#EC4899"][i % 6] }], children: pngUrl ? /* @__PURE__ */ jsx17(Image6, { source: { uri: pngUrl }, style: styles14.bettorImg }) : /* @__PURE__ */ jsx17(Text15, { style: styles14.bettorInitial, children: (b.username ?? b.wallet).charAt(0).toUpperCase() }) }, b.wallet);
|
|
5490
5693
|
}),
|
|
5491
|
-
bettors.length > 6 && /* @__PURE__ */
|
|
5694
|
+
bettors.length > 6 && /* @__PURE__ */ jsx17(View15, { style: [styles14.bettorCircle, { backgroundColor: "#2C2C2E" }], children: /* @__PURE__ */ jsxs14(Text15, { style: styles14.bettorOverflow, children: [
|
|
5492
5695
|
"+",
|
|
5493
5696
|
bettors.length - 6
|
|
5494
5697
|
] }) })
|
|
5495
5698
|
] })
|
|
5496
5699
|
] }),
|
|
5497
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */
|
|
5498
|
-
/* @__PURE__ */
|
|
5499
|
-
/* @__PURE__ */
|
|
5500
|
-
/* @__PURE__ */
|
|
5700
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ jsxs14(View15, { style: styles14.section, children: [
|
|
5701
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5702
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.teamsRow, children: [
|
|
5703
|
+
/* @__PURE__ */ jsx17(
|
|
5501
5704
|
TeamButton,
|
|
5502
5705
|
{
|
|
5503
5706
|
name: homeName,
|
|
@@ -5514,7 +5717,7 @@ function JoinGameSheet({
|
|
|
5514
5717
|
t
|
|
5515
5718
|
}
|
|
5516
5719
|
),
|
|
5517
|
-
/* @__PURE__ */
|
|
5720
|
+
/* @__PURE__ */ jsx17(
|
|
5518
5721
|
TeamButton,
|
|
5519
5722
|
{
|
|
5520
5723
|
name: awayName,
|
|
@@ -5533,64 +5736,71 @@ function JoinGameSheet({
|
|
|
5533
5736
|
)
|
|
5534
5737
|
] })
|
|
5535
5738
|
] }),
|
|
5536
|
-
/* @__PURE__ */
|
|
5537
|
-
/* @__PURE__ */
|
|
5538
|
-
/* @__PURE__ */
|
|
5539
|
-
/* @__PURE__ */
|
|
5540
|
-
formatSol(
|
|
5739
|
+
/* @__PURE__ */ jsxs14(View15, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5740
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5741
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
5742
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.summaryValue, { color: t.text }], children: [
|
|
5743
|
+
formatSol(wager),
|
|
5541
5744
|
" SOL"
|
|
5542
5745
|
] })
|
|
5543
5746
|
] }),
|
|
5544
|
-
/* @__PURE__ */
|
|
5545
|
-
isPoolModeEnabled ? /* @__PURE__ */
|
|
5546
|
-
/* @__PURE__ */
|
|
5547
|
-
/* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5747
|
+
/* @__PURE__ */ jsx17(View15, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5748
|
+
isPoolModeEnabled ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
5749
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5750
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5751
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryValue, { color: t.text }], children: bettors.length })
|
|
5549
5752
|
] }),
|
|
5550
|
-
/* @__PURE__ */
|
|
5551
|
-
/* @__PURE__ */
|
|
5552
|
-
/* @__PURE__ */
|
|
5553
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ jsx17(View15, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5754
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5755
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5756
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.summaryValue, { color: t.success }], children: [
|
|
5554
5757
|
formatSol(totalPool),
|
|
5555
5758
|
" SOL"
|
|
5556
5759
|
] })
|
|
5557
5760
|
] })
|
|
5558
|
-
] }) : /* @__PURE__ */
|
|
5559
|
-
/* @__PURE__ */
|
|
5560
|
-
/* @__PURE__ */
|
|
5561
|
-
/* @__PURE__ */
|
|
5562
|
-
] }),
|
|
5563
|
-
/* @__PURE__ */ jsx16(View14, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5564
|
-
/* @__PURE__ */ jsxs13(View14, { style: styles13.summaryRow, children: [
|
|
5565
|
-
/* @__PURE__ */ jsx16(Text14, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5566
|
-
/* @__PURE__ */ jsxs13(Text14, { style: [styles13.summaryValue, { color: t.text }], children: [
|
|
5761
|
+
] }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
5762
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5763
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5764
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.summaryValue, { color: t.text }], children: [
|
|
5567
5765
|
formatSol(poolAfterJoin),
|
|
5568
5766
|
" SOL"
|
|
5569
5767
|
] })
|
|
5570
5768
|
] }),
|
|
5571
|
-
/* @__PURE__ */
|
|
5572
|
-
/* @__PURE__ */
|
|
5573
|
-
/* @__PURE__ */
|
|
5574
|
-
/* @__PURE__ */
|
|
5769
|
+
/* @__PURE__ */ jsx17(View15, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5770
|
+
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5771
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5772
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5575
5773
|
] })
|
|
5576
5774
|
] })
|
|
5577
5775
|
] }),
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5776
|
+
selectedTeam && !isPoolModeEnabled && /* @__PURE__ */ jsx17(
|
|
5777
|
+
SolSlider,
|
|
5778
|
+
{
|
|
5779
|
+
value: wager,
|
|
5780
|
+
min: game.buyIn,
|
|
5781
|
+
max: maxWager,
|
|
5782
|
+
step: 0.01,
|
|
5783
|
+
accentColor: selectedTeam === "home" ? homeColor : awayColor,
|
|
5784
|
+
onValueChange: setWager,
|
|
5785
|
+
onTick: onSliderTick
|
|
5786
|
+
}
|
|
5787
|
+
),
|
|
5788
|
+
alreadyJoined && /* @__PURE__ */ jsx17(View15, { style: [styles14.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ jsx17(Text15, { style: [styles14.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5789
|
+
mutation.error && /* @__PURE__ */ jsx17(View15, { style: [styles14.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx17(Text15, { style: [styles14.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5790
|
+
/* @__PURE__ */ jsx17(
|
|
5581
5791
|
TouchableOpacity10,
|
|
5582
5792
|
{
|
|
5583
5793
|
style: [
|
|
5584
|
-
|
|
5794
|
+
styles14.ctaButton,
|
|
5585
5795
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5586
5796
|
],
|
|
5587
5797
|
disabled: !canJoin,
|
|
5588
5798
|
onPress: handleJoin,
|
|
5589
5799
|
activeOpacity: 0.8,
|
|
5590
|
-
children: isMutating ? /* @__PURE__ */
|
|
5591
|
-
/* @__PURE__ */
|
|
5592
|
-
/* @__PURE__ */
|
|
5593
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
5800
|
+
children: isMutating ? /* @__PURE__ */ jsxs14(View15, { style: styles14.ctaLoading, children: [
|
|
5801
|
+
/* @__PURE__ */ jsx17(ActivityIndicator8, { size: "small", color: "#FFFFFF" }),
|
|
5802
|
+
/* @__PURE__ */ jsx17(Text15, { style: styles14.ctaText, children: statusLabel })
|
|
5803
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx17(Text15, { style: styles14.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ jsx17(Text15, { style: [styles14.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" })
|
|
5594
5804
|
}
|
|
5595
5805
|
)
|
|
5596
5806
|
] }) })
|
|
@@ -5614,32 +5824,32 @@ function TeamButton({
|
|
|
5614
5824
|
const [imgFailed, setImgFailed] = useState28(false);
|
|
5615
5825
|
const Img = ImageComponent || __require("react-native").Image;
|
|
5616
5826
|
const showImage = imageUrl && !imgFailed;
|
|
5617
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ jsxs14(
|
|
5618
5828
|
TouchableOpacity10,
|
|
5619
5829
|
{
|
|
5620
|
-
style: [
|
|
5830
|
+
style: [styles14.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5621
5831
|
onPress,
|
|
5622
5832
|
activeOpacity: 0.7,
|
|
5623
5833
|
children: [
|
|
5624
|
-
showImage ? /* @__PURE__ */
|
|
5625
|
-
/* @__PURE__ */
|
|
5626
|
-
/* @__PURE__ */
|
|
5834
|
+
showImage ? /* @__PURE__ */ jsx17(Img, { source: { uri: imageUrl }, style: styles14.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ jsx17(View15, { style: [styles14.teamLogo, styles14.teamLogoPlaceholder] }),
|
|
5835
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5836
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamOdds, { color }], children: [
|
|
5627
5837
|
odds,
|
|
5628
5838
|
"x"
|
|
5629
5839
|
] }),
|
|
5630
|
-
/* @__PURE__ */
|
|
5840
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.teamBets, { color: t.textMuted }], children: [
|
|
5631
5841
|
bets,
|
|
5632
5842
|
" ",
|
|
5633
5843
|
bets === 1 ? "bet" : "bets"
|
|
5634
5844
|
] }),
|
|
5635
|
-
selected && /* @__PURE__ */
|
|
5845
|
+
selected && /* @__PURE__ */ jsx17(View15, { style: [styles14.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ jsx17(Text15, { style: styles14.teamBadgeText, children: "Selected" }) })
|
|
5636
5846
|
]
|
|
5637
5847
|
}
|
|
5638
5848
|
);
|
|
5639
5849
|
}
|
|
5640
|
-
var
|
|
5850
|
+
var styles14 = StyleSheet15.create({
|
|
5641
5851
|
overlay: {
|
|
5642
|
-
...
|
|
5852
|
+
...StyleSheet15.absoluteFillObject,
|
|
5643
5853
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5644
5854
|
},
|
|
5645
5855
|
overlayTap: {
|
|
@@ -5722,7 +5932,7 @@ var styles13 = StyleSheet14.create({
|
|
|
5722
5932
|
},
|
|
5723
5933
|
// Success overlay
|
|
5724
5934
|
successOverlay: {
|
|
5725
|
-
...
|
|
5935
|
+
...StyleSheet15.absoluteFillObject,
|
|
5726
5936
|
zIndex: 100,
|
|
5727
5937
|
alignItems: "center",
|
|
5728
5938
|
justifyContent: "center",
|
|
@@ -5849,19 +6059,19 @@ var styles13 = StyleSheet14.create({
|
|
|
5849
6059
|
});
|
|
5850
6060
|
|
|
5851
6061
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5852
|
-
import { useState as useState29, useEffect as useEffect18, useRef as
|
|
6062
|
+
import { useState as useState29, useEffect as useEffect18, useRef as useRef11, useCallback as useCallback25 } from "react";
|
|
5853
6063
|
import {
|
|
5854
|
-
View as
|
|
5855
|
-
Text as
|
|
6064
|
+
View as View16,
|
|
6065
|
+
Text as Text16,
|
|
5856
6066
|
TouchableOpacity as TouchableOpacity11,
|
|
5857
6067
|
ActivityIndicator as ActivityIndicator9,
|
|
5858
6068
|
Modal as Modal4,
|
|
5859
6069
|
Animated as Animated5,
|
|
5860
|
-
StyleSheet as
|
|
6070
|
+
StyleSheet as StyleSheet16,
|
|
5861
6071
|
KeyboardAvoidingView as KeyboardAvoidingView5,
|
|
5862
|
-
Platform as
|
|
6072
|
+
Platform as Platform9
|
|
5863
6073
|
} from "react-native";
|
|
5864
|
-
import { jsx as
|
|
6074
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
5865
6075
|
var STATUS_LABELS4 = {
|
|
5866
6076
|
building: "Building transaction...",
|
|
5867
6077
|
signing: "Approve in wallet...",
|
|
@@ -5880,9 +6090,9 @@ function ClaimPrizeSheet({
|
|
|
5880
6090
|
const t = useDubsTheme();
|
|
5881
6091
|
const { wallet } = useDubs();
|
|
5882
6092
|
const mutation = useClaim();
|
|
5883
|
-
const overlayOpacity =
|
|
5884
|
-
const celebrationScale =
|
|
5885
|
-
const celebrationOpacity =
|
|
6093
|
+
const overlayOpacity = useRef11(new Animated5.Value(0)).current;
|
|
6094
|
+
const celebrationScale = useRef11(new Animated5.Value(0)).current;
|
|
6095
|
+
const celebrationOpacity = useRef11(new Animated5.Value(0)).current;
|
|
5886
6096
|
const [showCelebration, setShowCelebration] = useState29(false);
|
|
5887
6097
|
useEffect18(() => {
|
|
5888
6098
|
Animated5.timing(overlayOpacity, {
|
|
@@ -5929,7 +6139,7 @@ function ClaimPrizeSheet({
|
|
|
5929
6139
|
}, [mutation.status, mutation.error]);
|
|
5930
6140
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5931
6141
|
const canClaim = !isMutating && mutation.status !== "success" && !!wallet.publicKey;
|
|
5932
|
-
const handleClaim =
|
|
6142
|
+
const handleClaim = useCallback25(async () => {
|
|
5933
6143
|
if (!wallet.publicKey) return;
|
|
5934
6144
|
try {
|
|
5935
6145
|
await mutation.execute({
|
|
@@ -5941,7 +6151,7 @@ function ClaimPrizeSheet({
|
|
|
5941
6151
|
}
|
|
5942
6152
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5943
6153
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5944
|
-
return /* @__PURE__ */
|
|
6154
|
+
return /* @__PURE__ */ jsxs15(
|
|
5945
6155
|
Modal4,
|
|
5946
6156
|
{
|
|
5947
6157
|
visible,
|
|
@@ -5949,54 +6159,54 @@ function ClaimPrizeSheet({
|
|
|
5949
6159
|
transparent: true,
|
|
5950
6160
|
onRequestClose: onDismiss,
|
|
5951
6161
|
children: [
|
|
5952
|
-
/* @__PURE__ */
|
|
5953
|
-
/* @__PURE__ */
|
|
6162
|
+
/* @__PURE__ */ jsx18(Animated5.View, { style: [styles15.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx18(TouchableOpacity11, { style: styles15.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6163
|
+
/* @__PURE__ */ jsx18(
|
|
5954
6164
|
KeyboardAvoidingView5,
|
|
5955
6165
|
{
|
|
5956
|
-
style:
|
|
5957
|
-
behavior:
|
|
5958
|
-
children: /* @__PURE__ */
|
|
5959
|
-
/* @__PURE__ */
|
|
5960
|
-
/* @__PURE__ */
|
|
5961
|
-
/* @__PURE__ */
|
|
5962
|
-
/* @__PURE__ */
|
|
6166
|
+
style: styles15.keyboardView,
|
|
6167
|
+
behavior: Platform9.OS === "ios" ? "padding" : void 0,
|
|
6168
|
+
children: /* @__PURE__ */ jsx18(View16, { style: styles15.sheetPositioner, children: /* @__PURE__ */ jsxs15(View16, { style: [styles15.sheet, { backgroundColor: t.background }], children: [
|
|
6169
|
+
/* @__PURE__ */ jsx18(View16, { style: styles15.handleRow, children: /* @__PURE__ */ jsx18(View16, { style: [styles15.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6170
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.header, children: [
|
|
6171
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
6172
|
+
/* @__PURE__ */ jsx18(TouchableOpacity11, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx18(Text16, { style: [styles15.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5963
6173
|
] }),
|
|
5964
|
-
showCelebration && /* @__PURE__ */
|
|
6174
|
+
showCelebration && /* @__PURE__ */ jsxs15(
|
|
5965
6175
|
Animated5.View,
|
|
5966
6176
|
{
|
|
5967
6177
|
style: [
|
|
5968
|
-
|
|
6178
|
+
styles15.celebrationContainer,
|
|
5969
6179
|
{
|
|
5970
6180
|
opacity: celebrationOpacity,
|
|
5971
6181
|
transform: [{ scale: celebrationScale }]
|
|
5972
6182
|
}
|
|
5973
6183
|
],
|
|
5974
6184
|
children: [
|
|
5975
|
-
/* @__PURE__ */
|
|
5976
|
-
/* @__PURE__ */
|
|
6185
|
+
/* @__PURE__ */ jsx18(Text16, { style: styles15.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
6186
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.celebrationText, { color: t.success }], children: [
|
|
5977
6187
|
"+",
|
|
5978
6188
|
prizeAmount,
|
|
5979
6189
|
" SOL"
|
|
5980
6190
|
] }),
|
|
5981
|
-
/* @__PURE__ */
|
|
6191
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5982
6192
|
]
|
|
5983
6193
|
}
|
|
5984
6194
|
),
|
|
5985
|
-
!showCelebration && /* @__PURE__ */
|
|
5986
|
-
/* @__PURE__ */
|
|
5987
|
-
/* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
6195
|
+
!showCelebration && /* @__PURE__ */ jsxs15(View16, { style: [styles15.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6196
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
6197
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
6198
|
+
/* @__PURE__ */ jsxs15(Text16, { style: [styles15.summaryValue, { color: t.success }], children: [
|
|
5989
6199
|
prizeAmount,
|
|
5990
6200
|
" SOL"
|
|
5991
6201
|
] })
|
|
5992
6202
|
] }),
|
|
5993
|
-
/* @__PURE__ */
|
|
5994
|
-
/* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
5996
|
-
/* @__PURE__ */
|
|
5997
|
-
|
|
6203
|
+
/* @__PURE__ */ jsx18(View16, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
|
|
6204
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles15.summaryRow, children: [
|
|
6205
|
+
/* @__PURE__ */ jsx18(Text16, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
6206
|
+
/* @__PURE__ */ jsxs15(
|
|
6207
|
+
Text16,
|
|
5998
6208
|
{
|
|
5999
|
-
style: [
|
|
6209
|
+
style: [styles15.summaryValue, { color: t.text }],
|
|
6000
6210
|
numberOfLines: 1,
|
|
6001
6211
|
children: [
|
|
6002
6212
|
gameId.slice(0, 8),
|
|
@@ -6007,21 +6217,21 @@ function ClaimPrizeSheet({
|
|
|
6007
6217
|
)
|
|
6008
6218
|
] })
|
|
6009
6219
|
] }),
|
|
6010
|
-
mutation.error && /* @__PURE__ */
|
|
6011
|
-
!showCelebration && /* @__PURE__ */
|
|
6220
|
+
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 }) }),
|
|
6221
|
+
!showCelebration && /* @__PURE__ */ jsx18(
|
|
6012
6222
|
TouchableOpacity11,
|
|
6013
6223
|
{
|
|
6014
6224
|
style: [
|
|
6015
|
-
|
|
6225
|
+
styles15.ctaButton,
|
|
6016
6226
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
6017
6227
|
],
|
|
6018
6228
|
disabled: !canClaim,
|
|
6019
6229
|
onPress: handleClaim,
|
|
6020
6230
|
activeOpacity: 0.8,
|
|
6021
|
-
children: isMutating ? /* @__PURE__ */
|
|
6022
|
-
/* @__PURE__ */
|
|
6023
|
-
/* @__PURE__ */
|
|
6024
|
-
] }) : /* @__PURE__ */
|
|
6231
|
+
children: isMutating ? /* @__PURE__ */ jsxs15(View16, { style: styles15.ctaLoading, children: [
|
|
6232
|
+
/* @__PURE__ */ jsx18(ActivityIndicator9, { size: "small", color: "#FFFFFF" }),
|
|
6233
|
+
/* @__PURE__ */ jsx18(Text16, { style: styles15.ctaText, children: statusLabel })
|
|
6234
|
+
] }) : /* @__PURE__ */ jsxs15(Text16, { style: [styles15.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
6025
6235
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
6026
6236
|
" \u2014 ",
|
|
6027
6237
|
prizeAmount,
|
|
@@ -6029,7 +6239,7 @@ function ClaimPrizeSheet({
|
|
|
6029
6239
|
] })
|
|
6030
6240
|
}
|
|
6031
6241
|
),
|
|
6032
|
-
mutation.data?.explorerUrl && /* @__PURE__ */
|
|
6242
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ jsx18(Text16, { style: [styles15.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
6033
6243
|
] }) })
|
|
6034
6244
|
}
|
|
6035
6245
|
)
|
|
@@ -6037,9 +6247,9 @@ function ClaimPrizeSheet({
|
|
|
6037
6247
|
}
|
|
6038
6248
|
);
|
|
6039
6249
|
}
|
|
6040
|
-
var
|
|
6250
|
+
var styles15 = StyleSheet16.create({
|
|
6041
6251
|
overlay: {
|
|
6042
|
-
...
|
|
6252
|
+
...StyleSheet16.absoluteFillObject,
|
|
6043
6253
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6044
6254
|
},
|
|
6045
6255
|
overlayTap: {
|
|
@@ -6162,9 +6372,9 @@ var styles14 = StyleSheet15.create({
|
|
|
6162
6372
|
});
|
|
6163
6373
|
|
|
6164
6374
|
// src/ui/game/ClaimButton.tsx
|
|
6165
|
-
import { useState as useState30, useMemo as useMemo10, useCallback as
|
|
6166
|
-
import { StyleSheet as
|
|
6167
|
-
import { Fragment as Fragment5, jsx as
|
|
6375
|
+
import { useState as useState30, useMemo as useMemo10, useCallback as useCallback26 } from "react";
|
|
6376
|
+
import { StyleSheet as StyleSheet17, Text as Text17, TouchableOpacity as TouchableOpacity12 } from "react-native";
|
|
6377
|
+
import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
6168
6378
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
6169
6379
|
const t = useDubsTheme();
|
|
6170
6380
|
const { wallet } = useDubs();
|
|
@@ -6181,7 +6391,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6181
6391
|
const isWinner = isResolved && myBet != null && myBet.team === game.data?.winnerSide;
|
|
6182
6392
|
const isEligible = myBet != null && isResolved && (isWinner || isRefund);
|
|
6183
6393
|
const prizeAmount = isRefund ? myBet?.amount ?? 0 : game.data?.totalPool ?? 0;
|
|
6184
|
-
const handleSuccess =
|
|
6394
|
+
const handleSuccess = useCallback26(
|
|
6185
6395
|
(result) => {
|
|
6186
6396
|
claimStatus.refetch();
|
|
6187
6397
|
onSuccess?.(result);
|
|
@@ -6194,13 +6404,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6194
6404
|
}
|
|
6195
6405
|
const label = isRefund ? "Refund" : "Prize";
|
|
6196
6406
|
if (claimStatus.hasClaimed) {
|
|
6197
|
-
return /* @__PURE__ */
|
|
6407
|
+
return /* @__PURE__ */ jsx19(
|
|
6198
6408
|
TouchableOpacity12,
|
|
6199
6409
|
{
|
|
6200
|
-
style: [
|
|
6410
|
+
style: [styles16.badge, { borderColor: t.accent }, style],
|
|
6201
6411
|
activeOpacity: 1,
|
|
6202
6412
|
disabled: true,
|
|
6203
|
-
children: /* @__PURE__ */
|
|
6413
|
+
children: /* @__PURE__ */ jsxs16(Text17, { style: [styles16.badgeText, { color: t.accent }], children: [
|
|
6204
6414
|
label,
|
|
6205
6415
|
" Claimed!"
|
|
6206
6416
|
] })
|
|
@@ -6210,14 +6420,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6210
6420
|
if (!isEligible) {
|
|
6211
6421
|
return null;
|
|
6212
6422
|
}
|
|
6213
|
-
return /* @__PURE__ */
|
|
6214
|
-
/* @__PURE__ */
|
|
6423
|
+
return /* @__PURE__ */ jsxs16(Fragment5, { children: [
|
|
6424
|
+
/* @__PURE__ */ jsx19(
|
|
6215
6425
|
TouchableOpacity12,
|
|
6216
6426
|
{
|
|
6217
|
-
style: [
|
|
6427
|
+
style: [styles16.button, { backgroundColor: t.accent }, style],
|
|
6218
6428
|
activeOpacity: 0.8,
|
|
6219
6429
|
onPress: () => setSheetVisible(true),
|
|
6220
|
-
children: /* @__PURE__ */
|
|
6430
|
+
children: /* @__PURE__ */ jsxs16(Text17, { style: styles16.buttonText, children: [
|
|
6221
6431
|
"Claim ",
|
|
6222
6432
|
label,
|
|
6223
6433
|
" \u2014 ",
|
|
@@ -6226,7 +6436,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6226
6436
|
] })
|
|
6227
6437
|
}
|
|
6228
6438
|
),
|
|
6229
|
-
/* @__PURE__ */
|
|
6439
|
+
/* @__PURE__ */ jsx19(
|
|
6230
6440
|
ClaimPrizeSheet,
|
|
6231
6441
|
{
|
|
6232
6442
|
visible: sheetVisible,
|
|
@@ -6240,7 +6450,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6240
6450
|
)
|
|
6241
6451
|
] });
|
|
6242
6452
|
}
|
|
6243
|
-
var
|
|
6453
|
+
var styles16 = StyleSheet17.create({
|
|
6244
6454
|
button: {
|
|
6245
6455
|
height: 52,
|
|
6246
6456
|
borderRadius: 14,
|
|
@@ -6268,19 +6478,19 @@ var styles15 = StyleSheet16.create({
|
|
|
6268
6478
|
});
|
|
6269
6479
|
|
|
6270
6480
|
// src/ui/game/EnterArcadePoolSheet.tsx
|
|
6271
|
-
import { useEffect as useEffect19, useRef as
|
|
6481
|
+
import { useEffect as useEffect19, useRef as useRef12, useCallback as useCallback27 } from "react";
|
|
6272
6482
|
import {
|
|
6273
|
-
View as
|
|
6274
|
-
Text as
|
|
6483
|
+
View as View17,
|
|
6484
|
+
Text as Text18,
|
|
6275
6485
|
TouchableOpacity as TouchableOpacity13,
|
|
6276
6486
|
ActivityIndicator as ActivityIndicator10,
|
|
6277
6487
|
Modal as Modal5,
|
|
6278
6488
|
Animated as Animated6,
|
|
6279
|
-
StyleSheet as
|
|
6489
|
+
StyleSheet as StyleSheet18,
|
|
6280
6490
|
KeyboardAvoidingView as KeyboardAvoidingView6,
|
|
6281
|
-
Platform as
|
|
6491
|
+
Platform as Platform10
|
|
6282
6492
|
} from "react-native";
|
|
6283
|
-
import { Fragment as Fragment6, jsx as
|
|
6493
|
+
import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
6284
6494
|
var STATUS_LABELS5 = {
|
|
6285
6495
|
building: "Building transaction...",
|
|
6286
6496
|
signing: "Approve in wallet...",
|
|
@@ -6299,7 +6509,7 @@ function EnterArcadePoolSheet({
|
|
|
6299
6509
|
const t = useDubsTheme();
|
|
6300
6510
|
const { wallet } = useDubs();
|
|
6301
6511
|
const mutation = useEnterArcadePool();
|
|
6302
|
-
const overlayOpacity =
|
|
6512
|
+
const overlayOpacity = useRef12(new Animated6.Value(0)).current;
|
|
6303
6513
|
useEffect19(() => {
|
|
6304
6514
|
Animated6.timing(overlayOpacity, {
|
|
6305
6515
|
toValue: visible ? 1 : 0,
|
|
@@ -6333,7 +6543,7 @@ function EnterArcadePoolSheet({
|
|
|
6333
6543
|
const potSol = (pool.buy_in_lamports * Number(totalBuyIns) / 1e9).toFixed(4);
|
|
6334
6544
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
6335
6545
|
const canJoin = !isMutating && mutation.status !== "success";
|
|
6336
|
-
const handleJoin =
|
|
6546
|
+
const handleJoin = useCallback27(async () => {
|
|
6337
6547
|
if (!wallet.publicKey) return;
|
|
6338
6548
|
try {
|
|
6339
6549
|
await mutation.execute(pool.id);
|
|
@@ -6345,7 +6555,7 @@ function EnterArcadePoolSheet({
|
|
|
6345
6555
|
const headerTitle = isRejoin ? "Play Again" : "Join Pool";
|
|
6346
6556
|
const ctaLabel = isRejoin ? `Play Again \u2014 ${buyInSol} SOL` : `Join Pool \u2014 ${buyInSol} SOL`;
|
|
6347
6557
|
const successLabel = isRejoin ? "Lives refilled!" : "Joined!";
|
|
6348
|
-
return /* @__PURE__ */
|
|
6558
|
+
return /* @__PURE__ */ jsxs17(
|
|
6349
6559
|
Modal5,
|
|
6350
6560
|
{
|
|
6351
6561
|
visible,
|
|
@@ -6353,68 +6563,68 @@ function EnterArcadePoolSheet({
|
|
|
6353
6563
|
transparent: true,
|
|
6354
6564
|
onRequestClose: onDismiss,
|
|
6355
6565
|
children: [
|
|
6356
|
-
/* @__PURE__ */
|
|
6357
|
-
/* @__PURE__ */
|
|
6566
|
+
/* @__PURE__ */ jsx20(Animated6.View, { style: [styles17.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx20(TouchableOpacity13, { style: styles17.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6567
|
+
/* @__PURE__ */ jsx20(
|
|
6358
6568
|
KeyboardAvoidingView6,
|
|
6359
6569
|
{
|
|
6360
|
-
style:
|
|
6361
|
-
behavior:
|
|
6362
|
-
children: /* @__PURE__ */
|
|
6363
|
-
/* @__PURE__ */
|
|
6364
|
-
/* @__PURE__ */
|
|
6365
|
-
/* @__PURE__ */
|
|
6366
|
-
/* @__PURE__ */
|
|
6570
|
+
style: styles17.keyboardView,
|
|
6571
|
+
behavior: Platform10.OS === "ios" ? "padding" : void 0,
|
|
6572
|
+
children: /* @__PURE__ */ jsx20(View17, { style: styles17.sheetPositioner, children: /* @__PURE__ */ jsxs17(View17, { style: [styles17.sheet, { backgroundColor: t.background }], children: [
|
|
6573
|
+
/* @__PURE__ */ jsx20(View17, { style: styles17.handleRow, children: /* @__PURE__ */ jsx20(View17, { style: [styles17.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6574
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.header, children: [
|
|
6575
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.headerTitle, { color: t.text }], children: headerTitle }),
|
|
6576
|
+
/* @__PURE__ */ jsx20(TouchableOpacity13, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx20(Text18, { style: [styles17.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6367
6577
|
] }),
|
|
6368
|
-
/* @__PURE__ */
|
|
6369
|
-
/* @__PURE__ */
|
|
6370
|
-
/* @__PURE__ */
|
|
6371
|
-
/* @__PURE__ */
|
|
6372
|
-
/* @__PURE__ */
|
|
6578
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.poolName, { color: t.textSecondary }], children: pool.name }),
|
|
6579
|
+
/* @__PURE__ */ jsxs17(View17, { style: [styles17.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6580
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.summaryRow, children: [
|
|
6581
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
6582
|
+
/* @__PURE__ */ jsxs17(Text18, { style: [styles17.summaryValue, { color: t.text }], children: [
|
|
6373
6583
|
buyInSol,
|
|
6374
6584
|
" SOL"
|
|
6375
6585
|
] })
|
|
6376
6586
|
] }),
|
|
6377
|
-
/* @__PURE__ */
|
|
6378
|
-
/* @__PURE__ */
|
|
6379
|
-
/* @__PURE__ */
|
|
6380
|
-
/* @__PURE__ */
|
|
6587
|
+
/* @__PURE__ */ jsx20(View17, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6588
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.summaryRow, children: [
|
|
6589
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
6590
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryValue, { color: t.text }], children: totalPlayers })
|
|
6381
6591
|
] }),
|
|
6382
|
-
/* @__PURE__ */
|
|
6383
|
-
/* @__PURE__ */
|
|
6384
|
-
/* @__PURE__ */
|
|
6385
|
-
/* @__PURE__ */
|
|
6592
|
+
/* @__PURE__ */ jsx20(View17, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6593
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.summaryRow, children: [
|
|
6594
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
6595
|
+
/* @__PURE__ */ jsxs17(Text18, { style: [styles17.summaryValue, { color: t.success }], children: [
|
|
6386
6596
|
potSol,
|
|
6387
6597
|
" SOL"
|
|
6388
6598
|
] })
|
|
6389
6599
|
] }),
|
|
6390
|
-
/* @__PURE__ */
|
|
6391
|
-
/* @__PURE__ */
|
|
6392
|
-
/* @__PURE__ */
|
|
6393
|
-
/* @__PURE__ */
|
|
6600
|
+
/* @__PURE__ */ jsx20(View17, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6601
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.summaryRow, children: [
|
|
6602
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Lives" }),
|
|
6603
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryValue, { color: t.text }], children: pool.max_lives })
|
|
6394
6604
|
] }),
|
|
6395
|
-
topScore > 0 && /* @__PURE__ */
|
|
6396
|
-
/* @__PURE__ */
|
|
6397
|
-
/* @__PURE__ */
|
|
6398
|
-
/* @__PURE__ */
|
|
6399
|
-
/* @__PURE__ */
|
|
6605
|
+
topScore > 0 && /* @__PURE__ */ jsxs17(Fragment6, { children: [
|
|
6606
|
+
/* @__PURE__ */ jsx20(View17, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6607
|
+
/* @__PURE__ */ jsxs17(View17, { style: styles17.summaryRow, children: [
|
|
6608
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Top score" }),
|
|
6609
|
+
/* @__PURE__ */ jsx20(Text18, { style: [styles17.summaryValue, { color: t.text }], children: topScore })
|
|
6400
6610
|
] })
|
|
6401
6611
|
] })
|
|
6402
6612
|
] }),
|
|
6403
|
-
mutation.error && /* @__PURE__ */
|
|
6404
|
-
/* @__PURE__ */
|
|
6613
|
+
mutation.error && /* @__PURE__ */ jsx20(View17, { style: [styles17.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx20(Text18, { style: [styles17.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
6614
|
+
/* @__PURE__ */ jsx20(
|
|
6405
6615
|
TouchableOpacity13,
|
|
6406
6616
|
{
|
|
6407
6617
|
style: [
|
|
6408
|
-
|
|
6618
|
+
styles17.ctaButton,
|
|
6409
6619
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
6410
6620
|
],
|
|
6411
6621
|
disabled: !canJoin,
|
|
6412
6622
|
onPress: handleJoin,
|
|
6413
6623
|
activeOpacity: 0.8,
|
|
6414
|
-
children: isMutating ? /* @__PURE__ */
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6417
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */
|
|
6624
|
+
children: isMutating ? /* @__PURE__ */ jsxs17(View17, { style: styles17.ctaLoading, children: [
|
|
6625
|
+
/* @__PURE__ */ jsx20(ActivityIndicator10, { size: "small", color: "#FFFFFF" }),
|
|
6626
|
+
/* @__PURE__ */ jsx20(Text18, { style: styles17.ctaText, children: statusLabel })
|
|
6627
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ jsx20(Text18, { style: styles17.ctaText, children: successLabel }) : /* @__PURE__ */ jsx20(Text18, { style: [styles17.ctaText, !canJoin && { opacity: 0.5 }], children: ctaLabel })
|
|
6418
6628
|
}
|
|
6419
6629
|
)
|
|
6420
6630
|
] }) })
|
|
@@ -6424,9 +6634,9 @@ function EnterArcadePoolSheet({
|
|
|
6424
6634
|
}
|
|
6425
6635
|
);
|
|
6426
6636
|
}
|
|
6427
|
-
var
|
|
6637
|
+
var styles17 = StyleSheet18.create({
|
|
6428
6638
|
overlay: {
|
|
6429
|
-
...
|
|
6639
|
+
...StyleSheet18.absoluteFillObject,
|
|
6430
6640
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6431
6641
|
},
|
|
6432
6642
|
overlayTap: { flex: 1 },
|
|
@@ -6484,25 +6694,25 @@ var styles16 = StyleSheet17.create({
|
|
|
6484
6694
|
});
|
|
6485
6695
|
|
|
6486
6696
|
// src/ui/game/ArcadeLeaderboardSheet.tsx
|
|
6487
|
-
import { useEffect as useEffect20, useRef as
|
|
6697
|
+
import { useEffect as useEffect20, useRef as useRef13 } from "react";
|
|
6488
6698
|
import {
|
|
6489
|
-
View as
|
|
6490
|
-
Text as
|
|
6699
|
+
View as View18,
|
|
6700
|
+
Text as Text19,
|
|
6491
6701
|
TouchableOpacity as TouchableOpacity14,
|
|
6492
6702
|
Modal as Modal6,
|
|
6493
6703
|
Animated as Animated7,
|
|
6494
|
-
StyleSheet as
|
|
6704
|
+
StyleSheet as StyleSheet19,
|
|
6495
6705
|
KeyboardAvoidingView as KeyboardAvoidingView7,
|
|
6496
|
-
Platform as
|
|
6706
|
+
Platform as Platform11,
|
|
6497
6707
|
Image as Image7,
|
|
6498
6708
|
FlatList
|
|
6499
6709
|
} from "react-native";
|
|
6500
|
-
import { jsx as
|
|
6710
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
6501
6711
|
function RankLabel({ index }) {
|
|
6502
|
-
if (index === 0) return /* @__PURE__ */
|
|
6503
|
-
if (index === 1) return /* @__PURE__ */
|
|
6504
|
-
if (index === 2) return /* @__PURE__ */
|
|
6505
|
-
return /* @__PURE__ */
|
|
6712
|
+
if (index === 0) return /* @__PURE__ */ jsx21(Text19, { style: styles18.rankEmoji, children: "\u{1F947}" });
|
|
6713
|
+
if (index === 1) return /* @__PURE__ */ jsx21(Text19, { style: styles18.rankEmoji, children: "\u{1F948}" });
|
|
6714
|
+
if (index === 2) return /* @__PURE__ */ jsx21(Text19, { style: styles18.rankEmoji, children: "\u{1F949}" });
|
|
6715
|
+
return /* @__PURE__ */ jsx21(Text19, { style: styles18.rankNum, children: index + 1 });
|
|
6506
6716
|
}
|
|
6507
6717
|
function ArcadeLeaderboardSheet({
|
|
6508
6718
|
visible,
|
|
@@ -6512,7 +6722,7 @@ function ArcadeLeaderboardSheet({
|
|
|
6512
6722
|
}) {
|
|
6513
6723
|
const t = useDubsTheme();
|
|
6514
6724
|
const { pool, leaderboard, stats, loading, refetch } = useArcadePool(poolId);
|
|
6515
|
-
const overlayOpacity =
|
|
6725
|
+
const overlayOpacity = useRef13(new Animated7.Value(0)).current;
|
|
6516
6726
|
useEffect20(() => {
|
|
6517
6727
|
Animated7.timing(overlayOpacity, {
|
|
6518
6728
|
toValue: visible ? 1 : 0,
|
|
@@ -6525,32 +6735,32 @@ function ArcadeLeaderboardSheet({
|
|
|
6525
6735
|
}, [visible]);
|
|
6526
6736
|
const renderItem = ({ item, index }) => {
|
|
6527
6737
|
const isMe = highlightWallet && item.wallet_address === highlightWallet;
|
|
6528
|
-
return /* @__PURE__ */
|
|
6529
|
-
|
|
6738
|
+
return /* @__PURE__ */ jsxs18(
|
|
6739
|
+
View18,
|
|
6530
6740
|
{
|
|
6531
6741
|
style: [
|
|
6532
|
-
|
|
6742
|
+
styles18.row,
|
|
6533
6743
|
{ backgroundColor: isMe ? `${t.accent}18` : index % 2 === 0 ? t.surface : "transparent" },
|
|
6534
6744
|
isMe ? { borderWidth: 1, borderColor: t.accent } : void 0
|
|
6535
6745
|
],
|
|
6536
6746
|
children: [
|
|
6537
|
-
/* @__PURE__ */
|
|
6538
|
-
item.avatar ? /* @__PURE__ */
|
|
6539
|
-
/* @__PURE__ */
|
|
6540
|
-
/* @__PURE__ */
|
|
6541
|
-
/* @__PURE__ */
|
|
6747
|
+
/* @__PURE__ */ jsx21(View18, { style: styles18.rankCol, children: /* @__PURE__ */ jsx21(RankLabel, { index }) }),
|
|
6748
|
+
item.avatar ? /* @__PURE__ */ jsx21(Image7, { source: { uri: ensurePngAvatar(item.avatar) }, style: styles18.avatar }) : /* @__PURE__ */ jsx21(View18, { style: [styles18.avatar, { backgroundColor: t.border }] }),
|
|
6749
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.nameCol, children: [
|
|
6750
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.name, { color: t.text }], numberOfLines: 1, children: item.username || `${item.wallet_address.slice(0, 4)}...${item.wallet_address.slice(-4)}` }),
|
|
6751
|
+
/* @__PURE__ */ jsxs18(Text19, { style: [styles18.lives, { color: t.textMuted }], children: [
|
|
6542
6752
|
item.lives_used,
|
|
6543
6753
|
" ",
|
|
6544
6754
|
item.lives_used === 1 ? "life" : "lives",
|
|
6545
6755
|
" used"
|
|
6546
6756
|
] })
|
|
6547
6757
|
] }),
|
|
6548
|
-
/* @__PURE__ */
|
|
6758
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.score, { color: t.accent }], children: item.best_score })
|
|
6549
6759
|
]
|
|
6550
6760
|
}
|
|
6551
6761
|
);
|
|
6552
6762
|
};
|
|
6553
|
-
return /* @__PURE__ */
|
|
6763
|
+
return /* @__PURE__ */ jsxs18(
|
|
6554
6764
|
Modal6,
|
|
6555
6765
|
{
|
|
6556
6766
|
visible,
|
|
@@ -6558,46 +6768,46 @@ function ArcadeLeaderboardSheet({
|
|
|
6558
6768
|
transparent: true,
|
|
6559
6769
|
onRequestClose: onDismiss,
|
|
6560
6770
|
children: [
|
|
6561
|
-
/* @__PURE__ */
|
|
6562
|
-
/* @__PURE__ */
|
|
6771
|
+
/* @__PURE__ */ jsx21(Animated7.View, { style: [styles18.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ jsx21(TouchableOpacity14, { style: styles18.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6772
|
+
/* @__PURE__ */ jsx21(
|
|
6563
6773
|
KeyboardAvoidingView7,
|
|
6564
6774
|
{
|
|
6565
|
-
style:
|
|
6566
|
-
behavior:
|
|
6567
|
-
children: /* @__PURE__ */
|
|
6568
|
-
/* @__PURE__ */
|
|
6569
|
-
/* @__PURE__ */
|
|
6570
|
-
/* @__PURE__ */
|
|
6571
|
-
/* @__PURE__ */
|
|
6572
|
-
pool && /* @__PURE__ */
|
|
6775
|
+
style: styles18.keyboardView,
|
|
6776
|
+
behavior: Platform11.OS === "ios" ? "padding" : void 0,
|
|
6777
|
+
children: /* @__PURE__ */ jsx21(View18, { style: styles18.sheetPositioner, children: /* @__PURE__ */ jsxs18(View18, { style: [styles18.sheet, { backgroundColor: t.background }], children: [
|
|
6778
|
+
/* @__PURE__ */ jsx21(View18, { style: styles18.handleRow, children: /* @__PURE__ */ jsx21(View18, { style: [styles18.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6779
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.header, children: [
|
|
6780
|
+
/* @__PURE__ */ jsxs18(View18, { children: [
|
|
6781
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.headerTitle, { color: t.text }], children: "Leaderboard" }),
|
|
6782
|
+
pool && /* @__PURE__ */ jsx21(Text19, { style: [styles18.poolName, { color: t.textMuted }], children: pool.name })
|
|
6573
6783
|
] }),
|
|
6574
|
-
/* @__PURE__ */
|
|
6784
|
+
/* @__PURE__ */ jsx21(TouchableOpacity14, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx21(Text19, { style: [styles18.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6575
6785
|
] }),
|
|
6576
|
-
stats && /* @__PURE__ */
|
|
6577
|
-
/* @__PURE__ */
|
|
6578
|
-
/* @__PURE__ */
|
|
6579
|
-
/* @__PURE__ */
|
|
6786
|
+
stats && /* @__PURE__ */ jsxs18(View18, { style: [styles18.statsBar, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6787
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.statItem, children: [
|
|
6788
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statValue, { color: t.text }], children: stats.total_entries }),
|
|
6789
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statLabel, { color: t.textMuted }], children: "Players" })
|
|
6580
6790
|
] }),
|
|
6581
|
-
/* @__PURE__ */
|
|
6582
|
-
/* @__PURE__ */
|
|
6583
|
-
/* @__PURE__ */
|
|
6584
|
-
/* @__PURE__ */
|
|
6791
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.statDivider, { backgroundColor: t.border }] }),
|
|
6792
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.statItem, children: [
|
|
6793
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statValue, { color: t.accent }], children: stats.top_score }),
|
|
6794
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statLabel, { color: t.textMuted }], children: "Top Score" })
|
|
6585
6795
|
] }),
|
|
6586
|
-
/* @__PURE__ */
|
|
6587
|
-
/* @__PURE__ */
|
|
6588
|
-
/* @__PURE__ */
|
|
6589
|
-
/* @__PURE__ */
|
|
6796
|
+
/* @__PURE__ */ jsx21(View18, { style: [styles18.statDivider, { backgroundColor: t.border }] }),
|
|
6797
|
+
/* @__PURE__ */ jsxs18(View18, { style: styles18.statItem, children: [
|
|
6798
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statValue, { color: t.text }], children: Math.round(stats.avg_score) }),
|
|
6799
|
+
/* @__PURE__ */ jsx21(Text19, { style: [styles18.statLabel, { color: t.textMuted }], children: "Avg Score" })
|
|
6590
6800
|
] })
|
|
6591
6801
|
] }),
|
|
6592
|
-
/* @__PURE__ */
|
|
6802
|
+
/* @__PURE__ */ jsx21(
|
|
6593
6803
|
FlatList,
|
|
6594
6804
|
{
|
|
6595
6805
|
data: leaderboard,
|
|
6596
6806
|
renderItem,
|
|
6597
6807
|
keyExtractor: (item) => String(item.id),
|
|
6598
|
-
style:
|
|
6599
|
-
contentContainerStyle:
|
|
6600
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
6808
|
+
style: styles18.list,
|
|
6809
|
+
contentContainerStyle: styles18.listContent,
|
|
6810
|
+
ListEmptyComponent: /* @__PURE__ */ jsx21(View18, { style: styles18.emptyState, children: /* @__PURE__ */ jsx21(Text19, { style: [styles18.emptyText, { color: t.textMuted }], children: loading ? "Loading..." : "No scores yet" }) })
|
|
6601
6811
|
}
|
|
6602
6812
|
)
|
|
6603
6813
|
] }) })
|
|
@@ -6607,9 +6817,9 @@ function ArcadeLeaderboardSheet({
|
|
|
6607
6817
|
}
|
|
6608
6818
|
);
|
|
6609
6819
|
}
|
|
6610
|
-
var
|
|
6820
|
+
var styles18 = StyleSheet19.create({
|
|
6611
6821
|
overlay: {
|
|
6612
|
-
...
|
|
6822
|
+
...StyleSheet19.absoluteFillObject,
|
|
6613
6823
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6614
6824
|
},
|
|
6615
6825
|
overlayTap: { flex: 1 },
|
|
@@ -6691,6 +6901,7 @@ export {
|
|
|
6691
6901
|
SOLANA_PROGRAM_ERRORS,
|
|
6692
6902
|
STORAGE_KEYS,
|
|
6693
6903
|
SettingsSheet,
|
|
6904
|
+
SolSlider,
|
|
6694
6905
|
UserProfileCard,
|
|
6695
6906
|
UserProfileSheet,
|
|
6696
6907
|
createSecureStoreStorage,
|