@dubsdotapp/expo 0.5.8 → 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.mjs CHANGED
@@ -5404,10 +5404,6 @@ function SolSlider({
5404
5404
  const filledWidth = `${ratio * 100}%`;
5405
5405
  const markers = [min, max * 0.25, max * 0.5, max * 0.75, max];
5406
5406
  return /* @__PURE__ */ jsxs13(View14, { style: styles13.container, children: [
5407
- /* @__PURE__ */ jsxs13(View14, { style: styles13.valueRow, children: [
5408
- /* @__PURE__ */ jsx16(Text14, { style: [styles13.valueText, { color: accent }], children: parseFloat(value.toFixed(4)) }),
5409
- /* @__PURE__ */ jsx16(Text14, { style: [styles13.solLabel, { color: accent }], children: "SOL" })
5410
- ] }),
5411
5407
  /* @__PURE__ */ jsxs13(
5412
5408
  View14,
5413
5409
  {
@@ -5463,25 +5459,7 @@ function SolSlider({
5463
5459
  }
5464
5460
  var styles13 = StyleSheet14.create({
5465
5461
  container: {
5466
- paddingVertical: 8
5467
- },
5468
- valueRow: {
5469
- flexDirection: "row",
5470
- alignItems: "baseline",
5471
- justifyContent: "center",
5472
- marginBottom: 16,
5473
- gap: 4
5474
- },
5475
- valueText: {
5476
- fontSize: 36,
5477
- fontWeight: "900",
5478
- letterSpacing: -1,
5479
- fontVariant: ["tabular-nums"]
5480
- },
5481
- solLabel: {
5482
- fontSize: 16,
5483
- fontWeight: "700",
5484
- opacity: 0.6
5462
+ paddingVertical: 4
5485
5463
  },
5486
5464
  trackContainer: {
5487
5465
  height: THUMB_SIZE + 16,
@@ -5652,12 +5630,12 @@ function JoinGameSheet({
5652
5630
  const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
5653
5631
  const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
5654
5632
  const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
5655
- const selectedName = selectedTeam === "home" ? homeName : selectedTeam === "away" ? awayName : "\u2014";
5656
- const alreadyJoined = useMemo9(() => {
5657
- if (!wallet.publicKey) return false;
5633
+ const myBet = useMemo9(() => {
5634
+ if (!wallet.publicKey) return null;
5658
5635
  const addr = wallet.publicKey.toBase58();
5659
- return bettors.some((b) => b.wallet === addr);
5636
+ return bettors.find((b) => b.wallet === addr) ?? null;
5660
5637
  }, [bettors, wallet.publicKey]);
5638
+ const alreadyJoined = myBet !== null;
5661
5639
  const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
5662
5640
  const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
5663
5641
  const handleJoin = useCallback24(async () => {
@@ -5720,7 +5698,7 @@ function JoinGameSheet({
5720
5698
  ] }) })
5721
5699
  ] })
5722
5700
  ] }),
5723
- !isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ jsxs14(View15, { style: styles14.section, children: [
5701
+ !isCustomGame && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsxs14(View15, { style: styles14.section, children: [
5724
5702
  /* @__PURE__ */ jsx17(Text15, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
5725
5703
  /* @__PURE__ */ jsxs14(View15, { style: styles14.teamsRow, children: [
5726
5704
  /* @__PURE__ */ jsx17(
@@ -5759,18 +5737,14 @@ function JoinGameSheet({
5759
5737
  )
5760
5738
  ] })
5761
5739
  ] }),
5762
- selectedTeam && !isPoolModeEnabled && /* @__PURE__ */ jsx17(View15, { style: styles14.sliderSection, children: /* @__PURE__ */ jsx17(
5763
- SolSlider,
5764
- {
5765
- value: wager,
5766
- min: game.buyIn,
5767
- max: maxWager,
5768
- step: 0.01,
5769
- accentColor: selectedTeam === "home" ? homeColor : awayColor,
5770
- onValueChange: setWager,
5771
- onTick: onSliderTick
5772
- }
5773
- ) }),
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
+ ] }),
5774
5748
  /* @__PURE__ */ jsxs14(View15, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
5775
5749
  /* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
5776
5750
  /* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
@@ -5794,11 +5768,6 @@ function JoinGameSheet({
5794
5768
  ] })
5795
5769
  ] })
5796
5770
  ] }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
5797
- /* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
5798
- /* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your side" }),
5799
- /* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryValue, { color: t.text }], children: selectedName })
5800
- ] }),
5801
- /* @__PURE__ */ jsx17(View15, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
5802
5771
  /* @__PURE__ */ jsxs14(View15, { style: styles14.summaryRow, children: [
5803
5772
  /* @__PURE__ */ jsx17(Text15, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
5804
5773
  /* @__PURE__ */ jsxs14(Text15, { style: [styles14.summaryValue, { color: t.text }], children: [
@@ -5813,6 +5782,18 @@ function JoinGameSheet({
5813
5782
  ] })
5814
5783
  ] })
5815
5784
  ] }),
5785
+ selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ jsx17(
5786
+ SolSlider,
5787
+ {
5788
+ value: wager,
5789
+ min: game.buyIn,
5790
+ max: maxWager,
5791
+ step: 0.01,
5792
+ accentColor: selectedTeam === "home" ? homeColor : awayColor,
5793
+ onValueChange: setWager,
5794
+ onTick: onSliderTick
5795
+ }
5796
+ ),
5816
5797
  alreadyJoined && /* @__PURE__ */ jsx17(View15, { style: [styles14.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ jsx17(Text15, { style: [styles14.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
5817
5798
  mutation.error && /* @__PURE__ */ jsx17(View15, { style: [styles14.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ jsx17(Text15, { style: [styles14.errorText, { color: t.errorText }], children: mutation.error.message }) }),
5818
5799
  /* @__PURE__ */ jsx17(
@@ -5994,11 +5975,8 @@ var styles14 = StyleSheet15.create({
5994
5975
  flexDirection: "row",
5995
5976
  gap: 12
5996
5977
  },
5997
- sliderSection: {
5998
- marginTop: 16
5999
- },
6000
5978
  summaryCard: {
6001
- marginTop: 12,
5979
+ marginTop: 20,
6002
5980
  borderRadius: 16,
6003
5981
  borderWidth: 1,
6004
5982
  overflow: "hidden"
@@ -6021,6 +5999,27 @@ var styles14 = StyleSheet15.create({
6021
5999
  height: 1,
6022
6000
  marginHorizontal: 16
6023
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
+ },
6024
6023
  errorBox: {
6025
6024
  marginTop: 16,
6026
6025
  borderRadius: 12,