@dubsdotapp/expo 0.5.7 → 0.5.8
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.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +516 -279
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +487 -245
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/ui/game/JoinGameSheet.tsx +46 -15
- package/src/ui/game/SolSlider.tsx +259 -0
- package/src/ui/game/index.ts +2 -0
- package/src/ui/index.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ __export(index_exports, {
|
|
|
55
55
|
SOLANA_PROGRAM_ERRORS: () => SOLANA_PROGRAM_ERRORS,
|
|
56
56
|
STORAGE_KEYS: () => STORAGE_KEYS,
|
|
57
57
|
SettingsSheet: () => SettingsSheet,
|
|
58
|
+
SolSlider: () => SolSlider,
|
|
58
59
|
UserProfileCard: () => UserProfileCard,
|
|
59
60
|
UserProfileSheet: () => UserProfileSheet,
|
|
60
61
|
createSecureStoreStorage: () => createSecureStoreStorage,
|
|
@@ -5341,9 +5342,222 @@ var styles12 = import_react_native18.StyleSheet.create({
|
|
|
5341
5342
|
});
|
|
5342
5343
|
|
|
5343
5344
|
// src/ui/game/JoinGameSheet.tsx
|
|
5345
|
+
var import_react34 = require("react");
|
|
5346
|
+
var import_react_native20 = require("react-native");
|
|
5347
|
+
|
|
5348
|
+
// src/ui/game/SolSlider.tsx
|
|
5344
5349
|
var import_react33 = require("react");
|
|
5345
5350
|
var import_react_native19 = require("react-native");
|
|
5346
5351
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5352
|
+
var THUMB_SIZE = 32;
|
|
5353
|
+
var TRACK_HEIGHT = 6;
|
|
5354
|
+
var TICK_INTERVAL = 0.01;
|
|
5355
|
+
function SolSlider({
|
|
5356
|
+
value,
|
|
5357
|
+
min = 0.01,
|
|
5358
|
+
max = 5,
|
|
5359
|
+
step = 0.01,
|
|
5360
|
+
accentColor,
|
|
5361
|
+
onValueChange,
|
|
5362
|
+
onSlidingComplete,
|
|
5363
|
+
onTick,
|
|
5364
|
+
disabled = false
|
|
5365
|
+
}) {
|
|
5366
|
+
const t = useDubsTheme();
|
|
5367
|
+
const accent = accentColor || t.accent;
|
|
5368
|
+
const trackRef = (0, import_react33.useRef)(null);
|
|
5369
|
+
const trackWidth = (0, import_react33.useRef)(0);
|
|
5370
|
+
const lastTickValue = (0, import_react33.useRef)(value);
|
|
5371
|
+
const clamp = (v) => {
|
|
5372
|
+
const stepped = Math.round(v / step) * step;
|
|
5373
|
+
return Math.max(min, Math.min(max, parseFloat(stepped.toFixed(4))));
|
|
5374
|
+
};
|
|
5375
|
+
const valueToPosition = (v) => {
|
|
5376
|
+
const ratio2 = (v - min) / (max - min);
|
|
5377
|
+
return ratio2 * trackWidth.current;
|
|
5378
|
+
};
|
|
5379
|
+
const positionToValue = (x) => {
|
|
5380
|
+
const ratio2 = Math.max(0, Math.min(1, x / trackWidth.current));
|
|
5381
|
+
return clamp(min + ratio2 * (max - min));
|
|
5382
|
+
};
|
|
5383
|
+
const panResponder = (0, import_react33.useRef)(
|
|
5384
|
+
import_react_native19.PanResponder.create({
|
|
5385
|
+
onStartShouldSetPanResponder: () => !disabled,
|
|
5386
|
+
onMoveShouldSetPanResponder: () => !disabled,
|
|
5387
|
+
onPanResponderGrant: (_, gestureState) => {
|
|
5388
|
+
lastTickValue.current = value;
|
|
5389
|
+
},
|
|
5390
|
+
onPanResponderMove: (evt, gestureState) => {
|
|
5391
|
+
const touchX = gestureState.moveX;
|
|
5392
|
+
trackRef.current?.measureInWindow((trackX) => {
|
|
5393
|
+
const relX = touchX - trackX;
|
|
5394
|
+
const newVal = positionToValue(relX);
|
|
5395
|
+
const tickDelta = Math.abs(newVal - lastTickValue.current);
|
|
5396
|
+
if (tickDelta >= TICK_INTERVAL) {
|
|
5397
|
+
lastTickValue.current = newVal;
|
|
5398
|
+
onTick?.(newVal);
|
|
5399
|
+
}
|
|
5400
|
+
onValueChange(newVal);
|
|
5401
|
+
});
|
|
5402
|
+
},
|
|
5403
|
+
onPanResponderRelease: () => {
|
|
5404
|
+
onSlidingComplete?.(value);
|
|
5405
|
+
}
|
|
5406
|
+
})
|
|
5407
|
+
).current;
|
|
5408
|
+
const ratio = (value - min) / (max - min);
|
|
5409
|
+
const filledWidth = `${ratio * 100}%`;
|
|
5410
|
+
const markers = [min, max * 0.25, max * 0.5, max * 0.75, max];
|
|
5411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.container, children: [
|
|
5412
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.valueRow, children: [
|
|
5413
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.valueText, { color: accent }], children: parseFloat(value.toFixed(4)) }),
|
|
5414
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.solLabel, { color: accent }], children: "SOL" })
|
|
5415
|
+
] }),
|
|
5416
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5417
|
+
import_react_native19.View,
|
|
5418
|
+
{
|
|
5419
|
+
ref: trackRef,
|
|
5420
|
+
style: styles13.trackContainer,
|
|
5421
|
+
onLayout: (e) => {
|
|
5422
|
+
trackWidth.current = e.nativeEvent.layout.width;
|
|
5423
|
+
},
|
|
5424
|
+
...panResponder.panHandlers,
|
|
5425
|
+
children: [
|
|
5426
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.track, { backgroundColor: "#2C2C2E" }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.trackFilled, { width: filledWidth, backgroundColor: accent }] }) }),
|
|
5427
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.markerRow, children: markers.map((m, i) => {
|
|
5428
|
+
const mRatio = (m - min) / (max - min);
|
|
5429
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5430
|
+
import_react_native19.View,
|
|
5431
|
+
{
|
|
5432
|
+
style: [
|
|
5433
|
+
styles13.marker,
|
|
5434
|
+
{
|
|
5435
|
+
left: `${mRatio * 100}%`,
|
|
5436
|
+
backgroundColor: value >= m ? accent : "#3A3A3C"
|
|
5437
|
+
}
|
|
5438
|
+
]
|
|
5439
|
+
},
|
|
5440
|
+
i
|
|
5441
|
+
);
|
|
5442
|
+
}) }),
|
|
5443
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5444
|
+
import_react_native19.View,
|
|
5445
|
+
{
|
|
5446
|
+
style: [
|
|
5447
|
+
styles13.thumb,
|
|
5448
|
+
{
|
|
5449
|
+
left: filledWidth,
|
|
5450
|
+
backgroundColor: accent,
|
|
5451
|
+
shadowColor: accent
|
|
5452
|
+
}
|
|
5453
|
+
],
|
|
5454
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.thumbInner })
|
|
5455
|
+
}
|
|
5456
|
+
)
|
|
5457
|
+
]
|
|
5458
|
+
}
|
|
5459
|
+
),
|
|
5460
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.rangeRow, children: [
|
|
5461
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.rangeText, children: min }),
|
|
5462
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: styles13.rangeText, children: [
|
|
5463
|
+
max,
|
|
5464
|
+
" SOL"
|
|
5465
|
+
] })
|
|
5466
|
+
] })
|
|
5467
|
+
] });
|
|
5468
|
+
}
|
|
5469
|
+
var styles13 = import_react_native19.StyleSheet.create({
|
|
5470
|
+
container: {
|
|
5471
|
+
paddingVertical: 8
|
|
5472
|
+
},
|
|
5473
|
+
valueRow: {
|
|
5474
|
+
flexDirection: "row",
|
|
5475
|
+
alignItems: "baseline",
|
|
5476
|
+
justifyContent: "center",
|
|
5477
|
+
marginBottom: 16,
|
|
5478
|
+
gap: 4
|
|
5479
|
+
},
|
|
5480
|
+
valueText: {
|
|
5481
|
+
fontSize: 36,
|
|
5482
|
+
fontWeight: "900",
|
|
5483
|
+
letterSpacing: -1,
|
|
5484
|
+
fontVariant: ["tabular-nums"]
|
|
5485
|
+
},
|
|
5486
|
+
solLabel: {
|
|
5487
|
+
fontSize: 16,
|
|
5488
|
+
fontWeight: "700",
|
|
5489
|
+
opacity: 0.6
|
|
5490
|
+
},
|
|
5491
|
+
trackContainer: {
|
|
5492
|
+
height: THUMB_SIZE + 16,
|
|
5493
|
+
justifyContent: "center",
|
|
5494
|
+
paddingHorizontal: THUMB_SIZE / 2
|
|
5495
|
+
},
|
|
5496
|
+
track: {
|
|
5497
|
+
height: TRACK_HEIGHT,
|
|
5498
|
+
borderRadius: TRACK_HEIGHT / 2,
|
|
5499
|
+
overflow: "hidden"
|
|
5500
|
+
},
|
|
5501
|
+
trackFilled: {
|
|
5502
|
+
height: "100%",
|
|
5503
|
+
borderRadius: TRACK_HEIGHT / 2
|
|
5504
|
+
},
|
|
5505
|
+
markerRow: {
|
|
5506
|
+
position: "absolute",
|
|
5507
|
+
left: THUMB_SIZE / 2,
|
|
5508
|
+
right: THUMB_SIZE / 2,
|
|
5509
|
+
height: TRACK_HEIGHT,
|
|
5510
|
+
top: (THUMB_SIZE + 16 - TRACK_HEIGHT) / 2
|
|
5511
|
+
},
|
|
5512
|
+
marker: {
|
|
5513
|
+
position: "absolute",
|
|
5514
|
+
width: 3,
|
|
5515
|
+
height: 12,
|
|
5516
|
+
borderRadius: 1.5,
|
|
5517
|
+
top: -3,
|
|
5518
|
+
marginLeft: -1.5
|
|
5519
|
+
},
|
|
5520
|
+
thumb: {
|
|
5521
|
+
position: "absolute",
|
|
5522
|
+
width: THUMB_SIZE,
|
|
5523
|
+
height: THUMB_SIZE,
|
|
5524
|
+
borderRadius: THUMB_SIZE / 2,
|
|
5525
|
+
top: 8,
|
|
5526
|
+
marginLeft: 0,
|
|
5527
|
+
alignItems: "center",
|
|
5528
|
+
justifyContent: "center",
|
|
5529
|
+
...import_react_native19.Platform.select({
|
|
5530
|
+
ios: {
|
|
5531
|
+
shadowOffset: { width: 0, height: 0 },
|
|
5532
|
+
shadowOpacity: 0.6,
|
|
5533
|
+
shadowRadius: 10
|
|
5534
|
+
},
|
|
5535
|
+
android: {
|
|
5536
|
+
elevation: 8
|
|
5537
|
+
}
|
|
5538
|
+
})
|
|
5539
|
+
},
|
|
5540
|
+
thumbInner: {
|
|
5541
|
+
width: 12,
|
|
5542
|
+
height: 12,
|
|
5543
|
+
borderRadius: 6,
|
|
5544
|
+
backgroundColor: "#FFFFFF"
|
|
5545
|
+
},
|
|
5546
|
+
rangeRow: {
|
|
5547
|
+
flexDirection: "row",
|
|
5548
|
+
justifyContent: "space-between",
|
|
5549
|
+
paddingHorizontal: THUMB_SIZE / 2,
|
|
5550
|
+
marginTop: 4
|
|
5551
|
+
},
|
|
5552
|
+
rangeText: {
|
|
5553
|
+
color: "#5A5A5E",
|
|
5554
|
+
fontSize: 11,
|
|
5555
|
+
fontWeight: "600"
|
|
5556
|
+
}
|
|
5557
|
+
});
|
|
5558
|
+
|
|
5559
|
+
// src/ui/game/JoinGameSheet.tsx
|
|
5560
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5347
5561
|
var STATUS_LABELS3 = {
|
|
5348
5562
|
building: "Building transaction...",
|
|
5349
5563
|
signing: "Approve in wallet...",
|
|
@@ -5370,51 +5584,55 @@ function JoinGameSheet({
|
|
|
5370
5584
|
onError,
|
|
5371
5585
|
onTeamSelect,
|
|
5372
5586
|
onJoinSuccess,
|
|
5587
|
+
onSliderTick,
|
|
5588
|
+
maxWager = 5,
|
|
5373
5589
|
isPoolModeEnabled = false
|
|
5374
5590
|
}) {
|
|
5375
5591
|
const t = useDubsTheme();
|
|
5376
5592
|
const { wallet } = useDubs();
|
|
5377
5593
|
const mutation = useJoinGame();
|
|
5378
5594
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
5379
|
-
const [selectedTeam, setSelectedTeam] = (0,
|
|
5380
|
-
const [
|
|
5381
|
-
const
|
|
5382
|
-
const
|
|
5383
|
-
const
|
|
5384
|
-
(0,
|
|
5385
|
-
|
|
5595
|
+
const [selectedTeam, setSelectedTeam] = (0, import_react34.useState)(null);
|
|
5596
|
+
const [wager, setWager] = (0, import_react34.useState)(game.buyIn);
|
|
5597
|
+
const [showSuccess, setShowSuccess] = (0, import_react34.useState)(false);
|
|
5598
|
+
const overlayOpacity = (0, import_react34.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5599
|
+
const successScale = (0, import_react34.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5600
|
+
const successOpacity = (0, import_react34.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5601
|
+
(0, import_react34.useEffect)(() => {
|
|
5602
|
+
import_react_native20.Animated.timing(overlayOpacity, {
|
|
5386
5603
|
toValue: visible ? 1 : 0,
|
|
5387
5604
|
duration: 250,
|
|
5388
5605
|
useNativeDriver: true
|
|
5389
5606
|
}).start();
|
|
5390
5607
|
}, [visible, overlayOpacity]);
|
|
5391
|
-
(0,
|
|
5608
|
+
(0, import_react34.useEffect)(() => {
|
|
5392
5609
|
if (visible) {
|
|
5393
5610
|
setSelectedTeam(isPoolModeEnabled ? "home" : isCustomGame ? "away" : null);
|
|
5611
|
+
setWager(game.buyIn);
|
|
5394
5612
|
setShowSuccess(false);
|
|
5395
5613
|
successScale.setValue(0);
|
|
5396
5614
|
successOpacity.setValue(0);
|
|
5397
5615
|
mutation.reset();
|
|
5398
5616
|
}
|
|
5399
5617
|
}, [visible]);
|
|
5400
|
-
(0,
|
|
5618
|
+
(0, import_react34.useEffect)(() => {
|
|
5401
5619
|
if (mutation.status === "success" && mutation.data) {
|
|
5402
5620
|
setShowSuccess(true);
|
|
5403
5621
|
onSuccess?.(mutation.data);
|
|
5404
5622
|
onJoinSuccess?.(mutation.data);
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5623
|
+
import_react_native20.Animated.parallel([
|
|
5624
|
+
import_react_native20.Animated.spring(successScale, { toValue: 1, friction: 4, tension: 80, useNativeDriver: true }),
|
|
5625
|
+
import_react_native20.Animated.timing(successOpacity, { toValue: 1, duration: 300, useNativeDriver: true })
|
|
5408
5626
|
]).start();
|
|
5409
5627
|
const timer = setTimeout(() => {
|
|
5410
|
-
|
|
5628
|
+
import_react_native20.Animated.timing(successOpacity, { toValue: 0, duration: 300, useNativeDriver: true }).start(() => {
|
|
5411
5629
|
onDismiss();
|
|
5412
5630
|
});
|
|
5413
5631
|
}, 2500);
|
|
5414
5632
|
return () => clearTimeout(timer);
|
|
5415
5633
|
}
|
|
5416
5634
|
}, [mutation.status, mutation.data]);
|
|
5417
|
-
(0,
|
|
5635
|
+
(0, import_react34.useEffect)(() => {
|
|
5418
5636
|
if (mutation.status === "error" && mutation.error) {
|
|
5419
5637
|
onError?.(mutation.error);
|
|
5420
5638
|
}
|
|
@@ -5425,89 +5643,92 @@ function JoinGameSheet({
|
|
|
5425
5643
|
const homePool = game.homePool || 0;
|
|
5426
5644
|
const awayPool = game.awayPool || 0;
|
|
5427
5645
|
const buyIn = game.buyIn;
|
|
5428
|
-
const
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5646
|
+
const poolAfterJoin = totalPool + wager;
|
|
5647
|
+
const { homeOdds, awayOdds, homeBets, awayBets } = (0, import_react34.useMemo)(() => {
|
|
5648
|
+
const newPool = totalPool + wager;
|
|
5649
|
+
return {
|
|
5650
|
+
homeOdds: homePool > 0 ? (newPool / (homePool + (selectedTeam === "home" ? wager : 0))).toFixed(2) : "\u2014",
|
|
5651
|
+
awayOdds: awayPool > 0 ? (newPool / (awayPool + (selectedTeam === "away" ? wager : 0))).toFixed(2) : "\u2014",
|
|
5652
|
+
homeBets: bettors.filter((b) => b.team === "home").length,
|
|
5653
|
+
awayBets: bettors.filter((b) => b.team === "away").length
|
|
5654
|
+
};
|
|
5655
|
+
}, [totalPool, homePool, awayPool, bettors, wager, selectedTeam]);
|
|
5435
5656
|
const selectedOdds = selectedTeam === "home" ? homeOdds : selectedTeam === "away" ? awayOdds : "\u2014";
|
|
5436
|
-
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) *
|
|
5657
|
+
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
|
|
5437
5658
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
5438
5659
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
5439
5660
|
const selectedName = selectedTeam === "home" ? homeName : selectedTeam === "away" ? awayName : "\u2014";
|
|
5440
|
-
const alreadyJoined = (0,
|
|
5661
|
+
const alreadyJoined = (0, import_react34.useMemo)(() => {
|
|
5441
5662
|
if (!wallet.publicKey) return false;
|
|
5442
5663
|
const addr = wallet.publicKey.toBase58();
|
|
5443
5664
|
return bettors.some((b) => b.wallet === addr);
|
|
5444
5665
|
}, [bettors, wallet.publicKey]);
|
|
5445
5666
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5446
5667
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
|
|
5447
|
-
const handleJoin = (0,
|
|
5668
|
+
const handleJoin = (0, import_react34.useCallback)(async () => {
|
|
5448
5669
|
if (!selectedTeam || !wallet.publicKey) return;
|
|
5449
5670
|
try {
|
|
5450
5671
|
await mutation.execute({
|
|
5451
5672
|
playerWallet: wallet.publicKey.toBase58(),
|
|
5452
5673
|
gameId: game.gameId,
|
|
5453
5674
|
teamChoice: selectedTeam,
|
|
5454
|
-
amount:
|
|
5675
|
+
amount: wager
|
|
5455
5676
|
});
|
|
5456
5677
|
} catch {
|
|
5457
5678
|
}
|
|
5458
|
-
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId,
|
|
5679
|
+
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, wager]);
|
|
5459
5680
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
5460
|
-
return /* @__PURE__ */ (0,
|
|
5461
|
-
|
|
5681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5682
|
+
import_react_native20.Modal,
|
|
5462
5683
|
{
|
|
5463
5684
|
visible,
|
|
5464
5685
|
animationType: "slide",
|
|
5465
5686
|
transparent: true,
|
|
5466
5687
|
onRequestClose: onDismiss,
|
|
5467
5688
|
children: [
|
|
5468
|
-
/* @__PURE__ */ (0,
|
|
5469
|
-
showSuccess && /* @__PURE__ */ (0,
|
|
5470
|
-
/* @__PURE__ */ (0,
|
|
5471
|
-
/* @__PURE__ */ (0,
|
|
5472
|
-
/* @__PURE__ */ (0,
|
|
5689
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Animated.View, { style: [styles14.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.TouchableOpacity, { style: styles14.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5690
|
+
showSuccess && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.successOverlay, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Animated.View, { style: [styles14.successContent, { opacity: successOpacity, transform: [{ scale: successScale }] }], children: [
|
|
5691
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.successEmoji, children: "\u{1F389}" }),
|
|
5692
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.successTitle, children: "You're in!" }),
|
|
5693
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: styles14.successSub, children: [
|
|
5473
5694
|
formatSol(buyIn),
|
|
5474
5695
|
" SOL on ",
|
|
5475
5696
|
selectedName
|
|
5476
5697
|
] })
|
|
5477
5698
|
] }) }),
|
|
5478
|
-
/* @__PURE__ */ (0,
|
|
5479
|
-
|
|
5699
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5700
|
+
import_react_native20.KeyboardAvoidingView,
|
|
5480
5701
|
{
|
|
5481
|
-
style:
|
|
5482
|
-
behavior:
|
|
5483
|
-
children: /* @__PURE__ */ (0,
|
|
5484
|
-
/* @__PURE__ */ (0,
|
|
5485
|
-
/* @__PURE__ */ (0,
|
|
5486
|
-
/* @__PURE__ */ (0,
|
|
5487
|
-
/* @__PURE__ */ (0,
|
|
5702
|
+
style: styles14.keyboardView,
|
|
5703
|
+
behavior: import_react_native20.Platform.OS === "ios" ? "padding" : void 0,
|
|
5704
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.sheet, { backgroundColor: t.background }], children: [
|
|
5705
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5706
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.header, children: [
|
|
5707
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5488
5709
|
] }),
|
|
5489
|
-
bettors.length > 0 && /* @__PURE__ */ (0,
|
|
5490
|
-
/* @__PURE__ */ (0,
|
|
5710
|
+
bettors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.bettorsSection, children: [
|
|
5711
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.bettorsLabel, { color: t.textMuted }], children: [
|
|
5491
5712
|
bettors.length,
|
|
5492
5713
|
" ",
|
|
5493
5714
|
bettors.length === 1 ? "player" : "players",
|
|
5494
5715
|
" in this game"
|
|
5495
5716
|
] }),
|
|
5496
|
-
/* @__PURE__ */ (0,
|
|
5717
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.bettorsRow, children: [
|
|
5497
5718
|
bettors.slice(0, 6).map((b, i) => {
|
|
5498
5719
|
const pngUrl = toPng(b.avatar);
|
|
5499
|
-
return /* @__PURE__ */ (0,
|
|
5720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.bettorCircle, { backgroundColor: ["#EF4444", "#3B82F6", "#22C55E", "#F59E0B", "#A855F7", "#EC4899"][i % 6] }], children: pngUrl ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Image, { source: { uri: pngUrl }, style: styles14.bettorImg }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.bettorInitial, children: (b.username ?? b.wallet).charAt(0).toUpperCase() }) }, b.wallet);
|
|
5500
5721
|
}),
|
|
5501
|
-
bettors.length > 6 && /* @__PURE__ */ (0,
|
|
5722
|
+
bettors.length > 6 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.bettorCircle, { backgroundColor: "#2C2C2E" }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: styles14.bettorOverflow, children: [
|
|
5502
5723
|
"+",
|
|
5503
5724
|
bettors.length - 6
|
|
5504
5725
|
] }) })
|
|
5505
5726
|
] })
|
|
5506
5727
|
] }),
|
|
5507
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
5508
|
-
/* @__PURE__ */ (0,
|
|
5509
|
-
/* @__PURE__ */ (0,
|
|
5510
|
-
/* @__PURE__ */ (0,
|
|
5728
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.section, children: [
|
|
5729
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5730
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.teamsRow, children: [
|
|
5731
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5511
5732
|
TeamButton,
|
|
5512
5733
|
{
|
|
5513
5734
|
name: homeName,
|
|
@@ -5524,7 +5745,7 @@ function JoinGameSheet({
|
|
|
5524
5745
|
t
|
|
5525
5746
|
}
|
|
5526
5747
|
),
|
|
5527
|
-
/* @__PURE__ */ (0,
|
|
5748
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5528
5749
|
TeamButton,
|
|
5529
5750
|
{
|
|
5530
5751
|
name: awayName,
|
|
@@ -5543,64 +5764,76 @@ function JoinGameSheet({
|
|
|
5543
5764
|
)
|
|
5544
5765
|
] })
|
|
5545
5766
|
] }),
|
|
5546
|
-
/* @__PURE__ */ (0,
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5767
|
+
selectedTeam && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.sliderSection, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5768
|
+
SolSlider,
|
|
5769
|
+
{
|
|
5770
|
+
value: wager,
|
|
5771
|
+
min: game.buyIn,
|
|
5772
|
+
max: maxWager,
|
|
5773
|
+
step: 0.01,
|
|
5774
|
+
accentColor: selectedTeam === "home" ? homeColor : awayColor,
|
|
5775
|
+
onValueChange: setWager,
|
|
5776
|
+
onTick: onSliderTick
|
|
5777
|
+
}
|
|
5778
|
+
) }),
|
|
5779
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5780
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5781
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
5782
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: [
|
|
5783
|
+
formatSol(wager),
|
|
5551
5784
|
" SOL"
|
|
5552
5785
|
] })
|
|
5553
5786
|
] }),
|
|
5554
|
-
/* @__PURE__ */ (0,
|
|
5555
|
-
isPoolModeEnabled ? /* @__PURE__ */ (0,
|
|
5556
|
-
/* @__PURE__ */ (0,
|
|
5557
|
-
/* @__PURE__ */ (0,
|
|
5558
|
-
/* @__PURE__ */ (0,
|
|
5787
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5788
|
+
isPoolModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5789
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5790
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5791
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: bettors.length })
|
|
5559
5792
|
] }),
|
|
5560
|
-
/* @__PURE__ */ (0,
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
5562
|
-
/* @__PURE__ */ (0,
|
|
5563
|
-
/* @__PURE__ */ (0,
|
|
5793
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5794
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5795
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5796
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.success }], children: [
|
|
5564
5797
|
formatSol(totalPool),
|
|
5565
5798
|
" SOL"
|
|
5566
5799
|
] })
|
|
5567
5800
|
] })
|
|
5568
|
-
] }) : /* @__PURE__ */ (0,
|
|
5569
|
-
/* @__PURE__ */ (0,
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
5571
|
-
/* @__PURE__ */ (0,
|
|
5801
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5802
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5803
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5804
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: selectedName })
|
|
5572
5805
|
] }),
|
|
5573
|
-
/* @__PURE__ */ (0,
|
|
5574
|
-
/* @__PURE__ */ (0,
|
|
5575
|
-
/* @__PURE__ */ (0,
|
|
5576
|
-
/* @__PURE__ */ (0,
|
|
5806
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5807
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5808
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5809
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: [
|
|
5577
5810
|
formatSol(poolAfterJoin),
|
|
5578
5811
|
" SOL"
|
|
5579
5812
|
] })
|
|
5580
5813
|
] }),
|
|
5581
|
-
/* @__PURE__ */ (0,
|
|
5582
|
-
/* @__PURE__ */ (0,
|
|
5583
|
-
/* @__PURE__ */ (0,
|
|
5584
|
-
/* @__PURE__ */ (0,
|
|
5814
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5815
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5816
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5817
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5585
5818
|
] })
|
|
5586
5819
|
] })
|
|
5587
5820
|
] }),
|
|
5588
|
-
alreadyJoined && /* @__PURE__ */ (0,
|
|
5589
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5590
|
-
/* @__PURE__ */ (0,
|
|
5591
|
-
|
|
5821
|
+
alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5822
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5823
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5824
|
+
import_react_native20.TouchableOpacity,
|
|
5592
5825
|
{
|
|
5593
5826
|
style: [
|
|
5594
|
-
|
|
5827
|
+
styles14.ctaButton,
|
|
5595
5828
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5596
5829
|
],
|
|
5597
5830
|
disabled: !canJoin,
|
|
5598
5831
|
onPress: handleJoin,
|
|
5599
5832
|
activeOpacity: 0.8,
|
|
5600
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5601
|
-
/* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
5603
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5833
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.ctaLoading, children: [
|
|
5834
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5835
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.ctaText, children: statusLabel })
|
|
5836
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { 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" })
|
|
5604
5837
|
}
|
|
5605
5838
|
)
|
|
5606
5839
|
] }) })
|
|
@@ -5621,35 +5854,35 @@ function TeamButton({
|
|
|
5621
5854
|
ImageComponent,
|
|
5622
5855
|
t
|
|
5623
5856
|
}) {
|
|
5624
|
-
const [imgFailed, setImgFailed] = (0,
|
|
5857
|
+
const [imgFailed, setImgFailed] = (0, import_react34.useState)(false);
|
|
5625
5858
|
const Img = ImageComponent || require("react-native").Image;
|
|
5626
5859
|
const showImage = imageUrl && !imgFailed;
|
|
5627
|
-
return /* @__PURE__ */ (0,
|
|
5628
|
-
|
|
5860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5861
|
+
import_react_native20.TouchableOpacity,
|
|
5629
5862
|
{
|
|
5630
|
-
style: [
|
|
5863
|
+
style: [styles14.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5631
5864
|
onPress,
|
|
5632
5865
|
activeOpacity: 0.7,
|
|
5633
5866
|
children: [
|
|
5634
|
-
showImage ? /* @__PURE__ */ (0,
|
|
5635
|
-
/* @__PURE__ */ (0,
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5867
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Img, { source: { uri: imageUrl }, style: styles14.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.teamLogo, styles14.teamLogoPlaceholder] }),
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5869
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.teamOdds, { color }], children: [
|
|
5637
5870
|
odds,
|
|
5638
5871
|
"x"
|
|
5639
5872
|
] }),
|
|
5640
|
-
/* @__PURE__ */ (0,
|
|
5873
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.teamBets, { color: t.textMuted }], children: [
|
|
5641
5874
|
bets,
|
|
5642
5875
|
" ",
|
|
5643
5876
|
bets === 1 ? "bet" : "bets"
|
|
5644
5877
|
] }),
|
|
5645
|
-
selected && /* @__PURE__ */ (0,
|
|
5878
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.teamBadgeText, children: "Selected" }) })
|
|
5646
5879
|
]
|
|
5647
5880
|
}
|
|
5648
5881
|
);
|
|
5649
5882
|
}
|
|
5650
|
-
var
|
|
5883
|
+
var styles14 = import_react_native20.StyleSheet.create({
|
|
5651
5884
|
overlay: {
|
|
5652
|
-
...
|
|
5885
|
+
...import_react_native20.StyleSheet.absoluteFillObject,
|
|
5653
5886
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5654
5887
|
},
|
|
5655
5888
|
overlayTap: {
|
|
@@ -5732,7 +5965,7 @@ var styles13 = import_react_native19.StyleSheet.create({
|
|
|
5732
5965
|
},
|
|
5733
5966
|
// Success overlay
|
|
5734
5967
|
successOverlay: {
|
|
5735
|
-
...
|
|
5968
|
+
...import_react_native20.StyleSheet.absoluteFillObject,
|
|
5736
5969
|
zIndex: 100,
|
|
5737
5970
|
alignItems: "center",
|
|
5738
5971
|
justifyContent: "center",
|
|
@@ -5766,8 +5999,11 @@ var styles13 = import_react_native19.StyleSheet.create({
|
|
|
5766
5999
|
flexDirection: "row",
|
|
5767
6000
|
gap: 12
|
|
5768
6001
|
},
|
|
6002
|
+
sliderSection: {
|
|
6003
|
+
marginTop: 16
|
|
6004
|
+
},
|
|
5769
6005
|
summaryCard: {
|
|
5770
|
-
marginTop:
|
|
6006
|
+
marginTop: 12,
|
|
5771
6007
|
borderRadius: 16,
|
|
5772
6008
|
borderWidth: 1,
|
|
5773
6009
|
overflow: "hidden"
|
|
@@ -5859,9 +6095,9 @@ var styles13 = import_react_native19.StyleSheet.create({
|
|
|
5859
6095
|
});
|
|
5860
6096
|
|
|
5861
6097
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5862
|
-
var
|
|
5863
|
-
var
|
|
5864
|
-
var
|
|
6098
|
+
var import_react35 = require("react");
|
|
6099
|
+
var import_react_native21 = require("react-native");
|
|
6100
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
5865
6101
|
var STATUS_LABELS4 = {
|
|
5866
6102
|
building: "Building transaction...",
|
|
5867
6103
|
signing: "Approve in wallet...",
|
|
@@ -5880,18 +6116,18 @@ function ClaimPrizeSheet({
|
|
|
5880
6116
|
const t = useDubsTheme();
|
|
5881
6117
|
const { wallet } = useDubs();
|
|
5882
6118
|
const mutation = useClaim();
|
|
5883
|
-
const overlayOpacity = (0,
|
|
5884
|
-
const celebrationScale = (0,
|
|
5885
|
-
const celebrationOpacity = (0,
|
|
5886
|
-
const [showCelebration, setShowCelebration] = (0,
|
|
5887
|
-
(0,
|
|
5888
|
-
|
|
6119
|
+
const overlayOpacity = (0, import_react35.useRef)(new import_react_native21.Animated.Value(0)).current;
|
|
6120
|
+
const celebrationScale = (0, import_react35.useRef)(new import_react_native21.Animated.Value(0)).current;
|
|
6121
|
+
const celebrationOpacity = (0, import_react35.useRef)(new import_react_native21.Animated.Value(0)).current;
|
|
6122
|
+
const [showCelebration, setShowCelebration] = (0, import_react35.useState)(false);
|
|
6123
|
+
(0, import_react35.useEffect)(() => {
|
|
6124
|
+
import_react_native21.Animated.timing(overlayOpacity, {
|
|
5889
6125
|
toValue: visible ? 1 : 0,
|
|
5890
6126
|
duration: 250,
|
|
5891
6127
|
useNativeDriver: true
|
|
5892
6128
|
}).start();
|
|
5893
6129
|
}, [visible, overlayOpacity]);
|
|
5894
|
-
(0,
|
|
6130
|
+
(0, import_react35.useEffect)(() => {
|
|
5895
6131
|
if (visible) {
|
|
5896
6132
|
mutation.reset();
|
|
5897
6133
|
setShowCelebration(false);
|
|
@@ -5899,17 +6135,17 @@ function ClaimPrizeSheet({
|
|
|
5899
6135
|
celebrationOpacity.setValue(0);
|
|
5900
6136
|
}
|
|
5901
6137
|
}, [visible]);
|
|
5902
|
-
(0,
|
|
6138
|
+
(0, import_react35.useEffect)(() => {
|
|
5903
6139
|
if (mutation.status === "success" && mutation.data) {
|
|
5904
6140
|
setShowCelebration(true);
|
|
5905
|
-
|
|
5906
|
-
|
|
6141
|
+
import_react_native21.Animated.parallel([
|
|
6142
|
+
import_react_native21.Animated.spring(celebrationScale, {
|
|
5907
6143
|
toValue: 1,
|
|
5908
6144
|
tension: 50,
|
|
5909
6145
|
friction: 6,
|
|
5910
6146
|
useNativeDriver: true
|
|
5911
6147
|
}),
|
|
5912
|
-
|
|
6148
|
+
import_react_native21.Animated.timing(celebrationOpacity, {
|
|
5913
6149
|
toValue: 1,
|
|
5914
6150
|
duration: 300,
|
|
5915
6151
|
useNativeDriver: true
|
|
@@ -5922,14 +6158,14 @@ function ClaimPrizeSheet({
|
|
|
5922
6158
|
return () => clearTimeout(timer);
|
|
5923
6159
|
}
|
|
5924
6160
|
}, [mutation.status, mutation.data]);
|
|
5925
|
-
(0,
|
|
6161
|
+
(0, import_react35.useEffect)(() => {
|
|
5926
6162
|
if (mutation.status === "error" && mutation.error) {
|
|
5927
6163
|
onError?.(mutation.error);
|
|
5928
6164
|
}
|
|
5929
6165
|
}, [mutation.status, mutation.error]);
|
|
5930
6166
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5931
6167
|
const canClaim = !isMutating && mutation.status !== "success" && !!wallet.publicKey;
|
|
5932
|
-
const handleClaim = (0,
|
|
6168
|
+
const handleClaim = (0, import_react35.useCallback)(async () => {
|
|
5933
6169
|
if (!wallet.publicKey) return;
|
|
5934
6170
|
try {
|
|
5935
6171
|
await mutation.execute({
|
|
@@ -5941,62 +6177,62 @@ function ClaimPrizeSheet({
|
|
|
5941
6177
|
}
|
|
5942
6178
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5943
6179
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5944
|
-
return /* @__PURE__ */ (0,
|
|
5945
|
-
|
|
6180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6181
|
+
import_react_native21.Modal,
|
|
5946
6182
|
{
|
|
5947
6183
|
visible,
|
|
5948
6184
|
animationType: "slide",
|
|
5949
6185
|
transparent: true,
|
|
5950
6186
|
onRequestClose: onDismiss,
|
|
5951
6187
|
children: [
|
|
5952
|
-
/* @__PURE__ */ (0,
|
|
5953
|
-
/* @__PURE__ */ (0,
|
|
5954
|
-
|
|
6188
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Animated.View, { style: [styles15.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.TouchableOpacity, { style: styles15.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6189
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6190
|
+
import_react_native21.KeyboardAvoidingView,
|
|
5955
6191
|
{
|
|
5956
|
-
style:
|
|
5957
|
-
behavior:
|
|
5958
|
-
children: /* @__PURE__ */ (0,
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
5960
|
-
/* @__PURE__ */ (0,
|
|
5961
|
-
/* @__PURE__ */ (0,
|
|
5962
|
-
/* @__PURE__ */ (0,
|
|
6192
|
+
style: styles15.keyboardView,
|
|
6193
|
+
behavior: import_react_native21.Platform.OS === "ios" ? "padding" : void 0,
|
|
6194
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.sheet, { backgroundColor: t.background }], children: [
|
|
6195
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6196
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.header, children: [
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
6198
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5963
6199
|
] }),
|
|
5964
|
-
showCelebration && /* @__PURE__ */ (0,
|
|
5965
|
-
|
|
6200
|
+
showCelebration && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6201
|
+
import_react_native21.Animated.View,
|
|
5966
6202
|
{
|
|
5967
6203
|
style: [
|
|
5968
|
-
|
|
6204
|
+
styles15.celebrationContainer,
|
|
5969
6205
|
{
|
|
5970
6206
|
opacity: celebrationOpacity,
|
|
5971
6207
|
transform: [{ scale: celebrationScale }]
|
|
5972
6208
|
}
|
|
5973
6209
|
],
|
|
5974
6210
|
children: [
|
|
5975
|
-
/* @__PURE__ */ (0,
|
|
5976
|
-
/* @__PURE__ */ (0,
|
|
6211
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
6212
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.celebrationText, { color: t.success }], children: [
|
|
5977
6213
|
"+",
|
|
5978
6214
|
prizeAmount,
|
|
5979
6215
|
" SOL"
|
|
5980
6216
|
] }),
|
|
5981
|
-
/* @__PURE__ */ (0,
|
|
6217
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5982
6218
|
]
|
|
5983
6219
|
}
|
|
5984
6220
|
),
|
|
5985
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5986
|
-
/* @__PURE__ */ (0,
|
|
5987
|
-
/* @__PURE__ */ (0,
|
|
5988
|
-
/* @__PURE__ */ (0,
|
|
6221
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6222
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
6224
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.success }], children: [
|
|
5989
6225
|
prizeAmount,
|
|
5990
6226
|
" SOL"
|
|
5991
6227
|
] })
|
|
5992
6228
|
] }),
|
|
5993
|
-
/* @__PURE__ */ (0,
|
|
5994
|
-
/* @__PURE__ */ (0,
|
|
5995
|
-
/* @__PURE__ */ (0,
|
|
5996
|
-
/* @__PURE__ */ (0,
|
|
5997
|
-
|
|
6229
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
|
|
6230
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
|
|
6231
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
6232
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
6233
|
+
import_react_native21.Text,
|
|
5998
6234
|
{
|
|
5999
|
-
style: [
|
|
6235
|
+
style: [styles15.summaryValue, { color: t.text }],
|
|
6000
6236
|
numberOfLines: 1,
|
|
6001
6237
|
children: [
|
|
6002
6238
|
gameId.slice(0, 8),
|
|
@@ -6007,21 +6243,21 @@ function ClaimPrizeSheet({
|
|
|
6007
6243
|
)
|
|
6008
6244
|
] })
|
|
6009
6245
|
] }),
|
|
6010
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
6011
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
6012
|
-
|
|
6246
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
6247
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6248
|
+
import_react_native21.TouchableOpacity,
|
|
6013
6249
|
{
|
|
6014
6250
|
style: [
|
|
6015
|
-
|
|
6251
|
+
styles15.ctaButton,
|
|
6016
6252
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
6017
6253
|
],
|
|
6018
6254
|
disabled: !canClaim,
|
|
6019
6255
|
onPress: handleClaim,
|
|
6020
6256
|
activeOpacity: 0.8,
|
|
6021
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
6022
|
-
/* @__PURE__ */ (0,
|
|
6023
|
-
/* @__PURE__ */ (0,
|
|
6024
|
-
] }) : /* @__PURE__ */ (0,
|
|
6257
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.ctaLoading, children: [
|
|
6258
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
6259
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: statusLabel })
|
|
6260
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
6025
6261
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
6026
6262
|
" \u2014 ",
|
|
6027
6263
|
prizeAmount,
|
|
@@ -6029,7 +6265,7 @@ function ClaimPrizeSheet({
|
|
|
6029
6265
|
] })
|
|
6030
6266
|
}
|
|
6031
6267
|
),
|
|
6032
|
-
mutation.data?.explorerUrl && /* @__PURE__ */ (0,
|
|
6268
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
6033
6269
|
] }) })
|
|
6034
6270
|
}
|
|
6035
6271
|
)
|
|
@@ -6037,9 +6273,9 @@ function ClaimPrizeSheet({
|
|
|
6037
6273
|
}
|
|
6038
6274
|
);
|
|
6039
6275
|
}
|
|
6040
|
-
var
|
|
6276
|
+
var styles15 = import_react_native21.StyleSheet.create({
|
|
6041
6277
|
overlay: {
|
|
6042
|
-
...
|
|
6278
|
+
...import_react_native21.StyleSheet.absoluteFillObject,
|
|
6043
6279
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6044
6280
|
},
|
|
6045
6281
|
overlayTap: {
|
|
@@ -6162,17 +6398,17 @@ var styles14 = import_react_native20.StyleSheet.create({
|
|
|
6162
6398
|
});
|
|
6163
6399
|
|
|
6164
6400
|
// src/ui/game/ClaimButton.tsx
|
|
6165
|
-
var
|
|
6166
|
-
var
|
|
6167
|
-
var
|
|
6401
|
+
var import_react36 = require("react");
|
|
6402
|
+
var import_react_native22 = require("react-native");
|
|
6403
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6168
6404
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
6169
6405
|
const t = useDubsTheme();
|
|
6170
6406
|
const { wallet } = useDubs();
|
|
6171
6407
|
const game = useGame(gameId);
|
|
6172
6408
|
const claimStatus = useHasClaimed(gameId);
|
|
6173
|
-
const [sheetVisible, setSheetVisible] = (0,
|
|
6409
|
+
const [sheetVisible, setSheetVisible] = (0, import_react36.useState)(false);
|
|
6174
6410
|
const walletAddress = wallet.publicKey?.toBase58() ?? null;
|
|
6175
|
-
const myBet = (0,
|
|
6411
|
+
const myBet = (0, import_react36.useMemo)(() => {
|
|
6176
6412
|
if (!walletAddress || !game.data?.bettors) return null;
|
|
6177
6413
|
return game.data.bettors.find((b) => b.wallet === walletAddress) ?? null;
|
|
6178
6414
|
}, [walletAddress, game.data?.bettors]);
|
|
@@ -6181,7 +6417,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6181
6417
|
const isWinner = isResolved && myBet != null && myBet.team === game.data?.winnerSide;
|
|
6182
6418
|
const isEligible = myBet != null && isResolved && (isWinner || isRefund);
|
|
6183
6419
|
const prizeAmount = isRefund ? myBet?.amount ?? 0 : game.data?.totalPool ?? 0;
|
|
6184
|
-
const handleSuccess = (0,
|
|
6420
|
+
const handleSuccess = (0, import_react36.useCallback)(
|
|
6185
6421
|
(result) => {
|
|
6186
6422
|
claimStatus.refetch();
|
|
6187
6423
|
onSuccess?.(result);
|
|
@@ -6194,13 +6430,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6194
6430
|
}
|
|
6195
6431
|
const label = isRefund ? "Refund" : "Prize";
|
|
6196
6432
|
if (claimStatus.hasClaimed) {
|
|
6197
|
-
return /* @__PURE__ */ (0,
|
|
6198
|
-
|
|
6433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6434
|
+
import_react_native22.TouchableOpacity,
|
|
6199
6435
|
{
|
|
6200
|
-
style: [
|
|
6436
|
+
style: [styles16.badge, { borderColor: t.accent }, style],
|
|
6201
6437
|
activeOpacity: 1,
|
|
6202
6438
|
disabled: true,
|
|
6203
|
-
children: /* @__PURE__ */ (0,
|
|
6439
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.Text, { style: [styles16.badgeText, { color: t.accent }], children: [
|
|
6204
6440
|
label,
|
|
6205
6441
|
" Claimed!"
|
|
6206
6442
|
] })
|
|
@@ -6210,14 +6446,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6210
6446
|
if (!isEligible) {
|
|
6211
6447
|
return null;
|
|
6212
6448
|
}
|
|
6213
|
-
return /* @__PURE__ */ (0,
|
|
6214
|
-
/* @__PURE__ */ (0,
|
|
6215
|
-
|
|
6449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6451
|
+
import_react_native22.TouchableOpacity,
|
|
6216
6452
|
{
|
|
6217
|
-
style: [
|
|
6453
|
+
style: [styles16.button, { backgroundColor: t.accent }, style],
|
|
6218
6454
|
activeOpacity: 0.8,
|
|
6219
6455
|
onPress: () => setSheetVisible(true),
|
|
6220
|
-
children: /* @__PURE__ */ (0,
|
|
6456
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_native22.Text, { style: styles16.buttonText, children: [
|
|
6221
6457
|
"Claim ",
|
|
6222
6458
|
label,
|
|
6223
6459
|
" \u2014 ",
|
|
@@ -6226,7 +6462,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6226
6462
|
] })
|
|
6227
6463
|
}
|
|
6228
6464
|
),
|
|
6229
|
-
/* @__PURE__ */ (0,
|
|
6465
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
6230
6466
|
ClaimPrizeSheet,
|
|
6231
6467
|
{
|
|
6232
6468
|
visible: sheetVisible,
|
|
@@ -6240,7 +6476,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
6240
6476
|
)
|
|
6241
6477
|
] });
|
|
6242
6478
|
}
|
|
6243
|
-
var
|
|
6479
|
+
var styles16 = import_react_native22.StyleSheet.create({
|
|
6244
6480
|
button: {
|
|
6245
6481
|
height: 52,
|
|
6246
6482
|
borderRadius: 14,
|
|
@@ -6268,9 +6504,9 @@ var styles15 = import_react_native21.StyleSheet.create({
|
|
|
6268
6504
|
});
|
|
6269
6505
|
|
|
6270
6506
|
// src/ui/game/EnterArcadePoolSheet.tsx
|
|
6271
|
-
var
|
|
6272
|
-
var
|
|
6273
|
-
var
|
|
6507
|
+
var import_react37 = require("react");
|
|
6508
|
+
var import_react_native23 = require("react-native");
|
|
6509
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6274
6510
|
var STATUS_LABELS5 = {
|
|
6275
6511
|
building: "Building transaction...",
|
|
6276
6512
|
signing: "Approve in wallet...",
|
|
@@ -6289,20 +6525,20 @@ function EnterArcadePoolSheet({
|
|
|
6289
6525
|
const t = useDubsTheme();
|
|
6290
6526
|
const { wallet } = useDubs();
|
|
6291
6527
|
const mutation = useEnterArcadePool();
|
|
6292
|
-
const overlayOpacity = (0,
|
|
6293
|
-
(0,
|
|
6294
|
-
|
|
6528
|
+
const overlayOpacity = (0, import_react37.useRef)(new import_react_native23.Animated.Value(0)).current;
|
|
6529
|
+
(0, import_react37.useEffect)(() => {
|
|
6530
|
+
import_react_native23.Animated.timing(overlayOpacity, {
|
|
6295
6531
|
toValue: visible ? 1 : 0,
|
|
6296
6532
|
duration: 250,
|
|
6297
6533
|
useNativeDriver: true
|
|
6298
6534
|
}).start();
|
|
6299
6535
|
}, [visible, overlayOpacity]);
|
|
6300
|
-
(0,
|
|
6536
|
+
(0, import_react37.useEffect)(() => {
|
|
6301
6537
|
if (visible) {
|
|
6302
6538
|
mutation.reset();
|
|
6303
6539
|
}
|
|
6304
6540
|
}, [visible]);
|
|
6305
|
-
(0,
|
|
6541
|
+
(0, import_react37.useEffect)(() => {
|
|
6306
6542
|
if (mutation.status === "success" && mutation.data) {
|
|
6307
6543
|
onSuccess?.(mutation.data);
|
|
6308
6544
|
const timer = setTimeout(() => {
|
|
@@ -6311,7 +6547,7 @@ function EnterArcadePoolSheet({
|
|
|
6311
6547
|
return () => clearTimeout(timer);
|
|
6312
6548
|
}
|
|
6313
6549
|
}, [mutation.status, mutation.data]);
|
|
6314
|
-
(0,
|
|
6550
|
+
(0, import_react37.useEffect)(() => {
|
|
6315
6551
|
if (mutation.status === "error" && mutation.error) {
|
|
6316
6552
|
onError?.(mutation.error);
|
|
6317
6553
|
}
|
|
@@ -6323,7 +6559,7 @@ function EnterArcadePoolSheet({
|
|
|
6323
6559
|
const potSol = (pool.buy_in_lamports * Number(totalBuyIns) / 1e9).toFixed(4);
|
|
6324
6560
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
6325
6561
|
const canJoin = !isMutating && mutation.status !== "success";
|
|
6326
|
-
const handleJoin = (0,
|
|
6562
|
+
const handleJoin = (0, import_react37.useCallback)(async () => {
|
|
6327
6563
|
if (!wallet.publicKey) return;
|
|
6328
6564
|
try {
|
|
6329
6565
|
await mutation.execute(pool.id);
|
|
@@ -6335,76 +6571,76 @@ function EnterArcadePoolSheet({
|
|
|
6335
6571
|
const headerTitle = isRejoin ? "Play Again" : "Join Pool";
|
|
6336
6572
|
const ctaLabel = isRejoin ? `Play Again \u2014 ${buyInSol} SOL` : `Join Pool \u2014 ${buyInSol} SOL`;
|
|
6337
6573
|
const successLabel = isRejoin ? "Lives refilled!" : "Joined!";
|
|
6338
|
-
return /* @__PURE__ */ (0,
|
|
6339
|
-
|
|
6574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
6575
|
+
import_react_native23.Modal,
|
|
6340
6576
|
{
|
|
6341
6577
|
visible,
|
|
6342
6578
|
animationType: "slide",
|
|
6343
6579
|
transparent: true,
|
|
6344
6580
|
onRequestClose: onDismiss,
|
|
6345
6581
|
children: [
|
|
6346
|
-
/* @__PURE__ */ (0,
|
|
6347
|
-
/* @__PURE__ */ (0,
|
|
6348
|
-
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Animated.View, { style: [styles17.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.TouchableOpacity, { style: styles17.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6583
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
6584
|
+
import_react_native23.KeyboardAvoidingView,
|
|
6349
6585
|
{
|
|
6350
|
-
style:
|
|
6351
|
-
behavior:
|
|
6352
|
-
children: /* @__PURE__ */ (0,
|
|
6353
|
-
/* @__PURE__ */ (0,
|
|
6354
|
-
/* @__PURE__ */ (0,
|
|
6355
|
-
/* @__PURE__ */ (0,
|
|
6356
|
-
/* @__PURE__ */ (0,
|
|
6586
|
+
style: styles17.keyboardView,
|
|
6587
|
+
behavior: import_react_native23.Platform.OS === "ios" ? "padding" : void 0,
|
|
6588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: styles17.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: [styles17.sheet, { backgroundColor: t.background }], children: [
|
|
6589
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: styles17.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6590
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.header, children: [
|
|
6591
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.headerTitle, { color: t.text }], children: headerTitle }),
|
|
6592
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6357
6593
|
] }),
|
|
6358
|
-
/* @__PURE__ */ (0,
|
|
6359
|
-
/* @__PURE__ */ (0,
|
|
6360
|
-
/* @__PURE__ */ (0,
|
|
6361
|
-
/* @__PURE__ */ (0,
|
|
6362
|
-
/* @__PURE__ */ (0,
|
|
6594
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.poolName, { color: t.textSecondary }], children: pool.name }),
|
|
6595
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: [styles17.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.summaryRow, children: [
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.Text, { style: [styles17.summaryValue, { color: t.text }], children: [
|
|
6363
6599
|
buyInSol,
|
|
6364
6600
|
" SOL"
|
|
6365
6601
|
] })
|
|
6366
6602
|
] }),
|
|
6367
|
-
/* @__PURE__ */ (0,
|
|
6368
|
-
/* @__PURE__ */ (0,
|
|
6369
|
-
/* @__PURE__ */ (0,
|
|
6370
|
-
/* @__PURE__ */ (0,
|
|
6603
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6604
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.summaryRow, children: [
|
|
6605
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
6606
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryValue, { color: t.text }], children: totalPlayers })
|
|
6371
6607
|
] }),
|
|
6372
|
-
/* @__PURE__ */ (0,
|
|
6373
|
-
/* @__PURE__ */ (0,
|
|
6374
|
-
/* @__PURE__ */ (0,
|
|
6375
|
-
/* @__PURE__ */ (0,
|
|
6608
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6609
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.summaryRow, children: [
|
|
6610
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
6611
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.Text, { style: [styles17.summaryValue, { color: t.success }], children: [
|
|
6376
6612
|
potSol,
|
|
6377
6613
|
" SOL"
|
|
6378
6614
|
] })
|
|
6379
6615
|
] }),
|
|
6380
|
-
/* @__PURE__ */ (0,
|
|
6381
|
-
/* @__PURE__ */ (0,
|
|
6382
|
-
/* @__PURE__ */ (0,
|
|
6383
|
-
/* @__PURE__ */ (0,
|
|
6616
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6617
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.summaryRow, children: [
|
|
6618
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Lives" }),
|
|
6619
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryValue, { color: t.text }], children: pool.max_lives })
|
|
6384
6620
|
] }),
|
|
6385
|
-
topScore > 0 && /* @__PURE__ */ (0,
|
|
6386
|
-
/* @__PURE__ */ (0,
|
|
6387
|
-
/* @__PURE__ */ (0,
|
|
6388
|
-
/* @__PURE__ */ (0,
|
|
6389
|
-
/* @__PURE__ */ (0,
|
|
6621
|
+
topScore > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
6622
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.summarySep, { backgroundColor: t.border }] }),
|
|
6623
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.summaryRow, children: [
|
|
6624
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryLabel, { color: t.textMuted }], children: "Top score" }),
|
|
6625
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.summaryValue, { color: t.text }], children: topScore })
|
|
6390
6626
|
] })
|
|
6391
6627
|
] })
|
|
6392
6628
|
] }),
|
|
6393
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
6394
|
-
/* @__PURE__ */ (0,
|
|
6395
|
-
|
|
6629
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.View, { style: [styles17.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
6630
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
6631
|
+
import_react_native23.TouchableOpacity,
|
|
6396
6632
|
{
|
|
6397
6633
|
style: [
|
|
6398
|
-
|
|
6634
|
+
styles17.ctaButton,
|
|
6399
6635
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
6400
6636
|
],
|
|
6401
6637
|
disabled: !canJoin,
|
|
6402
6638
|
onPress: handleJoin,
|
|
6403
6639
|
activeOpacity: 0.8,
|
|
6404
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
6405
|
-
/* @__PURE__ */ (0,
|
|
6406
|
-
/* @__PURE__ */ (0,
|
|
6407
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
6640
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react_native23.View, { style: styles17.ctaLoading, children: [
|
|
6641
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
6642
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: styles17.ctaText, children: statusLabel })
|
|
6643
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: styles17.ctaText, children: successLabel }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native23.Text, { style: [styles17.ctaText, !canJoin && { opacity: 0.5 }], children: ctaLabel })
|
|
6408
6644
|
}
|
|
6409
6645
|
)
|
|
6410
6646
|
] }) })
|
|
@@ -6414,9 +6650,9 @@ function EnterArcadePoolSheet({
|
|
|
6414
6650
|
}
|
|
6415
6651
|
);
|
|
6416
6652
|
}
|
|
6417
|
-
var
|
|
6653
|
+
var styles17 = import_react_native23.StyleSheet.create({
|
|
6418
6654
|
overlay: {
|
|
6419
|
-
...
|
|
6655
|
+
...import_react_native23.StyleSheet.absoluteFillObject,
|
|
6420
6656
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6421
6657
|
},
|
|
6422
6658
|
overlayTap: { flex: 1 },
|
|
@@ -6474,14 +6710,14 @@ var styles16 = import_react_native22.StyleSheet.create({
|
|
|
6474
6710
|
});
|
|
6475
6711
|
|
|
6476
6712
|
// src/ui/game/ArcadeLeaderboardSheet.tsx
|
|
6477
|
-
var
|
|
6478
|
-
var
|
|
6479
|
-
var
|
|
6713
|
+
var import_react38 = require("react");
|
|
6714
|
+
var import_react_native24 = require("react-native");
|
|
6715
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6480
6716
|
function RankLabel({ index }) {
|
|
6481
|
-
if (index === 0) return /* @__PURE__ */ (0,
|
|
6482
|
-
if (index === 1) return /* @__PURE__ */ (0,
|
|
6483
|
-
if (index === 2) return /* @__PURE__ */ (0,
|
|
6484
|
-
return /* @__PURE__ */ (0,
|
|
6717
|
+
if (index === 0) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: styles18.rankEmoji, children: "\u{1F947}" });
|
|
6718
|
+
if (index === 1) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: styles18.rankEmoji, children: "\u{1F948}" });
|
|
6719
|
+
if (index === 2) return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: styles18.rankEmoji, children: "\u{1F949}" });
|
|
6720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: styles18.rankNum, children: index + 1 });
|
|
6485
6721
|
}
|
|
6486
6722
|
function ArcadeLeaderboardSheet({
|
|
6487
6723
|
visible,
|
|
@@ -6491,92 +6727,92 @@ function ArcadeLeaderboardSheet({
|
|
|
6491
6727
|
}) {
|
|
6492
6728
|
const t = useDubsTheme();
|
|
6493
6729
|
const { pool, leaderboard, stats, loading, refetch } = useArcadePool(poolId);
|
|
6494
|
-
const overlayOpacity = (0,
|
|
6495
|
-
(0,
|
|
6496
|
-
|
|
6730
|
+
const overlayOpacity = (0, import_react38.useRef)(new import_react_native24.Animated.Value(0)).current;
|
|
6731
|
+
(0, import_react38.useEffect)(() => {
|
|
6732
|
+
import_react_native24.Animated.timing(overlayOpacity, {
|
|
6497
6733
|
toValue: visible ? 1 : 0,
|
|
6498
6734
|
duration: 250,
|
|
6499
6735
|
useNativeDriver: true
|
|
6500
6736
|
}).start();
|
|
6501
6737
|
}, [visible, overlayOpacity]);
|
|
6502
|
-
(0,
|
|
6738
|
+
(0, import_react38.useEffect)(() => {
|
|
6503
6739
|
if (visible) refetch();
|
|
6504
6740
|
}, [visible]);
|
|
6505
6741
|
const renderItem = ({ item, index }) => {
|
|
6506
6742
|
const isMe = highlightWallet && item.wallet_address === highlightWallet;
|
|
6507
|
-
return /* @__PURE__ */ (0,
|
|
6508
|
-
|
|
6743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
6744
|
+
import_react_native24.View,
|
|
6509
6745
|
{
|
|
6510
6746
|
style: [
|
|
6511
|
-
|
|
6747
|
+
styles18.row,
|
|
6512
6748
|
{ backgroundColor: isMe ? `${t.accent}18` : index % 2 === 0 ? t.surface : "transparent" },
|
|
6513
6749
|
isMe ? { borderWidth: 1, borderColor: t.accent } : void 0
|
|
6514
6750
|
],
|
|
6515
6751
|
children: [
|
|
6516
|
-
/* @__PURE__ */ (0,
|
|
6517
|
-
item.avatar ? /* @__PURE__ */ (0,
|
|
6518
|
-
/* @__PURE__ */ (0,
|
|
6519
|
-
/* @__PURE__ */ (0,
|
|
6520
|
-
/* @__PURE__ */ (0,
|
|
6752
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: styles18.rankCol, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(RankLabel, { index }) }),
|
|
6753
|
+
item.avatar ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Image, { source: { uri: ensurePngAvatar(item.avatar) }, style: styles18.avatar }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: [styles18.avatar, { backgroundColor: t.border }] }),
|
|
6754
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: styles18.nameCol, children: [
|
|
6755
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.name, { color: t.text }], numberOfLines: 1, children: item.username || `${item.wallet_address.slice(0, 4)}...${item.wallet_address.slice(-4)}` }),
|
|
6756
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.Text, { style: [styles18.lives, { color: t.textMuted }], children: [
|
|
6521
6757
|
item.lives_used,
|
|
6522
6758
|
" ",
|
|
6523
6759
|
item.lives_used === 1 ? "life" : "lives",
|
|
6524
6760
|
" used"
|
|
6525
6761
|
] })
|
|
6526
6762
|
] }),
|
|
6527
|
-
/* @__PURE__ */ (0,
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.score, { color: t.accent }], children: item.best_score })
|
|
6528
6764
|
]
|
|
6529
6765
|
}
|
|
6530
6766
|
);
|
|
6531
6767
|
};
|
|
6532
|
-
return /* @__PURE__ */ (0,
|
|
6533
|
-
|
|
6768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
6769
|
+
import_react_native24.Modal,
|
|
6534
6770
|
{
|
|
6535
6771
|
visible,
|
|
6536
6772
|
animationType: "slide",
|
|
6537
6773
|
transparent: true,
|
|
6538
6774
|
onRequestClose: onDismiss,
|
|
6539
6775
|
children: [
|
|
6540
|
-
/* @__PURE__ */ (0,
|
|
6541
|
-
/* @__PURE__ */ (0,
|
|
6542
|
-
|
|
6776
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Animated.View, { style: [styles18.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.TouchableOpacity, { style: styles18.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
6777
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6778
|
+
import_react_native24.KeyboardAvoidingView,
|
|
6543
6779
|
{
|
|
6544
|
-
style:
|
|
6545
|
-
behavior:
|
|
6546
|
-
children: /* @__PURE__ */ (0,
|
|
6547
|
-
/* @__PURE__ */ (0,
|
|
6548
|
-
/* @__PURE__ */ (0,
|
|
6549
|
-
/* @__PURE__ */ (0,
|
|
6550
|
-
/* @__PURE__ */ (0,
|
|
6551
|
-
pool && /* @__PURE__ */ (0,
|
|
6780
|
+
style: styles18.keyboardView,
|
|
6781
|
+
behavior: import_react_native24.Platform.OS === "ios" ? "padding" : void 0,
|
|
6782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: styles18.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: [styles18.sheet, { backgroundColor: t.background }], children: [
|
|
6783
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: styles18.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: [styles18.handle, { backgroundColor: t.textMuted }] }) }),
|
|
6784
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: styles18.header, children: [
|
|
6785
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { children: [
|
|
6786
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.headerTitle, { color: t.text }], children: "Leaderboard" }),
|
|
6787
|
+
pool && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.poolName, { color: t.textMuted }], children: pool.name })
|
|
6552
6788
|
] }),
|
|
6553
|
-
/* @__PURE__ */ (0,
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
6554
6790
|
] }),
|
|
6555
|
-
stats && /* @__PURE__ */ (0,
|
|
6556
|
-
/* @__PURE__ */ (0,
|
|
6557
|
-
/* @__PURE__ */ (0,
|
|
6558
|
-
/* @__PURE__ */ (0,
|
|
6791
|
+
stats && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: [styles18.statsBar, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
6792
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: styles18.statItem, children: [
|
|
6793
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statValue, { color: t.text }], children: stats.total_entries }),
|
|
6794
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statLabel, { color: t.textMuted }], children: "Players" })
|
|
6559
6795
|
] }),
|
|
6560
|
-
/* @__PURE__ */ (0,
|
|
6561
|
-
/* @__PURE__ */ (0,
|
|
6562
|
-
/* @__PURE__ */ (0,
|
|
6563
|
-
/* @__PURE__ */ (0,
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: [styles18.statDivider, { backgroundColor: t.border }] }),
|
|
6797
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: styles18.statItem, children: [
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statValue, { color: t.accent }], children: stats.top_score }),
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statLabel, { color: t.textMuted }], children: "Top Score" })
|
|
6564
6800
|
] }),
|
|
6565
|
-
/* @__PURE__ */ (0,
|
|
6566
|
-
/* @__PURE__ */ (0,
|
|
6567
|
-
/* @__PURE__ */ (0,
|
|
6568
|
-
/* @__PURE__ */ (0,
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: [styles18.statDivider, { backgroundColor: t.border }] }),
|
|
6802
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_native24.View, { style: styles18.statItem, children: [
|
|
6803
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statValue, { color: t.text }], children: Math.round(stats.avg_score) }),
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.statLabel, { color: t.textMuted }], children: "Avg Score" })
|
|
6569
6805
|
] })
|
|
6570
6806
|
] }),
|
|
6571
|
-
/* @__PURE__ */ (0,
|
|
6572
|
-
|
|
6807
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6808
|
+
import_react_native24.FlatList,
|
|
6573
6809
|
{
|
|
6574
6810
|
data: leaderboard,
|
|
6575
6811
|
renderItem,
|
|
6576
6812
|
keyExtractor: (item) => String(item.id),
|
|
6577
|
-
style:
|
|
6578
|
-
contentContainerStyle:
|
|
6579
|
-
ListEmptyComponent: /* @__PURE__ */ (0,
|
|
6813
|
+
style: styles18.list,
|
|
6814
|
+
contentContainerStyle: styles18.listContent,
|
|
6815
|
+
ListEmptyComponent: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.View, { style: styles18.emptyState, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_native24.Text, { style: [styles18.emptyText, { color: t.textMuted }], children: loading ? "Loading..." : "No scores yet" }) })
|
|
6580
6816
|
}
|
|
6581
6817
|
)
|
|
6582
6818
|
] }) })
|
|
@@ -6586,9 +6822,9 @@ function ArcadeLeaderboardSheet({
|
|
|
6586
6822
|
}
|
|
6587
6823
|
);
|
|
6588
6824
|
}
|
|
6589
|
-
var
|
|
6825
|
+
var styles18 = import_react_native24.StyleSheet.create({
|
|
6590
6826
|
overlay: {
|
|
6591
|
-
...
|
|
6827
|
+
...import_react_native24.StyleSheet.absoluteFillObject,
|
|
6592
6828
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
6593
6829
|
},
|
|
6594
6830
|
overlayTap: { flex: 1 },
|
|
@@ -6671,6 +6907,7 @@ var styles17 = import_react_native23.StyleSheet.create({
|
|
|
6671
6907
|
SOLANA_PROGRAM_ERRORS,
|
|
6672
6908
|
STORAGE_KEYS,
|
|
6673
6909
|
SettingsSheet,
|
|
6910
|
+
SolSlider,
|
|
6674
6911
|
UserProfileCard,
|
|
6675
6912
|
UserProfileSheet,
|
|
6676
6913
|
createSecureStoreStorage,
|