@dubsdotapp/expo 0.3.4 → 0.3.5

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 CHANGED
@@ -1266,10 +1266,12 @@ interface EnterArcadePoolSheetProps {
1266
1266
  onDismiss: () => void;
1267
1267
  pool: ArcadePool;
1268
1268
  stats?: ArcadePoolStats | null;
1269
+ leaderboard?: ArcadeLeaderboardEntry[];
1270
+ mode?: 'join' | 'rejoin';
1269
1271
  onSuccess?: (result: EnterArcadePoolMutationResult) => void;
1270
1272
  onError?: (error: Error) => void;
1271
1273
  }
1272
- declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1274
+ declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, leaderboard, mode, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1273
1275
 
1274
1276
  /**
1275
1277
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
package/dist/index.d.ts CHANGED
@@ -1266,10 +1266,12 @@ interface EnterArcadePoolSheetProps {
1266
1266
  onDismiss: () => void;
1267
1267
  pool: ArcadePool;
1268
1268
  stats?: ArcadePoolStats | null;
1269
+ leaderboard?: ArcadeLeaderboardEntry[];
1270
+ mode?: 'join' | 'rejoin';
1269
1271
  onSuccess?: (result: EnterArcadePoolMutationResult) => void;
1270
1272
  onError?: (error: Error) => void;
1271
1273
  }
1272
- declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1274
+ declare function EnterArcadePoolSheet({ visible, onDismiss, pool, stats, leaderboard, mode, onSuccess, onError, }: EnterArcadePoolSheetProps): react_jsx_runtime.JSX.Element;
1273
1275
 
1274
1276
  /**
1275
1277
  * Deserialize a base64-encoded transaction, sign via wallet adapter, send to Solana.
package/dist/index.js CHANGED
@@ -5955,6 +5955,8 @@ function EnterArcadePoolSheet({
5955
5955
  onDismiss,
5956
5956
  pool,
5957
5957
  stats,
5958
+ leaderboard,
5959
+ mode = "join",
5958
5960
  onSuccess,
5959
5961
  onError
5960
5962
  }) {
@@ -6002,6 +6004,10 @@ function EnterArcadePoolSheet({
6002
6004
  }
6003
6005
  }, [wallet.publicKey, mutation.execute, pool.id]);
6004
6006
  const statusLabel = STATUS_LABELS5[mutation.status] || "";
6007
+ const isRejoin = mode === "rejoin";
6008
+ const headerTitle = isRejoin ? "Play Again" : "Join Pool";
6009
+ const ctaLabel = isRejoin ? `Play Again \u2014 ${buyInSol} SOL` : `Join Pool \u2014 ${buyInSol} SOL`;
6010
+ const successLabel = isRejoin ? "Lives refilled!" : "Joined!";
6005
6011
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6006
6012
  import_react_native21.Modal,
6007
6013
  {
@@ -6019,42 +6025,70 @@ function EnterArcadePoolSheet({
6019
6025
  children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.sheet, { backgroundColor: t.background }], children: [
6020
6026
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: styles15.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.handle, { backgroundColor: t.textMuted }] }) }),
6021
6027
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.header, children: [
6022
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.headerTitle, { color: t.text }], children: "Join Pool" }),
6028
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.headerTitle, { color: t.text }], children: headerTitle }),
6023
6029
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.closeButton, { color: t.textMuted }], children: "\u2715" }) })
6024
6030
  ] }),
6025
6031
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.poolName, { color: t.textSecondary }], children: pool.name }),
6026
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
6027
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6028
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
6029
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: [
6030
- buyInSol,
6031
- " SOL"
6032
- ] })
6033
- ] }),
6034
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6035
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6036
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Players in" }),
6037
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: totalPlayers })
6038
- ] }),
6039
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6040
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6041
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
6042
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.success }], children: [
6043
- potSol,
6044
- " SOL"
6045
- ] })
6046
- ] }),
6047
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6048
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6049
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Lives" }),
6050
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: pool.max_lives })
6051
- ] }),
6052
- topScore > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
6032
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.ScrollView, { style: styles15.scrollBody, bounces: false, children: [
6033
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: [styles15.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
6034
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6035
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
6036
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: [
6037
+ buyInSol,
6038
+ " SOL"
6039
+ ] })
6040
+ ] }),
6041
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6042
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6043
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Players in" }),
6044
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: totalPlayers })
6045
+ ] }),
6046
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6047
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6048
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
6049
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.success }], children: [
6050
+ potSol,
6051
+ " SOL"
6052
+ ] })
6053
+ ] }),
6053
6054
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6054
6055
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6055
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Top score" }),
6056
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: topScore })
6056
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Lives" }),
6057
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: pool.max_lives })
6058
+ ] }),
6059
+ topScore > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
6060
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.summarySep, { backgroundColor: t.border }] }),
6061
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.summaryRow, children: [
6062
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryLabel, { color: t.textMuted }], children: "Top score" }),
6063
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.summaryValue, { color: t.text }], children: topScore })
6064
+ ] })
6057
6065
  ] })
6066
+ ] }),
6067
+ leaderboard && leaderboard.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.leaderboardSection, children: [
6068
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.leaderboardTitle, { color: t.text }], children: "Leaderboard" }),
6069
+ leaderboard.map((entry, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6070
+ import_react_native21.View,
6071
+ {
6072
+ style: [
6073
+ styles15.lbRow,
6074
+ { backgroundColor: i % 2 === 0 ? t.surface : "transparent" }
6075
+ ],
6076
+ children: [
6077
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.lbRank, { color: t.textMuted }], children: i === 0 ? "\u{1F947}" : i === 1 ? "\u{1F948}" : i === 2 ? "\u{1F949}" : `${i + 1}` }),
6078
+ entry.avatar ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Image, { source: { uri: entry.avatar }, style: styles15.lbAvatar }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.lbAvatar, { backgroundColor: t.border }] }),
6079
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6080
+ import_react_native21.Text,
6081
+ {
6082
+ style: [styles15.lbName, { color: t.text }],
6083
+ numberOfLines: 1,
6084
+ children: entry.username || `${entry.wallet_address.slice(0, 4)}...${entry.wallet_address.slice(-4)}`
6085
+ }
6086
+ ),
6087
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.lbScore, { color: t.accent }], children: entry.best_score })
6088
+ ]
6089
+ },
6090
+ entry.id
6091
+ ))
6058
6092
  ] })
6059
6093
  ] }),
6060
6094
  mutation.error && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.View, { style: [styles15.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.errorText, { color: t.errorText }], children: mutation.error.message }) }),
@@ -6071,7 +6105,7 @@ function EnterArcadePoolSheet({
6071
6105
  children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.View, { style: styles15.ctaLoading, children: [
6072
6106
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
6073
6107
  /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: statusLabel })
6074
- ] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: "Joined!" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.ctaText, !canJoin && { opacity: 0.5 }], children: `Join Pool \u2014 ${buyInSol} SOL` })
6108
+ ] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: styles15.ctaText, children: successLabel }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_native21.Text, { style: [styles15.ctaText, !canJoin && { opacity: 0.5 }], children: ctaLabel })
6075
6109
  }
6076
6110
  )
6077
6111
  ] }) })
@@ -6137,7 +6171,21 @@ var styles15 = import_react_native21.StyleSheet.create({
6137
6171
  alignItems: "center"
6138
6172
  },
6139
6173
  ctaText: { color: "#FFFFFF", fontSize: 16, fontWeight: "700" },
6140
- ctaLoading: { flexDirection: "row", alignItems: "center", gap: 10 }
6174
+ ctaLoading: { flexDirection: "row", alignItems: "center", gap: 10 },
6175
+ scrollBody: { maxHeight: 400 },
6176
+ leaderboardSection: { marginTop: 16 },
6177
+ leaderboardTitle: { fontSize: 16, fontWeight: "700", marginBottom: 8 },
6178
+ lbRow: {
6179
+ flexDirection: "row",
6180
+ alignItems: "center",
6181
+ paddingVertical: 10,
6182
+ paddingHorizontal: 12,
6183
+ borderRadius: 10
6184
+ },
6185
+ lbRank: { width: 28, fontSize: 15, fontWeight: "700", textAlign: "center" },
6186
+ lbAvatar: { width: 28, height: 28, borderRadius: 14, marginRight: 10 },
6187
+ lbName: { flex: 1, fontSize: 14, fontWeight: "600" },
6188
+ lbScore: { fontSize: 16, fontWeight: "800" }
6141
6189
  });
6142
6190
  // Annotate the CommonJS export names for ESM import in node:
6143
6191
  0 && (module.exports = {