@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.js +48 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/game/JoinGameSheet.tsx +51 -26
- package/src/ui/game/SolSlider.tsx +1 -27
- package/dist/index.d.mts +0 -1477
- package/dist/index.d.ts +0 -1477
package/dist/index.js
CHANGED
|
@@ -5409,10 +5409,6 @@ function SolSlider({
|
|
|
5409
5409
|
const filledWidth = `${ratio * 100}%`;
|
|
5410
5410
|
const markers = [min, max * 0.25, max * 0.5, max * 0.75, max];
|
|
5411
5411
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.container, children: [
|
|
5412
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.valueRow, children: [
|
|
5413
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.valueText, { color: accent }], children: parseFloat(value.toFixed(4)) }),
|
|
5414
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.solLabel, { color: accent }], children: "SOL" })
|
|
5415
|
-
] }),
|
|
5416
5412
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5417
5413
|
import_react_native19.View,
|
|
5418
5414
|
{
|
|
@@ -5468,25 +5464,7 @@ function SolSlider({
|
|
|
5468
5464
|
}
|
|
5469
5465
|
var styles13 = import_react_native19.StyleSheet.create({
|
|
5470
5466
|
container: {
|
|
5471
|
-
paddingVertical:
|
|
5472
|
-
},
|
|
5473
|
-
valueRow: {
|
|
5474
|
-
flexDirection: "row",
|
|
5475
|
-
alignItems: "baseline",
|
|
5476
|
-
justifyContent: "center",
|
|
5477
|
-
marginBottom: 16,
|
|
5478
|
-
gap: 4
|
|
5479
|
-
},
|
|
5480
|
-
valueText: {
|
|
5481
|
-
fontSize: 36,
|
|
5482
|
-
fontWeight: "900",
|
|
5483
|
-
letterSpacing: -1,
|
|
5484
|
-
fontVariant: ["tabular-nums"]
|
|
5485
|
-
},
|
|
5486
|
-
solLabel: {
|
|
5487
|
-
fontSize: 16,
|
|
5488
|
-
fontWeight: "700",
|
|
5489
|
-
opacity: 0.6
|
|
5467
|
+
paddingVertical: 4
|
|
5490
5468
|
},
|
|
5491
5469
|
trackContainer: {
|
|
5492
5470
|
height: THUMB_SIZE + 16,
|
|
@@ -5657,12 +5635,12 @@ function JoinGameSheet({
|
|
|
5657
5635
|
const potentialWinnings = selectedOdds !== "\u2014" ? formatSol(parseFloat(selectedOdds) * wager) : "\u2014";
|
|
5658
5636
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
5659
5637
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
5660
|
-
const
|
|
5661
|
-
|
|
5662
|
-
if (!wallet.publicKey) return false;
|
|
5638
|
+
const myBet = (0, import_react34.useMemo)(() => {
|
|
5639
|
+
if (!wallet.publicKey) return null;
|
|
5663
5640
|
const addr = wallet.publicKey.toBase58();
|
|
5664
|
-
return bettors.
|
|
5641
|
+
return bettors.find((b) => b.wallet === addr) ?? null;
|
|
5665
5642
|
}, [bettors, wallet.publicKey]);
|
|
5643
|
+
const alreadyJoined = myBet !== null;
|
|
5666
5644
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5667
5645
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
|
|
5668
5646
|
const handleJoin = (0, import_react34.useCallback)(async () => {
|
|
@@ -5725,7 +5703,7 @@ function JoinGameSheet({
|
|
|
5725
5703
|
] }) })
|
|
5726
5704
|
] })
|
|
5727
5705
|
] }),
|
|
5728
|
-
!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: [
|
|
5729
5707
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5730
5708
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.teamsRow, children: [
|
|
5731
5709
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -5764,18 +5742,14 @@ function JoinGameSheet({
|
|
|
5764
5742
|
)
|
|
5765
5743
|
] })
|
|
5766
5744
|
] }),
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
{
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
onValueChange: setWager,
|
|
5776
|
-
onTick: onSliderTick
|
|
5777
|
-
}
|
|
5778
|
-
) }),
|
|
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
|
+
] }),
|
|
5779
5753
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5780
5754
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5781
5755
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your wager" }),
|
|
@@ -5799,11 +5773,6 @@ function JoinGameSheet({
|
|
|
5799
5773
|
] })
|
|
5800
5774
|
] })
|
|
5801
5775
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
5802
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5803
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5804
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: selectedName })
|
|
5805
|
-
] }),
|
|
5806
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5807
5776
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5808
5777
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5809
5778
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.text }], children: [
|
|
@@ -5818,6 +5787,18 @@ function JoinGameSheet({
|
|
|
5818
5787
|
] })
|
|
5819
5788
|
] })
|
|
5820
5789
|
] }),
|
|
5790
|
+
selectedTeam && !isPoolModeEnabled && !alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5791
|
+
SolSlider,
|
|
5792
|
+
{
|
|
5793
|
+
value: wager,
|
|
5794
|
+
min: game.buyIn,
|
|
5795
|
+
max: maxWager,
|
|
5796
|
+
step: 0.01,
|
|
5797
|
+
accentColor: selectedTeam === "home" ? homeColor : awayColor,
|
|
5798
|
+
onValueChange: setWager,
|
|
5799
|
+
onTick: onSliderTick
|
|
5800
|
+
}
|
|
5801
|
+
),
|
|
5821
5802
|
alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5822
5803
|
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5823
5804
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
@@ -5999,11 +5980,8 @@ var styles14 = import_react_native20.StyleSheet.create({
|
|
|
5999
5980
|
flexDirection: "row",
|
|
6000
5981
|
gap: 12
|
|
6001
5982
|
},
|
|
6002
|
-
sliderSection: {
|
|
6003
|
-
marginTop: 16
|
|
6004
|
-
},
|
|
6005
5983
|
summaryCard: {
|
|
6006
|
-
marginTop:
|
|
5984
|
+
marginTop: 20,
|
|
6007
5985
|
borderRadius: 16,
|
|
6008
5986
|
borderWidth: 1,
|
|
6009
5987
|
overflow: "hidden"
|
|
@@ -6026,6 +6004,27 @@ var styles14 = import_react_native20.StyleSheet.create({
|
|
|
6026
6004
|
height: 1,
|
|
6027
6005
|
marginHorizontal: 16
|
|
6028
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
|
+
},
|
|
6029
6028
|
errorBox: {
|
|
6030
6029
|
marginTop: 16,
|
|
6031
6030
|
borderRadius: 12,
|