@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/dist/index.mjs
CHANGED
|
@@ -5630,11 +5630,12 @@ function JoinGameSheet({
|
|
|
5630
5630
|
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
|
|
5631
5631
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
5632
5632
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
5633
|
-
const
|
|
5634
|
-
if (!wallet.publicKey) return
|
|
5633
|
+
const myBet = useMemo9(() => {
|
|
5634
|
+
if (!wallet.publicKey) return null;
|
|
5635
5635
|
const addr = wallet.publicKey.toBase58();
|
|
5636
|
-
return bettors.
|
|
5636
|
+
return bettors.find((b) => b.wallet === addr) ?? null;
|
|
5637
5637
|
}, [bettors, wallet.publicKey]);
|
|
5638
|
+
const alreadyJoined = myBet !== null;
|
|
5638
5639
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5639
5640
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
|
|
5640
5641
|
const handleJoin = useCallback24(async () => {
|
|
@@ -5663,9 +5664,9 @@ function JoinGameSheet({
|
|
|
5663
5664
|
/* @__PURE__ */ jsx17(Text15, { style: styles14.successEmoji, children: "\u{1F389}" }),
|
|
5664
5665
|
/* @__PURE__ */ jsx17(Text15, { style: styles14.successTitle, children: "You're in!" }),
|
|
5665
5666
|
/* @__PURE__ */ jsxs14(Text15, { style: styles14.successSub, children: [
|
|
5666
|
-
formatSol(
|
|
5667
|
+
formatSol(wager),
|
|
5667
5668
|
" SOL on ",
|
|
5668
|
-
|
|
5669
|
+
selectedTeam === "home" ? homeName : awayName
|
|
5669
5670
|
] })
|
|
5670
5671
|
] }) }),
|
|
5671
5672
|
/* @__PURE__ */ jsx17(
|
|
@@ -5697,7 +5698,7 @@ function JoinGameSheet({
|
|
|
5697
5698
|
] }) })
|
|
5698
5699
|
] })
|
|
5699
5700
|
] }),
|
|
5700
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ jsxs14(View15, { style: styles14.section, children: [
|
|
5701
|
+
!isCustomGame && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsxs14(View15, { style: styles14.section, children: [
|
|
5701
5702
|
/* @__PURE__ */ jsx17(Text15, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5702
5703
|
/* @__PURE__ */ jsxs14(View15, { style: styles14.teamsRow, children: [
|
|
5703
5704
|
/* @__PURE__ */ jsx17(
|
|
@@ -5736,6 +5737,14 @@ function JoinGameSheet({
|
|
|
5736
5737
|
)
|
|
5737
5738
|
] })
|
|
5738
5739
|
] }),
|
|
5740
|
+
alreadyJoined && myBet && /* @__PURE__ */ jsxs14(View15, { style: [styles14.myBetCard, { backgroundColor: (myBet.team === "home" ? homeColor : awayColor) + "15", borderColor: myBet.team === "home" ? homeColor : awayColor }], children: [
|
|
5741
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.myBetLabel, { color: myBet.team === "home" ? homeColor : awayColor }], children: "YOUR BET" }),
|
|
5742
|
+
/* @__PURE__ */ jsx17(Text15, { style: [styles14.myBetTeam, { color: t.text }], children: myBet.team === "home" ? homeName : awayName }),
|
|
5743
|
+
/* @__PURE__ */ jsxs14(Text15, { style: [styles14.myBetAmount, { color: t.textMuted }], children: [
|
|
5744
|
+
formatSol(myBet.amount),
|
|
5745
|
+
" SOL"
|
|
5746
|
+
] })
|
|
5747
|
+
] }),
|
|
5739
5748
|
/* @__PURE__ */ jsxs14(View15, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5740
5749
|
/* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
|
|
5741
5750
|
/* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
@@ -5773,7 +5782,7 @@ function JoinGameSheet({
|
|
|
5773
5782
|
] })
|
|
5774
5783
|
] })
|
|
5775
5784
|
] }),
|
|
5776
|
-
selectedTeam && !isPoolModeEnabled && /* @__PURE__ */ jsx17(
|
|
5785
|
+
selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsx17(
|
|
5777
5786
|
SolSlider,
|
|
5778
5787
|
{
|
|
5779
5788
|
value: wager,
|
|
@@ -5990,6 +5999,27 @@ var styles14 = StyleSheet15.create({
|
|
|
5990
5999
|
height: 1,
|
|
5991
6000
|
marginHorizontal: 16
|
|
5992
6001
|
},
|
|
6002
|
+
myBetCard: {
|
|
6003
|
+
marginTop: 16,
|
|
6004
|
+
borderRadius: 14,
|
|
6005
|
+
borderWidth: 1.5,
|
|
6006
|
+
padding: 16,
|
|
6007
|
+
alignItems: "center",
|
|
6008
|
+
gap: 4
|
|
6009
|
+
},
|
|
6010
|
+
myBetLabel: {
|
|
6011
|
+
fontSize: 10,
|
|
6012
|
+
fontWeight: "900",
|
|
6013
|
+
letterSpacing: 1.5
|
|
6014
|
+
},
|
|
6015
|
+
myBetTeam: {
|
|
6016
|
+
fontSize: 18,
|
|
6017
|
+
fontWeight: "700"
|
|
6018
|
+
},
|
|
6019
|
+
myBetAmount: {
|
|
6020
|
+
fontSize: 14,
|
|
6021
|
+
fontWeight: "600"
|
|
6022
|
+
},
|
|
5993
6023
|
errorBox: {
|
|
5994
6024
|
marginTop: 16,
|
|
5995
6025
|
borderRadius: 12,
|