@dubsdotapp/expo 0.5.9 → 0.5.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dubsdotapp/expo",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "React Native SDK for the Dubs betting platform",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -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 alreadyJoined = useMemo(() => {
174
- if (!wallet.publicKey) return false;
173
+ const myBet = useMemo(() => {
174
+ if (!wallet.publicKey) return null;
175
175
  const addr = wallet.publicKey.toBase58();
176
- return bettors.some(b => b.wallet === addr);
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
 
@@ -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,