@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/dist/index.js CHANGED
@@ -5635,11 +5635,12 @@ function JoinGameSheet({
5635
5635
  const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
5636
5636
  const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
5637
5637
  const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
5638
- const alreadyJoined = (0, import_react34.useMemo)(() => {
5639
- if (!wallet.publicKey) return false;
5638
+ const myBet = (0, import_react34.useMemo)(() => {
5639
+ if (!wallet.publicKey) return null;
5640
5640
  const addr = wallet.publicKey.toBase58();
5641
- return bettors.some((b) => b.wallet === addr);
5641
+ return bettors.find((b) => b.wallet === addr) ?? null;
5642
5642
  }, [bettors, wallet.publicKey]);
5643
+ const alreadyJoined = myBet !== null;
5643
5644
  const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
5644
5645
  const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
5645
5646
  const handleJoin = (0, import_react34.useCallback)(async () => {
@@ -5702,7 +5703,7 @@ function JoinGameSheet({
5702
5703
  ] }) })
5703
5704
  ] })
5704
5705
  ] }),
5705
- !isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.section, children: [
5706
+ !isCustomGame && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.section, children: [
5706
5707
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
5707
5708
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.teamsRow, children: [
5708
5709
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
@@ -5741,6 +5742,14 @@ function JoinGameSheet({
5741
5742
  )
5742
5743
  ] })
5743
5744
  ] }),
5745
+ alreadyJoined && myBet && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.myBetCard, { backgroundColor: (myBet.team === "home" ? homeColor : awayColor) + "15", borderColor: myBet.team === "home" ? homeColor : awayColor }], children: [
5746
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.myBetLabel, { color: myBet.team === "home" ? homeColor : awayColor }], children: "YOUR BET" }),
5747
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.myBetTeam, { color: t.text }], children: myBet.team === "home" ? homeName : awayName }),
5748
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.myBetAmount, { color: t.textMuted }], children: [
5749
+ formatSol(myBet.amount),
5750
+ " SOL"
5751
+ ] })
5752
+ ] }),
5744
5753
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
5745
5754
  /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
5746
5755
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
@@ -5778,7 +5787,7 @@ function JoinGameSheet({
5778
5787
  ] })
5779
5788
  ] })
5780
5789
  ] }),
5781
- selectedTeam && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5790
+ selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5782
5791
  SolSlider,
5783
5792
  {
5784
5793
  value: wager,
@@ -5995,6 +6004,27 @@ var styles14 = import_react_native20.StyleSheet.create({
5995
6004
  height: 1,
5996
6005
  marginHorizontal: 16
5997
6006
  },
6007
+ myBetCard: {
6008
+ marginTop: 16,
6009
+ borderRadius: 14,
6010
+ borderWidth: 1.5,
6011
+ padding: 16,
6012
+ alignItems: "center",
6013
+ gap: 4
6014
+ },
6015
+ myBetLabel: {
6016
+ fontSize: 10,
6017
+ fontWeight: "900",
6018
+ letterSpacing: 1.5
6019
+ },
6020
+ myBetTeam: {
6021
+ fontSize: 18,
6022
+ fontWeight: "700"
6023
+ },
6024
+ myBetAmount: {
6025
+ fontSize: 14,
6026
+ fontWeight: "600"
6027
+ },
5998
6028
  errorBox: {
5999
6029
  marginTop: 16,
6000
6030
  borderRadius: 12,