@dubsdotapp/expo 0.5.9 → 0.5.11
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 +1477 -0
- package/dist/index.d.ts +1477 -0
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/game/JoinGameSheet.tsx +42 -6
package/package.json
CHANGED
|
@@ -170,12 +170,14 @@ export function JoinGameSheet({
|
|
|
170
170
|
const homeName = shortName ? shortName(opponents[0]?.name) : (opponents[0]?.name || 'Home');
|
|
171
171
|
const awayName = shortName ? shortName(opponents[1]?.name) : (opponents[1]?.name || 'Away');
|
|
172
172
|
|
|
173
|
-
const
|
|
174
|
-
if (!wallet.publicKey) return
|
|
173
|
+
const myBet = useMemo(() => {
|
|
174
|
+
if (!wallet.publicKey) return null;
|
|
175
175
|
const addr = wallet.publicKey.toBase58();
|
|
176
|
-
return bettors.
|
|
176
|
+
return bettors.find(b => b.wallet === addr) ?? null;
|
|
177
177
|
}, [bettors, wallet.publicKey]);
|
|
178
178
|
|
|
179
|
+
const alreadyJoined = myBet !== null;
|
|
180
|
+
|
|
179
181
|
const isMutating = mutation.status !== 'idle' && mutation.status !== 'success' && mutation.status !== 'error';
|
|
180
182
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== 'success' && !alreadyJoined;
|
|
181
183
|
|
|
@@ -214,7 +216,7 @@ export function JoinGameSheet({
|
|
|
214
216
|
<Text style={styles.successEmoji}>🎉</Text>
|
|
215
217
|
<Text style={styles.successTitle}>You're in!</Text>
|
|
216
218
|
<Text style={styles.successSub}>
|
|
217
|
-
{formatSol(
|
|
219
|
+
{formatSol(wager)} SOL on {selectedTeam === 'home' ? homeName : awayName}
|
|
218
220
|
</Text>
|
|
219
221
|
</Animated.View>
|
|
220
222
|
</View>
|
|
@@ -268,7 +270,7 @@ export function JoinGameSheet({
|
|
|
268
270
|
)}
|
|
269
271
|
|
|
270
272
|
{/* Team Selection — hidden in pool mode and custom games */}
|
|
271
|
-
{!isCustomGame && !isPoolModeEnabled && (
|
|
273
|
+
{!isCustomGame && !isPoolModeEnabled && !alreadyJoined && (
|
|
272
274
|
<View style={styles.section}>
|
|
273
275
|
<Text style={[styles.sectionLabel, { color: t.textSecondary }]}>Pick Your Side</Text>
|
|
274
276
|
<View style={styles.teamsRow}>
|
|
@@ -298,6 +300,19 @@ export function JoinGameSheet({
|
|
|
298
300
|
</View>
|
|
299
301
|
)}
|
|
300
302
|
|
|
303
|
+
{/* Already joined — show which side */}
|
|
304
|
+
{alreadyJoined && myBet && (
|
|
305
|
+
<View style={[styles.myBetCard, { backgroundColor: (myBet.team === 'home' ? homeColor : awayColor) + '15', borderColor: myBet.team === 'home' ? homeColor : awayColor }]}>
|
|
306
|
+
<Text style={[styles.myBetLabel, { color: myBet.team === 'home' ? homeColor : awayColor }]}>YOUR BET</Text>
|
|
307
|
+
<Text style={[styles.myBetTeam, { color: t.text }]}>
|
|
308
|
+
{myBet.team === 'home' ? homeName : awayName}
|
|
309
|
+
</Text>
|
|
310
|
+
<Text style={[styles.myBetAmount, { color: t.textMuted }]}>
|
|
311
|
+
{formatSol(myBet.amount)} SOL
|
|
312
|
+
</Text>
|
|
313
|
+
</View>
|
|
314
|
+
)}
|
|
315
|
+
|
|
301
316
|
{/* Summary Card */}
|
|
302
317
|
<View style={[styles.summaryCard, { backgroundColor: t.surface, borderColor: t.border }]}>
|
|
303
318
|
<View style={styles.summaryRow}>
|
|
@@ -335,7 +350,7 @@ export function JoinGameSheet({
|
|
|
335
350
|
</View>
|
|
336
351
|
|
|
337
352
|
{/* SOL Slider — sits right below summary card */}
|
|
338
|
-
{selectedTeam && !isPoolModeEnabled && (
|
|
353
|
+
{selectedTeam && !isPoolModeEnabled && !alreadyJoined && (
|
|
339
354
|
<SolSlider
|
|
340
355
|
value={wager}
|
|
341
356
|
min={game.buyIn}
|
|
@@ -579,6 +594,27 @@ const styles = StyleSheet.create({
|
|
|
579
594
|
height: 1,
|
|
580
595
|
marginHorizontal: 16,
|
|
581
596
|
},
|
|
597
|
+
myBetCard: {
|
|
598
|
+
marginTop: 16,
|
|
599
|
+
borderRadius: 14,
|
|
600
|
+
borderWidth: 1.5,
|
|
601
|
+
padding: 16,
|
|
602
|
+
alignItems: 'center',
|
|
603
|
+
gap: 4,
|
|
604
|
+
},
|
|
605
|
+
myBetLabel: {
|
|
606
|
+
fontSize: 10,
|
|
607
|
+
fontWeight: '900',
|
|
608
|
+
letterSpacing: 1.5,
|
|
609
|
+
},
|
|
610
|
+
myBetTeam: {
|
|
611
|
+
fontSize: 18,
|
|
612
|
+
fontWeight: '700',
|
|
613
|
+
},
|
|
614
|
+
myBetAmount: {
|
|
615
|
+
fontSize: 14,
|
|
616
|
+
fontWeight: '600',
|
|
617
|
+
},
|
|
582
618
|
errorBox: {
|
|
583
619
|
marginTop: 16,
|
|
584
620
|
borderRadius: 12,
|