@dubsdotapp/expo 0.2.79 → 0.3.0
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 +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +627 -302
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +654 -319
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +30 -0
- package/src/index.ts +5 -2
- package/src/types.ts +53 -0
- package/src/ui/DeveloperDashboardSheet.tsx +353 -0
- package/src/ui/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
CreateCustomGameSheet: () => CreateCustomGameSheet,
|
|
38
38
|
DEFAULT_BASE_URL: () => DEFAULT_BASE_URL,
|
|
39
39
|
DEFAULT_RPC_URL: () => DEFAULT_RPC_URL,
|
|
40
|
+
DeveloperDashboardSheet: () => DeveloperDashboardSheet,
|
|
40
41
|
DubsApiError: () => DubsApiError,
|
|
41
42
|
DubsClient: () => DubsClient,
|
|
42
43
|
DubsProvider: () => DubsProvider,
|
|
@@ -595,6 +596,31 @@ var DubsClient = class {
|
|
|
595
596
|
}
|
|
596
597
|
return config;
|
|
597
598
|
}
|
|
599
|
+
// ── Developer Commissions ──
|
|
600
|
+
/** Fetch paginated list of commission earnings for this app */
|
|
601
|
+
async getCommissions(params) {
|
|
602
|
+
const qs = new URLSearchParams();
|
|
603
|
+
if (params?.limit != null) qs.set("limit", String(params.limit));
|
|
604
|
+
if (params?.offset != null) qs.set("offset", String(params.offset));
|
|
605
|
+
const query = qs.toString();
|
|
606
|
+
const res = await this.request(
|
|
607
|
+
"GET",
|
|
608
|
+
`/commissions${query ? `?${query}` : ""}`
|
|
609
|
+
);
|
|
610
|
+
return {
|
|
611
|
+
commissions: res.commissions,
|
|
612
|
+
summary: res.summary,
|
|
613
|
+
pagination: res.pagination
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
/** Fetch a quick summary of commission earnings for this app */
|
|
617
|
+
async getCommissionsSummary() {
|
|
618
|
+
const res = await this.request(
|
|
619
|
+
"GET",
|
|
620
|
+
"/commissions/summary"
|
|
621
|
+
);
|
|
622
|
+
return res.summary;
|
|
623
|
+
}
|
|
598
624
|
};
|
|
599
625
|
|
|
600
626
|
// src/storage.ts
|
|
@@ -4036,10 +4062,308 @@ var styles5 = import_react_native11.StyleSheet.create({
|
|
|
4036
4062
|
}
|
|
4037
4063
|
});
|
|
4038
4064
|
|
|
4039
|
-
// src/ui/
|
|
4065
|
+
// src/ui/DeveloperDashboardSheet.tsx
|
|
4040
4066
|
var import_react21 = require("react");
|
|
4041
4067
|
var import_react_native12 = require("react-native");
|
|
4042
4068
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
4069
|
+
function DeveloperDashboardSheet({ visible, onDismiss }) {
|
|
4070
|
+
const t = useDubsTheme();
|
|
4071
|
+
const { client } = useDubs();
|
|
4072
|
+
const [summary, setSummary] = (0, import_react21.useState)(null);
|
|
4073
|
+
const [commissions, setCommissions] = (0, import_react21.useState)([]);
|
|
4074
|
+
const [loading, setLoading] = (0, import_react21.useState)(false);
|
|
4075
|
+
const [error, setError] = (0, import_react21.useState)(null);
|
|
4076
|
+
const overlayOpacity = (0, import_react21.useRef)(new import_react_native12.Animated.Value(0)).current;
|
|
4077
|
+
(0, import_react21.useEffect)(() => {
|
|
4078
|
+
import_react_native12.Animated.timing(overlayOpacity, {
|
|
4079
|
+
toValue: visible ? 1 : 0,
|
|
4080
|
+
duration: 250,
|
|
4081
|
+
useNativeDriver: true
|
|
4082
|
+
}).start();
|
|
4083
|
+
}, [visible, overlayOpacity]);
|
|
4084
|
+
const fetchData = (0, import_react21.useCallback)(async () => {
|
|
4085
|
+
setLoading(true);
|
|
4086
|
+
setError(null);
|
|
4087
|
+
try {
|
|
4088
|
+
const result = await client.getCommissions({ limit: 50 });
|
|
4089
|
+
setCommissions(result.commissions);
|
|
4090
|
+
setSummary(result.summary);
|
|
4091
|
+
} catch (err) {
|
|
4092
|
+
setError(err instanceof Error ? err.message : "Failed to load commissions");
|
|
4093
|
+
} finally {
|
|
4094
|
+
setLoading(false);
|
|
4095
|
+
}
|
|
4096
|
+
}, [client]);
|
|
4097
|
+
(0, import_react21.useEffect)(() => {
|
|
4098
|
+
if (visible) fetchData();
|
|
4099
|
+
}, [visible, fetchData]);
|
|
4100
|
+
const formatSol = (sol) => {
|
|
4101
|
+
if (sol === 0) return "0";
|
|
4102
|
+
if (sol < 1e-3) return "<0.001";
|
|
4103
|
+
return sol.toFixed(3);
|
|
4104
|
+
};
|
|
4105
|
+
const renderCommission = ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.row, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4106
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.rowTop, children: [
|
|
4107
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: [styles6.rowGameId, { color: t.text }], numberOfLines: 1, children: [
|
|
4108
|
+
item.gameId.slice(0, 16),
|
|
4109
|
+
"..."
|
|
4110
|
+
] }),
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: [styles6.rowAmount, { color: t.success }], children: [
|
|
4112
|
+
"+",
|
|
4113
|
+
formatSol(item.amountSol),
|
|
4114
|
+
" SOL"
|
|
4115
|
+
] })
|
|
4116
|
+
] }),
|
|
4117
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.rowBottom, children: [
|
|
4118
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: [styles6.rowMeta, { color: t.textMuted }], children: [
|
|
4119
|
+
item.gameType || "game",
|
|
4120
|
+
" | pot ",
|
|
4121
|
+
formatSol(item.potSizeSol),
|
|
4122
|
+
" SOL"
|
|
4123
|
+
] }),
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [
|
|
4125
|
+
styles6.statusBadge,
|
|
4126
|
+
{ backgroundColor: item.status === "paid" ? t.success + "22" : t.accent + "22" }
|
|
4127
|
+
], children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [
|
|
4128
|
+
styles6.statusText,
|
|
4129
|
+
{ color: item.status === "paid" ? t.success : t.accent }
|
|
4130
|
+
], children: item.status }) })
|
|
4131
|
+
] }),
|
|
4132
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.rowDate, { color: t.textDim }], children: new Date(item.createdAt).toLocaleDateString() })
|
|
4133
|
+
] });
|
|
4134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Modal, { visible, animationType: "slide", transparent: true, onRequestClose: onDismiss, children: [
|
|
4135
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Animated.View, { style: [styles6.overlay, { opacity: overlayOpacity }] }),
|
|
4136
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
4137
|
+
import_react_native12.KeyboardAvoidingView,
|
|
4138
|
+
{
|
|
4139
|
+
style: styles6.flex,
|
|
4140
|
+
behavior: import_react_native12.Platform.OS === "ios" ? "padding" : void 0,
|
|
4141
|
+
children: [
|
|
4142
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.flex }),
|
|
4143
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.sheet, { backgroundColor: t.background }], children: [
|
|
4144
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: [styles6.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4145
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.header, children: [
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.headerTitle, { color: t.text }], children: "Commission Earnings" }),
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.TouchableOpacity, { onPress: onDismiss, hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4148
|
+
] }),
|
|
4149
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.summaryRow, children: [
|
|
4150
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.summaryCard, { backgroundColor: t.surface }], children: [
|
|
4151
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.summaryLabel, { color: t.textMuted }], children: "Total Earned" }),
|
|
4152
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: [styles6.summaryValue, { color: t.success }], children: [
|
|
4153
|
+
formatSol(summary.totalEarnedSol),
|
|
4154
|
+
" SOL"
|
|
4155
|
+
] })
|
|
4156
|
+
] }),
|
|
4157
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.summaryCard, { backgroundColor: t.surface }], children: [
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.summaryLabel, { color: t.textMuted }], children: "Games" }),
|
|
4159
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.summaryValue, { color: t.text }], children: summary.totalGames })
|
|
4160
|
+
] }),
|
|
4161
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.summaryCard, { backgroundColor: t.surface }], children: [
|
|
4162
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.summaryLabel, { color: t.textMuted }], children: "Paid" }),
|
|
4163
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.Text, { style: [styles6.summaryValue, { color: t.accent }], children: [
|
|
4164
|
+
formatSol(summary.totalPaidSol),
|
|
4165
|
+
" SOL"
|
|
4166
|
+
] })
|
|
4167
|
+
] })
|
|
4168
|
+
] }),
|
|
4169
|
+
summary?.commissionWallet && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.walletRow, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4170
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.walletLabel, { color: t.textMuted }], children: "Commission Wallet" }),
|
|
4171
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.walletAddress, { color: t.textSecondary }], numberOfLines: 1, children: summary.commissionWallet })
|
|
4172
|
+
] }),
|
|
4173
|
+
loading && !commissions.length ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.View, { style: styles6.centered, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.ActivityIndicator, { size: "large", color: t.accent }) }) : error ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: [styles6.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: [
|
|
4174
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.errorText, { color: t.errorText }], children: error }),
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.TouchableOpacity, { onPress: fetchData, style: [styles6.retryButton, { borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.retryText, { color: t.errorText }], children: "Retry" }) })
|
|
4176
|
+
] }) : commissions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react_native12.View, { style: styles6.centered, children: [
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.emptyTitle, { color: t.textMuted }], children: "No commissions yet" }),
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_native12.Text, { style: [styles6.emptySubtitle, { color: t.textDim }], children: "When games created through your app are resolved, your 1% commission will appear here." })
|
|
4179
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
4180
|
+
import_react_native12.FlatList,
|
|
4181
|
+
{
|
|
4182
|
+
data: commissions,
|
|
4183
|
+
keyExtractor: (item) => String(item.id),
|
|
4184
|
+
renderItem: renderCommission,
|
|
4185
|
+
contentContainerStyle: styles6.listContent,
|
|
4186
|
+
showsVerticalScrollIndicator: false
|
|
4187
|
+
}
|
|
4188
|
+
)
|
|
4189
|
+
] })
|
|
4190
|
+
]
|
|
4191
|
+
}
|
|
4192
|
+
)
|
|
4193
|
+
] });
|
|
4194
|
+
}
|
|
4195
|
+
var styles6 = import_react_native12.StyleSheet.create({
|
|
4196
|
+
flex: { flex: 1 },
|
|
4197
|
+
overlay: {
|
|
4198
|
+
...import_react_native12.StyleSheet.absoluteFillObject,
|
|
4199
|
+
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
4200
|
+
},
|
|
4201
|
+
sheet: {
|
|
4202
|
+
borderTopLeftRadius: 20,
|
|
4203
|
+
borderTopRightRadius: 20,
|
|
4204
|
+
maxHeight: "85%",
|
|
4205
|
+
minHeight: 400,
|
|
4206
|
+
paddingBottom: 34
|
|
4207
|
+
},
|
|
4208
|
+
handleRow: {
|
|
4209
|
+
alignItems: "center",
|
|
4210
|
+
paddingTop: 10,
|
|
4211
|
+
paddingBottom: 6
|
|
4212
|
+
},
|
|
4213
|
+
handle: {
|
|
4214
|
+
width: 36,
|
|
4215
|
+
height: 4,
|
|
4216
|
+
borderRadius: 2,
|
|
4217
|
+
opacity: 0.4
|
|
4218
|
+
},
|
|
4219
|
+
header: {
|
|
4220
|
+
flexDirection: "row",
|
|
4221
|
+
alignItems: "center",
|
|
4222
|
+
justifyContent: "space-between",
|
|
4223
|
+
paddingHorizontal: 20,
|
|
4224
|
+
paddingVertical: 12
|
|
4225
|
+
},
|
|
4226
|
+
headerTitle: {
|
|
4227
|
+
fontSize: 18,
|
|
4228
|
+
fontWeight: "700"
|
|
4229
|
+
},
|
|
4230
|
+
closeButton: {
|
|
4231
|
+
fontSize: 18,
|
|
4232
|
+
fontWeight: "600"
|
|
4233
|
+
},
|
|
4234
|
+
summaryRow: {
|
|
4235
|
+
flexDirection: "row",
|
|
4236
|
+
paddingHorizontal: 16,
|
|
4237
|
+
gap: 8,
|
|
4238
|
+
marginBottom: 12
|
|
4239
|
+
},
|
|
4240
|
+
summaryCard: {
|
|
4241
|
+
flex: 1,
|
|
4242
|
+
borderRadius: 12,
|
|
4243
|
+
padding: 12,
|
|
4244
|
+
alignItems: "center"
|
|
4245
|
+
},
|
|
4246
|
+
summaryLabel: {
|
|
4247
|
+
fontSize: 11,
|
|
4248
|
+
fontWeight: "600",
|
|
4249
|
+
textTransform: "uppercase",
|
|
4250
|
+
letterSpacing: 0.5,
|
|
4251
|
+
marginBottom: 4
|
|
4252
|
+
},
|
|
4253
|
+
summaryValue: {
|
|
4254
|
+
fontSize: 16,
|
|
4255
|
+
fontWeight: "700"
|
|
4256
|
+
},
|
|
4257
|
+
walletRow: {
|
|
4258
|
+
marginHorizontal: 16,
|
|
4259
|
+
borderRadius: 10,
|
|
4260
|
+
borderWidth: 1,
|
|
4261
|
+
padding: 10,
|
|
4262
|
+
marginBottom: 12
|
|
4263
|
+
},
|
|
4264
|
+
walletLabel: {
|
|
4265
|
+
fontSize: 11,
|
|
4266
|
+
fontWeight: "600",
|
|
4267
|
+
textTransform: "uppercase",
|
|
4268
|
+
letterSpacing: 0.5,
|
|
4269
|
+
marginBottom: 2
|
|
4270
|
+
},
|
|
4271
|
+
walletAddress: {
|
|
4272
|
+
fontSize: 12,
|
|
4273
|
+
fontFamily: import_react_native12.Platform.OS === "ios" ? "Menlo" : "monospace"
|
|
4274
|
+
},
|
|
4275
|
+
centered: {
|
|
4276
|
+
flex: 1,
|
|
4277
|
+
justifyContent: "center",
|
|
4278
|
+
alignItems: "center",
|
|
4279
|
+
paddingHorizontal: 32,
|
|
4280
|
+
paddingVertical: 48
|
|
4281
|
+
},
|
|
4282
|
+
emptyTitle: {
|
|
4283
|
+
fontSize: 16,
|
|
4284
|
+
fontWeight: "600",
|
|
4285
|
+
marginBottom: 8
|
|
4286
|
+
},
|
|
4287
|
+
emptySubtitle: {
|
|
4288
|
+
fontSize: 13,
|
|
4289
|
+
textAlign: "center",
|
|
4290
|
+
lineHeight: 18
|
|
4291
|
+
},
|
|
4292
|
+
errorBox: {
|
|
4293
|
+
margin: 16,
|
|
4294
|
+
borderRadius: 10,
|
|
4295
|
+
borderWidth: 1,
|
|
4296
|
+
padding: 16,
|
|
4297
|
+
alignItems: "center"
|
|
4298
|
+
},
|
|
4299
|
+
errorText: {
|
|
4300
|
+
fontSize: 14,
|
|
4301
|
+
marginBottom: 12
|
|
4302
|
+
},
|
|
4303
|
+
retryButton: {
|
|
4304
|
+
borderWidth: 1,
|
|
4305
|
+
borderRadius: 8,
|
|
4306
|
+
paddingHorizontal: 16,
|
|
4307
|
+
paddingVertical: 6
|
|
4308
|
+
},
|
|
4309
|
+
retryText: {
|
|
4310
|
+
fontSize: 13,
|
|
4311
|
+
fontWeight: "600"
|
|
4312
|
+
},
|
|
4313
|
+
listContent: {
|
|
4314
|
+
paddingHorizontal: 16,
|
|
4315
|
+
paddingBottom: 16
|
|
4316
|
+
},
|
|
4317
|
+
row: {
|
|
4318
|
+
borderRadius: 12,
|
|
4319
|
+
borderWidth: 1,
|
|
4320
|
+
padding: 12,
|
|
4321
|
+
marginBottom: 8
|
|
4322
|
+
},
|
|
4323
|
+
rowTop: {
|
|
4324
|
+
flexDirection: "row",
|
|
4325
|
+
justifyContent: "space-between",
|
|
4326
|
+
alignItems: "center",
|
|
4327
|
+
marginBottom: 4
|
|
4328
|
+
},
|
|
4329
|
+
rowGameId: {
|
|
4330
|
+
fontSize: 14,
|
|
4331
|
+
fontWeight: "600",
|
|
4332
|
+
flex: 1,
|
|
4333
|
+
marginRight: 8
|
|
4334
|
+
},
|
|
4335
|
+
rowAmount: {
|
|
4336
|
+
fontSize: 14,
|
|
4337
|
+
fontWeight: "700"
|
|
4338
|
+
},
|
|
4339
|
+
rowBottom: {
|
|
4340
|
+
flexDirection: "row",
|
|
4341
|
+
justifyContent: "space-between",
|
|
4342
|
+
alignItems: "center",
|
|
4343
|
+
marginBottom: 2
|
|
4344
|
+
},
|
|
4345
|
+
rowMeta: {
|
|
4346
|
+
fontSize: 12
|
|
4347
|
+
},
|
|
4348
|
+
statusBadge: {
|
|
4349
|
+
borderRadius: 6,
|
|
4350
|
+
paddingHorizontal: 8,
|
|
4351
|
+
paddingVertical: 2
|
|
4352
|
+
},
|
|
4353
|
+
statusText: {
|
|
4354
|
+
fontSize: 11,
|
|
4355
|
+
fontWeight: "600",
|
|
4356
|
+
textTransform: "uppercase"
|
|
4357
|
+
},
|
|
4358
|
+
rowDate: {
|
|
4359
|
+
fontSize: 11
|
|
4360
|
+
}
|
|
4361
|
+
});
|
|
4362
|
+
|
|
4363
|
+
// src/ui/game/GamePoster.tsx
|
|
4364
|
+
var import_react22 = require("react");
|
|
4365
|
+
var import_react_native13 = require("react-native");
|
|
4366
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
4043
4367
|
function computeCountdown(lockTimestamp) {
|
|
4044
4368
|
if (!lockTimestamp) return "";
|
|
4045
4369
|
const ts = typeof lockTimestamp === "string" ? parseInt(lockTimestamp) : lockTimestamp;
|
|
@@ -4060,38 +4384,38 @@ function GamePoster({ game, ImageComponent }) {
|
|
|
4060
4384
|
const away = opponents[1];
|
|
4061
4385
|
const countdown = computeCountdown(game.lockTimestamp);
|
|
4062
4386
|
const isLive = countdown === "LIVE";
|
|
4063
|
-
return /* @__PURE__ */ (0,
|
|
4064
|
-
game.media?.poster ? /* @__PURE__ */ (0,
|
|
4387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.container, children: [
|
|
4388
|
+
game.media?.poster ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4065
4389
|
Img,
|
|
4066
4390
|
{
|
|
4067
4391
|
source: { uri: game.media.poster },
|
|
4068
|
-
style:
|
|
4392
|
+
style: styles7.image,
|
|
4069
4393
|
resizeMode: "cover"
|
|
4070
4394
|
}
|
|
4071
|
-
) : /* @__PURE__ */ (0,
|
|
4072
|
-
/* @__PURE__ */ (0,
|
|
4073
|
-
/* @__PURE__ */ (0,
|
|
4074
|
-
/* @__PURE__ */ (0,
|
|
4395
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.image, { backgroundColor: t.surface }], children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.fallback, children: [
|
|
4396
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TeamLogoInternal, { url: home?.imageUrl, size: 56, Img }),
|
|
4397
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: styles7.vs, children: "VS" }),
|
|
4398
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TeamLogoInternal, { url: away?.imageUrl, size: 56, Img })
|
|
4075
4399
|
] }) }),
|
|
4076
|
-
/* @__PURE__ */ (0,
|
|
4077
|
-
/* @__PURE__ */ (0,
|
|
4078
|
-
/* @__PURE__ */ (0,
|
|
4079
|
-
/* @__PURE__ */ (0,
|
|
4080
|
-
/* @__PURE__ */ (0,
|
|
4400
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: styles7.overlay }),
|
|
4401
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.View, { style: styles7.teamNames, children: [
|
|
4402
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: styles7.teamNameText, numberOfLines: 1, children: home?.name || "Home" }),
|
|
4403
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: styles7.teamNameVs, children: "vs" }),
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: styles7.teamNameText, numberOfLines: 1, children: away?.name || "Away" })
|
|
4081
4405
|
] }),
|
|
4082
|
-
countdown ? /* @__PURE__ */ (0,
|
|
4083
|
-
/* @__PURE__ */ (0,
|
|
4406
|
+
countdown ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: styles7.countdownPill, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.Text, { style: [styles7.countdownText, isLive && styles7.countdownLive], children: countdown }) }) : null,
|
|
4407
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: styles7.poolPill, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_native13.Text, { style: styles7.poolText, children: [
|
|
4084
4408
|
game.totalPool || 0,
|
|
4085
4409
|
" SOL"
|
|
4086
4410
|
] }) })
|
|
4087
4411
|
] });
|
|
4088
4412
|
}
|
|
4089
4413
|
function TeamLogoInternal({ url, size, Img }) {
|
|
4090
|
-
const [failed, setFailed] = (0,
|
|
4414
|
+
const [failed, setFailed] = (0, import_react22.useState)(false);
|
|
4091
4415
|
if (!url || failed) {
|
|
4092
|
-
return /* @__PURE__ */ (0,
|
|
4416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native13.View, { style: [styles7.logoPlaceholder, { width: size, height: size, borderRadius: size / 2 }] });
|
|
4093
4417
|
}
|
|
4094
|
-
return /* @__PURE__ */ (0,
|
|
4418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4095
4419
|
Img,
|
|
4096
4420
|
{
|
|
4097
4421
|
source: { uri: url },
|
|
@@ -4101,7 +4425,7 @@ function TeamLogoInternal({ url, size, Img }) {
|
|
|
4101
4425
|
}
|
|
4102
4426
|
);
|
|
4103
4427
|
}
|
|
4104
|
-
var
|
|
4428
|
+
var styles7 = import_react_native13.StyleSheet.create({
|
|
4105
4429
|
container: {
|
|
4106
4430
|
height: 200,
|
|
4107
4431
|
borderRadius: 16,
|
|
@@ -4109,12 +4433,12 @@ var styles6 = import_react_native12.StyleSheet.create({
|
|
|
4109
4433
|
position: "relative"
|
|
4110
4434
|
},
|
|
4111
4435
|
image: {
|
|
4112
|
-
...
|
|
4436
|
+
...import_react_native13.StyleSheet.absoluteFillObject,
|
|
4113
4437
|
justifyContent: "center",
|
|
4114
4438
|
alignItems: "center"
|
|
4115
4439
|
},
|
|
4116
4440
|
overlay: {
|
|
4117
|
-
...
|
|
4441
|
+
...import_react_native13.StyleSheet.absoluteFillObject,
|
|
4118
4442
|
backgroundColor: "rgba(0,0,0,0.35)"
|
|
4119
4443
|
},
|
|
4120
4444
|
fallback: {
|
|
@@ -4188,9 +4512,9 @@ var styles6 = import_react_native12.StyleSheet.create({
|
|
|
4188
4512
|
});
|
|
4189
4513
|
|
|
4190
4514
|
// src/ui/game/LivePoolsCard.tsx
|
|
4191
|
-
var
|
|
4192
|
-
var
|
|
4193
|
-
var
|
|
4515
|
+
var import_react23 = require("react");
|
|
4516
|
+
var import_react_native14 = require("react-native");
|
|
4517
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
4194
4518
|
function LivePoolsCard({
|
|
4195
4519
|
game,
|
|
4196
4520
|
shortName,
|
|
@@ -4204,7 +4528,7 @@ function LivePoolsCard({
|
|
|
4204
4528
|
const homePool = game.homePool || 0;
|
|
4205
4529
|
const awayPool = game.awayPool || 0;
|
|
4206
4530
|
const totalPool = game.totalPool || 0;
|
|
4207
|
-
const { homePercent, awayPercent, homeOdds, awayOdds } = (0,
|
|
4531
|
+
const { homePercent, awayPercent, homeOdds, awayOdds } = (0, import_react23.useMemo)(() => {
|
|
4208
4532
|
return {
|
|
4209
4533
|
homePercent: totalPool > 0 ? homePool / totalPool * 100 : 50,
|
|
4210
4534
|
awayPercent: totalPool > 0 ? awayPool / totalPool * 100 : 50,
|
|
@@ -4212,29 +4536,29 @@ function LivePoolsCard({
|
|
|
4212
4536
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014"
|
|
4213
4537
|
};
|
|
4214
4538
|
}, [homePool, awayPool, totalPool]);
|
|
4215
|
-
return /* @__PURE__ */ (0,
|
|
4216
|
-
/* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: [styles8.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4540
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.title, { color: t.text }], children: "Live Pools" }),
|
|
4541
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.total, { color: t.accent }], children: [
|
|
4218
4542
|
totalPool,
|
|
4219
4543
|
" SOL total"
|
|
4220
4544
|
] }),
|
|
4221
|
-
/* @__PURE__ */ (0,
|
|
4222
|
-
/* @__PURE__ */ (0,
|
|
4223
|
-
/* @__PURE__ */ (0,
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.bars, children: [
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PoolBar, { name: homeName, amount: homePool, percent: homePercent, color: homeColor, t }),
|
|
4547
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PoolBar, { name: awayName, amount: awayPool, percent: awayPercent, color: awayColor, t })
|
|
4224
4548
|
] }),
|
|
4225
|
-
/* @__PURE__ */ (0,
|
|
4226
|
-
/* @__PURE__ */ (0,
|
|
4549
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.oddsRow, children: [
|
|
4550
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.oddsText, { color: t.textMuted }], children: [
|
|
4227
4551
|
homeName,
|
|
4228
4552
|
": ",
|
|
4229
|
-
/* @__PURE__ */ (0,
|
|
4553
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4230
4554
|
homeOdds,
|
|
4231
4555
|
"x"
|
|
4232
4556
|
] })
|
|
4233
4557
|
] }),
|
|
4234
|
-
/* @__PURE__ */ (0,
|
|
4558
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.oddsText, { color: t.textMuted }], children: [
|
|
4235
4559
|
awayName,
|
|
4236
4560
|
": ",
|
|
4237
|
-
/* @__PURE__ */ (0,
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: { color: t.text, fontWeight: "700" }, children: [
|
|
4238
4562
|
awayOdds,
|
|
4239
4563
|
"x"
|
|
4240
4564
|
] })
|
|
@@ -4243,16 +4567,16 @@ function LivePoolsCard({
|
|
|
4243
4567
|
] });
|
|
4244
4568
|
}
|
|
4245
4569
|
function PoolBar({ name, amount, percent, color, t }) {
|
|
4246
|
-
return /* @__PURE__ */ (0,
|
|
4247
|
-
/* @__PURE__ */ (0,
|
|
4248
|
-
/* @__PURE__ */ (0,
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.View, { style: styles8.barRow, children: [
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.Text, { style: [styles8.barLabel, { color: t.textSecondary }], numberOfLines: 1, children: name }),
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.barTrack, { backgroundColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_native14.View, { style: [styles8.barFill, { width: `${Math.max(percent, 2)}%`, backgroundColor: color }] }) }),
|
|
4573
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native14.Text, { style: [styles8.barAmount, { color: t.text }], children: [
|
|
4250
4574
|
amount,
|
|
4251
4575
|
" SOL"
|
|
4252
4576
|
] })
|
|
4253
4577
|
] });
|
|
4254
4578
|
}
|
|
4255
|
-
var
|
|
4579
|
+
var styles8 = import_react_native14.StyleSheet.create({
|
|
4256
4580
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4257
4581
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 4 },
|
|
4258
4582
|
total: { fontSize: 14, fontWeight: "600", marginBottom: 14 },
|
|
@@ -4267,9 +4591,9 @@ var styles7 = import_react_native13.StyleSheet.create({
|
|
|
4267
4591
|
});
|
|
4268
4592
|
|
|
4269
4593
|
// src/ui/game/PickWinnerCard.tsx
|
|
4270
|
-
var
|
|
4271
|
-
var
|
|
4272
|
-
var
|
|
4594
|
+
var import_react24 = require("react");
|
|
4595
|
+
var import_react_native15 = require("react-native");
|
|
4596
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4273
4597
|
function PickWinnerCard({
|
|
4274
4598
|
game,
|
|
4275
4599
|
selectedTeam,
|
|
@@ -4285,7 +4609,7 @@ function PickWinnerCard({
|
|
|
4285
4609
|
const totalPool = game.totalPool || 0;
|
|
4286
4610
|
const homePool = game.homePool || 0;
|
|
4287
4611
|
const awayPool = game.awayPool || 0;
|
|
4288
|
-
const { homeOdds, awayOdds, homeBets, awayBets } = (0,
|
|
4612
|
+
const { homeOdds, awayOdds, homeBets, awayBets } = (0, import_react24.useMemo)(() => ({
|
|
4289
4613
|
homeOdds: homePool > 0 ? (totalPool / homePool).toFixed(2) : "\u2014",
|
|
4290
4614
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014",
|
|
4291
4615
|
homeBets: bettors.filter((b) => b.team === "home").length,
|
|
@@ -4293,10 +4617,10 @@ function PickWinnerCard({
|
|
|
4293
4617
|
}), [totalPool, homePool, awayPool, bettors]);
|
|
4294
4618
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4295
4619
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4296
|
-
return /* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4298
|
-
/* @__PURE__ */ (0,
|
|
4299
|
-
/* @__PURE__ */ (0,
|
|
4620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: [styles9.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4621
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.title, { color: t.text }], children: "Pick Your Winner" }),
|
|
4622
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.View, { style: styles9.row, children: [
|
|
4623
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4300
4624
|
TeamOption,
|
|
4301
4625
|
{
|
|
4302
4626
|
name: homeName,
|
|
@@ -4310,7 +4634,7 @@ function PickWinnerCard({
|
|
|
4310
4634
|
t
|
|
4311
4635
|
}
|
|
4312
4636
|
),
|
|
4313
|
-
/* @__PURE__ */ (0,
|
|
4637
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4314
4638
|
TeamOption,
|
|
4315
4639
|
{
|
|
4316
4640
|
name: awayName,
|
|
@@ -4338,33 +4662,33 @@ function TeamOption({
|
|
|
4338
4662
|
ImageComponent,
|
|
4339
4663
|
t
|
|
4340
4664
|
}) {
|
|
4341
|
-
const [imgFailed, setImgFailed] = (0,
|
|
4665
|
+
const [imgFailed, setImgFailed] = (0, import_react24.useState)(false);
|
|
4342
4666
|
const Img = ImageComponent || require("react-native").Image;
|
|
4343
4667
|
const showImage = imageUrl && !imgFailed;
|
|
4344
|
-
return /* @__PURE__ */ (0,
|
|
4345
|
-
|
|
4668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
4669
|
+
import_react_native15.TouchableOpacity,
|
|
4346
4670
|
{
|
|
4347
|
-
style: [
|
|
4671
|
+
style: [styles9.option, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
4348
4672
|
onPress,
|
|
4349
4673
|
activeOpacity: 0.7,
|
|
4350
4674
|
children: [
|
|
4351
|
-
showImage ? /* @__PURE__ */ (0,
|
|
4352
|
-
/* @__PURE__ */ (0,
|
|
4353
|
-
/* @__PURE__ */ (0,
|
|
4675
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Img, { source: { uri: imageUrl }, style: styles9.logo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.logo, styles9.logoPlaceholder] }),
|
|
4676
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: [styles9.name, { color: t.text }], numberOfLines: 1, children: name }),
|
|
4677
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.odds, { color }], children: [
|
|
4354
4678
|
odds,
|
|
4355
4679
|
"x"
|
|
4356
4680
|
] }),
|
|
4357
|
-
/* @__PURE__ */ (0,
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react_native15.Text, { style: [styles9.bets, { color: t.textMuted }], children: [
|
|
4358
4682
|
bets,
|
|
4359
4683
|
" ",
|
|
4360
4684
|
bets === 1 ? "bet" : "bets"
|
|
4361
4685
|
] }),
|
|
4362
|
-
selected && /* @__PURE__ */ (0,
|
|
4686
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.View, { style: [styles9.badge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_native15.Text, { style: styles9.badgeText, children: "Selected" }) })
|
|
4363
4687
|
]
|
|
4364
4688
|
}
|
|
4365
4689
|
);
|
|
4366
4690
|
}
|
|
4367
|
-
var
|
|
4691
|
+
var styles9 = import_react_native15.StyleSheet.create({
|
|
4368
4692
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4369
4693
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4370
4694
|
row: { flexDirection: "row", gap: 12 },
|
|
@@ -4379,9 +4703,9 @@ var styles8 = import_react_native14.StyleSheet.create({
|
|
|
4379
4703
|
});
|
|
4380
4704
|
|
|
4381
4705
|
// src/ui/game/PlayersCard.tsx
|
|
4382
|
-
var
|
|
4383
|
-
var
|
|
4384
|
-
var
|
|
4706
|
+
var import_react25 = require("react");
|
|
4707
|
+
var import_react_native16 = require("react-native");
|
|
4708
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
4385
4709
|
function truncateWallet(addr, chars) {
|
|
4386
4710
|
if (addr.length <= chars * 2 + 3) return addr;
|
|
4387
4711
|
return `${addr.slice(0, chars)}...${addr.slice(-chars)}`;
|
|
@@ -4401,12 +4725,12 @@ function PlayersCard({
|
|
|
4401
4725
|
if (team === "away") return awayColor;
|
|
4402
4726
|
return drawColor;
|
|
4403
4727
|
};
|
|
4404
|
-
return /* @__PURE__ */ (0,
|
|
4405
|
-
/* @__PURE__ */ (0,
|
|
4728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: [styles10.card, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4729
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.Text, { style: [styles10.title, { color: t.text }], children: [
|
|
4406
4730
|
"Players",
|
|
4407
4731
|
bettors.length > 0 ? ` (${bettors.length})` : ""
|
|
4408
4732
|
] }),
|
|
4409
|
-
bettors.length === 0 ? /* @__PURE__ */ (0,
|
|
4733
|
+
bettors.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.empty, { color: t.textMuted }], children: "No players yet \u2014 be the first!" }) : bettors.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4410
4734
|
BettorRow,
|
|
4411
4735
|
{
|
|
4412
4736
|
bettor: b,
|
|
@@ -4428,20 +4752,20 @@ function BettorRow({
|
|
|
4428
4752
|
ImageComponent,
|
|
4429
4753
|
t
|
|
4430
4754
|
}) {
|
|
4431
|
-
const [imgFailed, setImgFailed] = (0,
|
|
4755
|
+
const [imgFailed, setImgFailed] = (0, import_react25.useState)(false);
|
|
4432
4756
|
const Img = ImageComponent || require("react-native").Image;
|
|
4433
4757
|
const showAvatar = bettor.avatar && !imgFailed;
|
|
4434
|
-
return /* @__PURE__ */ (0,
|
|
4435
|
-
/* @__PURE__ */ (0,
|
|
4436
|
-
showAvatar ? /* @__PURE__ */ (0,
|
|
4437
|
-
/* @__PURE__ */ (0,
|
|
4438
|
-
/* @__PURE__ */ (0,
|
|
4758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.View, { style: [styles10.row, !isFirst && { borderTopColor: t.border, borderTopWidth: 1 }], children: [
|
|
4759
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.View, { style: [styles10.dot, { backgroundColor: dotColor }] }),
|
|
4760
|
+
showAvatar ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Img, { source: { uri: ensurePngAvatar(bettor.avatar) }, style: styles10.avatar, resizeMode: "cover", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.View, { style: [styles10.avatar, styles10.avatarPlaceholder] }),
|
|
4761
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.View, { style: styles10.nameCol, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react_native16.Text, { style: [styles10.username, { color: t.text }], numberOfLines: 1, children: bettor.username || truncateWallet(bettor.wallet, truncateChars) }) }),
|
|
4762
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_native16.Text, { style: [styles10.amount, { color: t.textSecondary }], children: [
|
|
4439
4763
|
bettor.amount,
|
|
4440
4764
|
" SOL"
|
|
4441
4765
|
] })
|
|
4442
4766
|
] });
|
|
4443
4767
|
}
|
|
4444
|
-
var
|
|
4768
|
+
var styles10 = import_react_native16.StyleSheet.create({
|
|
4445
4769
|
card: { borderRadius: 16, borderWidth: 1, padding: 16 },
|
|
4446
4770
|
title: { fontSize: 17, fontWeight: "700", marginBottom: 12 },
|
|
4447
4771
|
empty: { fontSize: 14, textAlign: "center", paddingVertical: 16 },
|
|
@@ -4455,9 +4779,9 @@ var styles9 = import_react_native15.StyleSheet.create({
|
|
|
4455
4779
|
});
|
|
4456
4780
|
|
|
4457
4781
|
// src/ui/game/JoinGameButton.tsx
|
|
4458
|
-
var
|
|
4459
|
-
var
|
|
4460
|
-
var
|
|
4782
|
+
var import_react26 = require("react");
|
|
4783
|
+
var import_react_native17 = require("react-native");
|
|
4784
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
4461
4785
|
var STATUS_LABELS = {
|
|
4462
4786
|
building: "Building transaction...",
|
|
4463
4787
|
signing: "Approve in wallet...",
|
|
@@ -4466,37 +4790,37 @@ var STATUS_LABELS = {
|
|
|
4466
4790
|
};
|
|
4467
4791
|
function JoinGameButton({ game, walletAddress, selectedTeam, status, onJoin }) {
|
|
4468
4792
|
const t = useDubsTheme();
|
|
4469
|
-
const alreadyJoined = (0,
|
|
4793
|
+
const alreadyJoined = (0, import_react26.useMemo)(() => {
|
|
4470
4794
|
if (!walletAddress) return false;
|
|
4471
4795
|
return (game.bettors || []).some((b) => b.wallet === walletAddress);
|
|
4472
4796
|
}, [game.bettors, walletAddress]);
|
|
4473
4797
|
if (alreadyJoined || game.isLocked || game.isResolved) return null;
|
|
4474
4798
|
const isJoining = status !== "idle" && status !== "success" && status !== "error";
|
|
4475
4799
|
const statusLabel = STATUS_LABELS[status] || "";
|
|
4476
|
-
return /* @__PURE__ */ (0,
|
|
4477
|
-
/* @__PURE__ */ (0,
|
|
4478
|
-
/* @__PURE__ */ (0,
|
|
4479
|
-
/* @__PURE__ */ (0,
|
|
4800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: [styles11.bar, { backgroundColor: t.background, borderTopColor: t.border }], children: [
|
|
4801
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.buyInRow, children: [
|
|
4802
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.buyInLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
4803
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.Text, { style: [styles11.buyInValue, { color: t.text }], children: [
|
|
4480
4804
|
game.buyIn,
|
|
4481
4805
|
" SOL"
|
|
4482
4806
|
] })
|
|
4483
4807
|
] }),
|
|
4484
|
-
/* @__PURE__ */ (0,
|
|
4485
|
-
|
|
4808
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4809
|
+
import_react_native17.TouchableOpacity,
|
|
4486
4810
|
{
|
|
4487
|
-
style: [
|
|
4811
|
+
style: [styles11.button, { backgroundColor: selectedTeam ? t.accent : t.border }],
|
|
4488
4812
|
disabled: !selectedTeam || isJoining,
|
|
4489
4813
|
onPress: onJoin,
|
|
4490
4814
|
activeOpacity: 0.8,
|
|
4491
|
-
children: isJoining ? /* @__PURE__ */ (0,
|
|
4492
|
-
/* @__PURE__ */ (0,
|
|
4493
|
-
/* @__PURE__ */ (0,
|
|
4494
|
-
] }) : /* @__PURE__ */ (0,
|
|
4815
|
+
children: isJoining ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native17.View, { style: styles11.joiningRow, children: [
|
|
4816
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.ActivityIndicator, { size: "small", color: "#000" }),
|
|
4817
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: styles11.buttonText, children: statusLabel })
|
|
4818
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native17.Text, { style: [styles11.buttonText, !selectedTeam && { color: t.textMuted }], children: selectedTeam ? `Join Bet \u2014 ${game.buyIn} SOL` : "Pick a team to bet" })
|
|
4495
4819
|
}
|
|
4496
4820
|
)
|
|
4497
4821
|
] });
|
|
4498
4822
|
}
|
|
4499
|
-
var
|
|
4823
|
+
var styles11 = import_react_native17.StyleSheet.create({
|
|
4500
4824
|
bar: { position: "absolute", bottom: 0, left: 0, right: 0, paddingHorizontal: 16, paddingTop: 12, paddingBottom: 36, borderTopWidth: 1 },
|
|
4501
4825
|
buyInRow: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", marginBottom: 10 },
|
|
4502
4826
|
buyInLabel: { fontSize: 13 },
|
|
@@ -4507,9 +4831,9 @@ var styles10 = import_react_native16.StyleSheet.create({
|
|
|
4507
4831
|
});
|
|
4508
4832
|
|
|
4509
4833
|
// src/ui/game/CreateCustomGameSheet.tsx
|
|
4510
|
-
var
|
|
4511
|
-
var
|
|
4512
|
-
var
|
|
4834
|
+
var import_react27 = require("react");
|
|
4835
|
+
var import_react_native18 = require("react-native");
|
|
4836
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
4513
4837
|
var STATUS_LABELS2 = {
|
|
4514
4838
|
building: "Building transaction...",
|
|
4515
4839
|
signing: "Approve in wallet...",
|
|
@@ -4533,18 +4857,18 @@ function CreateCustomGameSheet({
|
|
|
4533
4857
|
const t = useDubsTheme();
|
|
4534
4858
|
const { wallet } = useDubs();
|
|
4535
4859
|
const mutation = useCreateCustomGame();
|
|
4536
|
-
const [selectedAmount, setSelectedAmount] = (0,
|
|
4537
|
-
const [customAmount, setCustomAmount] = (0,
|
|
4538
|
-
const [isCustom, setIsCustom] = (0,
|
|
4539
|
-
const overlayOpacity = (0,
|
|
4540
|
-
(0,
|
|
4541
|
-
|
|
4860
|
+
const [selectedAmount, setSelectedAmount] = (0, import_react27.useState)(null);
|
|
4861
|
+
const [customAmount, setCustomAmount] = (0, import_react27.useState)("");
|
|
4862
|
+
const [isCustom, setIsCustom] = (0, import_react27.useState)(false);
|
|
4863
|
+
const overlayOpacity = (0, import_react27.useRef)(new import_react_native18.Animated.Value(0)).current;
|
|
4864
|
+
(0, import_react27.useEffect)(() => {
|
|
4865
|
+
import_react_native18.Animated.timing(overlayOpacity, {
|
|
4542
4866
|
toValue: visible ? 1 : 0,
|
|
4543
4867
|
duration: 250,
|
|
4544
4868
|
useNativeDriver: true
|
|
4545
4869
|
}).start();
|
|
4546
4870
|
}, [visible, overlayOpacity]);
|
|
4547
|
-
(0,
|
|
4871
|
+
(0, import_react27.useEffect)(() => {
|
|
4548
4872
|
if (visible) {
|
|
4549
4873
|
setSelectedAmount(defaultAmount ?? null);
|
|
4550
4874
|
setCustomAmount("");
|
|
@@ -4552,7 +4876,7 @@ function CreateCustomGameSheet({
|
|
|
4552
4876
|
mutation.reset();
|
|
4553
4877
|
}
|
|
4554
4878
|
}, [visible]);
|
|
4555
|
-
(0,
|
|
4879
|
+
(0, import_react27.useEffect)(() => {
|
|
4556
4880
|
if (mutation.status === "success" && mutation.data) {
|
|
4557
4881
|
onSuccess?.(mutation.data);
|
|
4558
4882
|
const timer = setTimeout(() => {
|
|
@@ -4561,23 +4885,23 @@ function CreateCustomGameSheet({
|
|
|
4561
4885
|
return () => clearTimeout(timer);
|
|
4562
4886
|
}
|
|
4563
4887
|
}, [mutation.status, mutation.data]);
|
|
4564
|
-
(0,
|
|
4888
|
+
(0, import_react27.useEffect)(() => {
|
|
4565
4889
|
if (mutation.status === "error" && mutation.error) {
|
|
4566
4890
|
onError?.(mutation.error);
|
|
4567
4891
|
}
|
|
4568
4892
|
}, [mutation.status, mutation.error]);
|
|
4569
|
-
const handlePresetSelect = (0,
|
|
4893
|
+
const handlePresetSelect = (0, import_react27.useCallback)((amount) => {
|
|
4570
4894
|
setSelectedAmount(amount);
|
|
4571
4895
|
setIsCustom(false);
|
|
4572
4896
|
setCustomAmount("");
|
|
4573
4897
|
onAmountChange?.(amount);
|
|
4574
4898
|
}, [onAmountChange]);
|
|
4575
|
-
const handleCustomSelect = (0,
|
|
4899
|
+
const handleCustomSelect = (0, import_react27.useCallback)(() => {
|
|
4576
4900
|
setIsCustom(true);
|
|
4577
4901
|
setSelectedAmount(null);
|
|
4578
4902
|
onAmountChange?.(null);
|
|
4579
4903
|
}, [onAmountChange]);
|
|
4580
|
-
const handleCustomAmountChange = (0,
|
|
4904
|
+
const handleCustomAmountChange = (0, import_react27.useCallback)((text) => {
|
|
4581
4905
|
const cleaned = text.replace(/[^0-9.]/g, "").replace(/(\..*?)\..*/g, "$1");
|
|
4582
4906
|
setCustomAmount(cleaned);
|
|
4583
4907
|
const parsed = parseFloat(cleaned);
|
|
@@ -4592,7 +4916,7 @@ function CreateCustomGameSheet({
|
|
|
4592
4916
|
const winnerTakes = pot * (1 - fee / 100);
|
|
4593
4917
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
4594
4918
|
const canCreate = finalAmount !== null && finalAmount > 0 && !isMutating && mutation.status !== "success";
|
|
4595
|
-
const handleCreate = (0,
|
|
4919
|
+
const handleCreate = (0, import_react27.useCallback)(async () => {
|
|
4596
4920
|
if (!finalAmount || !wallet.publicKey) return;
|
|
4597
4921
|
try {
|
|
4598
4922
|
await mutation.execute({
|
|
@@ -4608,42 +4932,42 @@ function CreateCustomGameSheet({
|
|
|
4608
4932
|
}, [finalAmount, wallet.publicKey, mutation.execute, title, maxPlayers, metadata]);
|
|
4609
4933
|
const statusLabel = STATUS_LABELS2[mutation.status] || "";
|
|
4610
4934
|
const playersLabel = playerCount === 2 ? "2 (1v1)" : `${playerCount} players`;
|
|
4611
|
-
return /* @__PURE__ */ (0,
|
|
4612
|
-
|
|
4935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
4936
|
+
import_react_native18.Modal,
|
|
4613
4937
|
{
|
|
4614
4938
|
visible,
|
|
4615
4939
|
animationType: "slide",
|
|
4616
4940
|
transparent: true,
|
|
4617
4941
|
onRequestClose: onDismiss,
|
|
4618
4942
|
children: [
|
|
4619
|
-
/* @__PURE__ */ (0,
|
|
4620
|
-
/* @__PURE__ */ (0,
|
|
4621
|
-
|
|
4943
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Animated.View, { style: [styles12.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { style: styles12.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
4944
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4945
|
+
import_react_native18.KeyboardAvoidingView,
|
|
4622
4946
|
{
|
|
4623
|
-
style:
|
|
4624
|
-
behavior:
|
|
4625
|
-
children: /* @__PURE__ */ (0,
|
|
4626
|
-
/* @__PURE__ */ (0,
|
|
4627
|
-
/* @__PURE__ */ (0,
|
|
4628
|
-
/* @__PURE__ */ (0,
|
|
4629
|
-
/* @__PURE__ */ (0,
|
|
4947
|
+
style: styles12.keyboardView,
|
|
4948
|
+
behavior: import_react_native18.Platform.OS === "ios" ? "padding" : void 0,
|
|
4949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.sheet, { backgroundColor: t.background }], children: [
|
|
4950
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: styles12.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4951
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.header, children: [
|
|
4952
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Create Pool" : "New Game" }),
|
|
4953
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4630
4954
|
] }),
|
|
4631
|
-
!isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4632
|
-
/* @__PURE__ */ (0,
|
|
4633
|
-
/* @__PURE__ */ (0,
|
|
4955
|
+
!isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.section, children: [
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.sectionLabel, { color: t.textSecondary }], children: "Buy-In Amount" }),
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.chipsRow, children: [
|
|
4634
4958
|
presetAmounts.map((amount) => {
|
|
4635
4959
|
const active = !isCustom && selectedAmount === amount;
|
|
4636
|
-
return /* @__PURE__ */ (0,
|
|
4637
|
-
|
|
4960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4961
|
+
import_react_native18.TouchableOpacity,
|
|
4638
4962
|
{
|
|
4639
4963
|
style: [
|
|
4640
|
-
|
|
4964
|
+
styles12.chip,
|
|
4641
4965
|
{ borderColor: active ? t.accent : t.border },
|
|
4642
4966
|
active && { backgroundColor: t.accent }
|
|
4643
4967
|
],
|
|
4644
4968
|
onPress: () => handlePresetSelect(amount),
|
|
4645
4969
|
activeOpacity: 0.8,
|
|
4646
|
-
children: /* @__PURE__ */ (0,
|
|
4970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.chipText, { color: active ? "#FFFFFF" : t.text }], children: [
|
|
4647
4971
|
amount,
|
|
4648
4972
|
" SOL"
|
|
4649
4973
|
] })
|
|
@@ -4651,24 +4975,24 @@ function CreateCustomGameSheet({
|
|
|
4651
4975
|
amount
|
|
4652
4976
|
);
|
|
4653
4977
|
}),
|
|
4654
|
-
/* @__PURE__ */ (0,
|
|
4655
|
-
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4979
|
+
import_react_native18.TouchableOpacity,
|
|
4656
4980
|
{
|
|
4657
4981
|
style: [
|
|
4658
|
-
|
|
4982
|
+
styles12.chip,
|
|
4659
4983
|
{ borderColor: isCustom ? t.accent : t.border },
|
|
4660
4984
|
isCustom && { backgroundColor: t.accent }
|
|
4661
4985
|
],
|
|
4662
4986
|
onPress: handleCustomSelect,
|
|
4663
4987
|
activeOpacity: 0.8,
|
|
4664
|
-
children: /* @__PURE__ */ (0,
|
|
4988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.chipText, { color: isCustom ? "#FFFFFF" : t.text }], children: "Custom" })
|
|
4665
4989
|
}
|
|
4666
4990
|
)
|
|
4667
4991
|
] }),
|
|
4668
|
-
isCustom && /* @__PURE__ */ (0,
|
|
4669
|
-
|
|
4992
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
4993
|
+
import_react_native18.TextInput,
|
|
4670
4994
|
{
|
|
4671
|
-
style: [
|
|
4995
|
+
style: [styles12.input, { backgroundColor: t.surface, color: t.text, borderColor: t.accent }],
|
|
4672
4996
|
placeholder: "Enter amount in SOL",
|
|
4673
4997
|
placeholderTextColor: t.textDim,
|
|
4674
4998
|
keyboardType: "decimal-pad",
|
|
@@ -4678,43 +5002,43 @@ function CreateCustomGameSheet({
|
|
|
4678
5002
|
}
|
|
4679
5003
|
)
|
|
4680
5004
|
] }),
|
|
4681
|
-
/* @__PURE__ */ (0,
|
|
4682
|
-
/* @__PURE__ */ (0,
|
|
4683
|
-
/* @__PURE__ */ (0,
|
|
4684
|
-
/* @__PURE__ */ (0,
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: [styles12.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: finalAmount ? `${finalAmount} SOL` : "\u2014" })
|
|
4685
5009
|
] }),
|
|
4686
|
-
/* @__PURE__ */ (0,
|
|
4687
|
-
/* @__PURE__ */ (0,
|
|
4688
|
-
/* @__PURE__ */ (0,
|
|
4689
|
-
/* @__PURE__ */ (0,
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5012
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max players" : "Players" }),
|
|
5013
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.text }], children: isPoolModeEnabled ? playerCount : playersLabel })
|
|
4690
5014
|
] }),
|
|
4691
|
-
/* @__PURE__ */ (0,
|
|
4692
|
-
/* @__PURE__ */ (0,
|
|
4693
|
-
/* @__PURE__ */ (0,
|
|
4694
|
-
/* @__PURE__ */ (0,
|
|
4695
|
-
/* @__PURE__ */ (0,
|
|
4696
|
-
finalAmount ? /* @__PURE__ */ (0,
|
|
5015
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.summarySep, { backgroundColor: t.border }] }),
|
|
5016
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.summaryRow, children: [
|
|
5017
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryLabel, { color: t.textMuted }], children: isPoolModeEnabled ? "Max pot" : "Winner Takes" }),
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.winnerCol, children: [
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.summaryValue, { color: t.success }], children: finalAmount ? `${(finalAmount * playerCount * (1 - fee / 100)).toFixed(4)} SOL` : "\u2014" }),
|
|
5020
|
+
finalAmount ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.Text, { style: [styles12.feeNote, { color: t.textDim }], children: [
|
|
4697
5021
|
fee,
|
|
4698
5022
|
"% platform fee"
|
|
4699
5023
|
] }) : null
|
|
4700
5024
|
] })
|
|
4701
5025
|
] })
|
|
4702
5026
|
] }),
|
|
4703
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
4704
|
-
/* @__PURE__ */ (0,
|
|
4705
|
-
|
|
5027
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.View, { style: [styles12.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
5029
|
+
import_react_native18.TouchableOpacity,
|
|
4706
5030
|
{
|
|
4707
5031
|
style: [
|
|
4708
|
-
|
|
5032
|
+
styles12.ctaButton,
|
|
4709
5033
|
{ backgroundColor: canCreate ? t.accent : t.border }
|
|
4710
5034
|
],
|
|
4711
5035
|
disabled: !canCreate,
|
|
4712
5036
|
onPress: handleCreate,
|
|
4713
5037
|
activeOpacity: 0.8,
|
|
4714
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
4715
|
-
/* @__PURE__ */ (0,
|
|
4716
|
-
/* @__PURE__ */ (0,
|
|
4717
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5038
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_native18.View, { style: styles12.ctaLoading, children: [
|
|
5039
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5040
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: statusLabel })
|
|
5041
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: styles12.ctaText, children: isPoolModeEnabled ? "Pool Created!" : STATUS_LABELS2.success }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native18.Text, { style: [styles12.ctaText, !canCreate && { opacity: 0.5 }], children: isPoolModeEnabled ? `Create Pool \u2014 ${finalAmount} SOL` : effectiveAmount ? `Create Game \u2014 ${effectiveAmount} SOL` : "Select buy-in amount" })
|
|
4718
5042
|
}
|
|
4719
5043
|
)
|
|
4720
5044
|
] }) })
|
|
@@ -4724,9 +5048,9 @@ function CreateCustomGameSheet({
|
|
|
4724
5048
|
}
|
|
4725
5049
|
);
|
|
4726
5050
|
}
|
|
4727
|
-
var
|
|
5051
|
+
var styles12 = import_react_native18.StyleSheet.create({
|
|
4728
5052
|
overlay: {
|
|
4729
|
-
...
|
|
5053
|
+
...import_react_native18.StyleSheet.absoluteFillObject,
|
|
4730
5054
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
4731
5055
|
},
|
|
4732
5056
|
overlayTap: {
|
|
@@ -4861,9 +5185,9 @@ var styles11 = import_react_native17.StyleSheet.create({
|
|
|
4861
5185
|
});
|
|
4862
5186
|
|
|
4863
5187
|
// src/ui/game/JoinGameSheet.tsx
|
|
4864
|
-
var
|
|
4865
|
-
var
|
|
4866
|
-
var
|
|
5188
|
+
var import_react28 = require("react");
|
|
5189
|
+
var import_react_native19 = require("react-native");
|
|
5190
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
4867
5191
|
var STATUS_LABELS3 = {
|
|
4868
5192
|
building: "Building transaction...",
|
|
4869
5193
|
signing: "Approve in wallet...",
|
|
@@ -4887,22 +5211,22 @@ function JoinGameSheet({
|
|
|
4887
5211
|
const { wallet } = useDubs();
|
|
4888
5212
|
const mutation = useJoinGame();
|
|
4889
5213
|
const isCustomGame = game.gameMode === CUSTOM_GAME_MODE;
|
|
4890
|
-
const [selectedTeam, setSelectedTeam] = (0,
|
|
4891
|
-
const overlayOpacity = (0,
|
|
4892
|
-
(0,
|
|
4893
|
-
|
|
5214
|
+
const [selectedTeam, setSelectedTeam] = (0, import_react28.useState)(null);
|
|
5215
|
+
const overlayOpacity = (0, import_react28.useRef)(new import_react_native19.Animated.Value(0)).current;
|
|
5216
|
+
(0, import_react28.useEffect)(() => {
|
|
5217
|
+
import_react_native19.Animated.timing(overlayOpacity, {
|
|
4894
5218
|
toValue: visible ? 1 : 0,
|
|
4895
5219
|
duration: 250,
|
|
4896
5220
|
useNativeDriver: true
|
|
4897
5221
|
}).start();
|
|
4898
5222
|
}, [visible, overlayOpacity]);
|
|
4899
|
-
(0,
|
|
5223
|
+
(0, import_react28.useEffect)(() => {
|
|
4900
5224
|
if (visible) {
|
|
4901
5225
|
setSelectedTeam(isPoolModeEnabled ? "home" : isCustomGame ? "away" : null);
|
|
4902
5226
|
mutation.reset();
|
|
4903
5227
|
}
|
|
4904
5228
|
}, [visible]);
|
|
4905
|
-
(0,
|
|
5229
|
+
(0, import_react28.useEffect)(() => {
|
|
4906
5230
|
if (mutation.status === "success" && mutation.data) {
|
|
4907
5231
|
onSuccess?.(mutation.data);
|
|
4908
5232
|
const timer = setTimeout(() => {
|
|
@@ -4911,7 +5235,7 @@ function JoinGameSheet({
|
|
|
4911
5235
|
return () => clearTimeout(timer);
|
|
4912
5236
|
}
|
|
4913
5237
|
}, [mutation.status, mutation.data]);
|
|
4914
|
-
(0,
|
|
5238
|
+
(0, import_react28.useEffect)(() => {
|
|
4915
5239
|
if (mutation.status === "error" && mutation.error) {
|
|
4916
5240
|
onError?.(mutation.error);
|
|
4917
5241
|
}
|
|
@@ -4922,7 +5246,7 @@ function JoinGameSheet({
|
|
|
4922
5246
|
const homePool = game.homePool || 0;
|
|
4923
5247
|
const awayPool = game.awayPool || 0;
|
|
4924
5248
|
const buyIn = game.buyIn;
|
|
4925
|
-
const { homeOdds, awayOdds, homeBets, awayBets } = (0,
|
|
5249
|
+
const { homeOdds, awayOdds, homeBets, awayBets } = (0, import_react28.useMemo)(() => ({
|
|
4926
5250
|
homeOdds: homePool > 0 ? (totalPool / homePool).toFixed(2) : "\u2014",
|
|
4927
5251
|
awayOdds: awayPool > 0 ? (totalPool / awayPool).toFixed(2) : "\u2014",
|
|
4928
5252
|
homeBets: bettors.filter((b) => b.team === "home").length,
|
|
@@ -4934,14 +5258,14 @@ function JoinGameSheet({
|
|
|
4934
5258
|
const homeName = shortName ? shortName(opponents[0]?.name) : opponents[0]?.name || "Home";
|
|
4935
5259
|
const awayName = shortName ? shortName(opponents[1]?.name) : opponents[1]?.name || "Away";
|
|
4936
5260
|
const selectedName = selectedTeam === "home" ? homeName : selectedTeam === "away" ? awayName : "\u2014";
|
|
4937
|
-
const alreadyJoined = (0,
|
|
5261
|
+
const alreadyJoined = (0, import_react28.useMemo)(() => {
|
|
4938
5262
|
if (!wallet.publicKey) return false;
|
|
4939
5263
|
const addr = wallet.publicKey.toBase58();
|
|
4940
5264
|
return bettors.some((b) => b.wallet === addr);
|
|
4941
5265
|
}, [bettors, wallet.publicKey]);
|
|
4942
5266
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
4943
5267
|
const canJoin = selectedTeam !== null && !isMutating && mutation.status !== "success" && !alreadyJoined;
|
|
4944
|
-
const handleJoin = (0,
|
|
5268
|
+
const handleJoin = (0, import_react28.useCallback)(async () => {
|
|
4945
5269
|
if (!selectedTeam || !wallet.publicKey) return;
|
|
4946
5270
|
try {
|
|
4947
5271
|
await mutation.execute({
|
|
@@ -4954,30 +5278,30 @@ function JoinGameSheet({
|
|
|
4954
5278
|
}
|
|
4955
5279
|
}, [selectedTeam, wallet.publicKey, mutation.execute, game.gameId, buyIn]);
|
|
4956
5280
|
const statusLabel = STATUS_LABELS3[mutation.status] || "";
|
|
4957
|
-
return /* @__PURE__ */ (0,
|
|
4958
|
-
|
|
5281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5282
|
+
import_react_native19.Modal,
|
|
4959
5283
|
{
|
|
4960
5284
|
visible,
|
|
4961
5285
|
animationType: "slide",
|
|
4962
5286
|
transparent: true,
|
|
4963
5287
|
onRequestClose: onDismiss,
|
|
4964
5288
|
children: [
|
|
4965
|
-
/* @__PURE__ */ (0,
|
|
4966
|
-
/* @__PURE__ */ (0,
|
|
4967
|
-
|
|
5289
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Animated.View, { style: [styles13.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { style: styles13.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5290
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5291
|
+
import_react_native19.KeyboardAvoidingView,
|
|
4968
5292
|
{
|
|
4969
|
-
style:
|
|
4970
|
-
behavior:
|
|
4971
|
-
children: /* @__PURE__ */ (0,
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
4973
|
-
/* @__PURE__ */ (0,
|
|
4974
|
-
/* @__PURE__ */ (0,
|
|
4975
|
-
/* @__PURE__ */ (0,
|
|
5293
|
+
style: styles13.keyboardView,
|
|
5294
|
+
behavior: import_react_native19.Platform.OS === "ios" ? "padding" : void 0,
|
|
5295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.sheet, { backgroundColor: t.background }], children: [
|
|
5296
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: styles13.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5297
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.header, children: [
|
|
5298
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.headerTitle, { color: t.text }], children: isPoolModeEnabled ? "Join Pool" : "Join Game" }),
|
|
5299
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4976
5300
|
] }),
|
|
4977
|
-
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0,
|
|
4978
|
-
/* @__PURE__ */ (0,
|
|
4979
|
-
/* @__PURE__ */ (0,
|
|
4980
|
-
/* @__PURE__ */ (0,
|
|
5301
|
+
!isCustomGame && !isPoolModeEnabled && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.section, children: [
|
|
5302
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.sectionLabel, { color: t.textSecondary }], children: "Pick Your Side" }),
|
|
5303
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.teamsRow, children: [
|
|
5304
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4981
5305
|
TeamButton,
|
|
4982
5306
|
{
|
|
4983
5307
|
name: homeName,
|
|
@@ -4991,7 +5315,7 @@ function JoinGameSheet({
|
|
|
4991
5315
|
t
|
|
4992
5316
|
}
|
|
4993
5317
|
),
|
|
4994
|
-
/* @__PURE__ */ (0,
|
|
5318
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
4995
5319
|
TeamButton,
|
|
4996
5320
|
{
|
|
4997
5321
|
name: awayName,
|
|
@@ -5007,64 +5331,64 @@ function JoinGameSheet({
|
|
|
5007
5331
|
)
|
|
5008
5332
|
] })
|
|
5009
5333
|
] }),
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
5012
|
-
/* @__PURE__ */ (0,
|
|
5013
|
-
/* @__PURE__ */ (0,
|
|
5334
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: [styles13.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5335
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5336
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Buy-in" }),
|
|
5337
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.text }], children: [
|
|
5014
5338
|
buyIn,
|
|
5015
5339
|
" SOL"
|
|
5016
5340
|
] })
|
|
5017
5341
|
] }),
|
|
5018
|
-
/* @__PURE__ */ (0,
|
|
5019
|
-
isPoolModeEnabled ? /* @__PURE__ */ (0,
|
|
5020
|
-
/* @__PURE__ */ (0,
|
|
5021
|
-
/* @__PURE__ */ (0,
|
|
5022
|
-
/* @__PURE__ */ (0,
|
|
5342
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5343
|
+
isPoolModeEnabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5344
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5345
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Players in" }),
|
|
5346
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.text }], children: bettors.length })
|
|
5023
5347
|
] }),
|
|
5024
|
-
/* @__PURE__ */ (0,
|
|
5025
|
-
/* @__PURE__ */ (0,
|
|
5026
|
-
/* @__PURE__ */ (0,
|
|
5027
|
-
/* @__PURE__ */ (0,
|
|
5348
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5349
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5350
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Current pot" }),
|
|
5351
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.success }], children: [
|
|
5028
5352
|
totalPool,
|
|
5029
5353
|
" SOL"
|
|
5030
5354
|
] })
|
|
5031
5355
|
] })
|
|
5032
|
-
] }) : /* @__PURE__ */ (0,
|
|
5033
|
-
/* @__PURE__ */ (0,
|
|
5034
|
-
/* @__PURE__ */ (0,
|
|
5035
|
-
/* @__PURE__ */ (0,
|
|
5356
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5357
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5358
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Your side" }),
|
|
5359
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.text }], children: selectedName })
|
|
5036
5360
|
] }),
|
|
5037
|
-
/* @__PURE__ */ (0,
|
|
5038
|
-
/* @__PURE__ */ (0,
|
|
5039
|
-
/* @__PURE__ */ (0,
|
|
5040
|
-
/* @__PURE__ */ (0,
|
|
5361
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5362
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5363
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Total pool" }),
|
|
5364
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.text }], children: [
|
|
5041
5365
|
poolAfterJoin,
|
|
5042
5366
|
" SOL"
|
|
5043
5367
|
] })
|
|
5044
5368
|
] }),
|
|
5045
|
-
/* @__PURE__ */ (0,
|
|
5046
|
-
/* @__PURE__ */ (0,
|
|
5047
|
-
/* @__PURE__ */ (0,
|
|
5048
|
-
/* @__PURE__ */ (0,
|
|
5369
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.summarySep, { backgroundColor: t.border }] }),
|
|
5370
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.summaryRow, children: [
|
|
5371
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryLabel, { color: t.textMuted }], children: "Potential winnings" }),
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.summaryValue, { color: t.success }], children: potentialWinnings !== "\u2014" ? `${potentialWinnings} SOL` : "\u2014" })
|
|
5049
5373
|
] })
|
|
5050
5374
|
] })
|
|
5051
5375
|
] }),
|
|
5052
|
-
alreadyJoined && /* @__PURE__ */ (0,
|
|
5053
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5054
|
-
/* @__PURE__ */ (0,
|
|
5055
|
-
|
|
5376
|
+
alreadyJoined && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.errorBox, { backgroundColor: t.surface, borderColor: t.border }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.errorText, { color: t.textMuted }], children: isPoolModeEnabled ? "You've already joined this pool." : "You've already joined this game." }) }),
|
|
5377
|
+
mutation.error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.errorBox, { backgroundColor: t.errorBg, borderColor: t.errorBorder }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.errorText, { color: t.errorText }], children: mutation.error.message }) }),
|
|
5378
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5379
|
+
import_react_native19.TouchableOpacity,
|
|
5056
5380
|
{
|
|
5057
5381
|
style: [
|
|
5058
|
-
|
|
5382
|
+
styles13.ctaButton,
|
|
5059
5383
|
{ backgroundColor: canJoin ? t.accent : t.border }
|
|
5060
5384
|
],
|
|
5061
5385
|
disabled: !canJoin,
|
|
5062
5386
|
onPress: handleJoin,
|
|
5063
5387
|
activeOpacity: 0.8,
|
|
5064
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5065
|
-
/* @__PURE__ */ (0,
|
|
5066
|
-
/* @__PURE__ */ (0,
|
|
5067
|
-
] }) : mutation.status === "success" ? /* @__PURE__ */ (0,
|
|
5388
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.View, { style: styles13.ctaLoading, children: [
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5390
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.ctaText, children: statusLabel })
|
|
5391
|
+
] }) : mutation.status === "success" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.ctaText, children: isPoolModeEnabled ? "Joined!" : STATUS_LABELS3.success }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.ctaText, !canJoin && { opacity: 0.5 }], children: alreadyJoined ? "Already Joined" : isPoolModeEnabled ? `Join Pool \u2014 ${buyIn} SOL` : selectedTeam ? `Join Game \u2014 ${buyIn} SOL` : "Pick a side to join" })
|
|
5068
5392
|
}
|
|
5069
5393
|
)
|
|
5070
5394
|
] }) })
|
|
@@ -5085,35 +5409,35 @@ function TeamButton({
|
|
|
5085
5409
|
ImageComponent,
|
|
5086
5410
|
t
|
|
5087
5411
|
}) {
|
|
5088
|
-
const [imgFailed, setImgFailed] = (0,
|
|
5412
|
+
const [imgFailed, setImgFailed] = (0, import_react28.useState)(false);
|
|
5089
5413
|
const Img = ImageComponent || require("react-native").Image;
|
|
5090
5414
|
const showImage = imageUrl && !imgFailed;
|
|
5091
|
-
return /* @__PURE__ */ (0,
|
|
5092
|
-
|
|
5415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5416
|
+
import_react_native19.TouchableOpacity,
|
|
5093
5417
|
{
|
|
5094
|
-
style: [
|
|
5418
|
+
style: [styles13.teamOption, { borderColor: selected ? color : t.border, backgroundColor: selected ? color + "15" : t.background }],
|
|
5095
5419
|
onPress,
|
|
5096
5420
|
activeOpacity: 0.7,
|
|
5097
5421
|
children: [
|
|
5098
|
-
showImage ? /* @__PURE__ */ (0,
|
|
5099
|
-
/* @__PURE__ */ (0,
|
|
5100
|
-
/* @__PURE__ */ (0,
|
|
5422
|
+
showImage ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Img, { source: { uri: imageUrl }, style: styles13.teamLogo, resizeMode: "contain", onError: () => setImgFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.teamLogo, styles13.teamLogoPlaceholder] }),
|
|
5423
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: [styles13.teamName, { color: t.text }], numberOfLines: 1, children: name }),
|
|
5424
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.teamOdds, { color }], children: [
|
|
5101
5425
|
odds,
|
|
5102
5426
|
"x"
|
|
5103
5427
|
] }),
|
|
5104
|
-
/* @__PURE__ */ (0,
|
|
5428
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_native19.Text, { style: [styles13.teamBets, { color: t.textMuted }], children: [
|
|
5105
5429
|
bets,
|
|
5106
5430
|
" ",
|
|
5107
5431
|
bets === 1 ? "bet" : "bets"
|
|
5108
5432
|
] }),
|
|
5109
|
-
selected && /* @__PURE__ */ (0,
|
|
5433
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.View, { style: [styles13.teamBadge, { backgroundColor: color }], children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_native19.Text, { style: styles13.teamBadgeText, children: "Selected" }) })
|
|
5110
5434
|
]
|
|
5111
5435
|
}
|
|
5112
5436
|
);
|
|
5113
5437
|
}
|
|
5114
|
-
var
|
|
5438
|
+
var styles13 = import_react_native19.StyleSheet.create({
|
|
5115
5439
|
overlay: {
|
|
5116
|
-
...
|
|
5440
|
+
...import_react_native19.StyleSheet.absoluteFillObject,
|
|
5117
5441
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5118
5442
|
},
|
|
5119
5443
|
overlayTap: {
|
|
@@ -5262,9 +5586,9 @@ var styles12 = import_react_native18.StyleSheet.create({
|
|
|
5262
5586
|
});
|
|
5263
5587
|
|
|
5264
5588
|
// src/ui/game/ClaimPrizeSheet.tsx
|
|
5265
|
-
var
|
|
5266
|
-
var
|
|
5267
|
-
var
|
|
5589
|
+
var import_react29 = require("react");
|
|
5590
|
+
var import_react_native20 = require("react-native");
|
|
5591
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5268
5592
|
var STATUS_LABELS4 = {
|
|
5269
5593
|
building: "Building transaction...",
|
|
5270
5594
|
signing: "Approve in wallet...",
|
|
@@ -5283,18 +5607,18 @@ function ClaimPrizeSheet({
|
|
|
5283
5607
|
const t = useDubsTheme();
|
|
5284
5608
|
const { wallet } = useDubs();
|
|
5285
5609
|
const mutation = useClaim();
|
|
5286
|
-
const overlayOpacity = (0,
|
|
5287
|
-
const celebrationScale = (0,
|
|
5288
|
-
const celebrationOpacity = (0,
|
|
5289
|
-
const [showCelebration, setShowCelebration] = (0,
|
|
5290
|
-
(0,
|
|
5291
|
-
|
|
5610
|
+
const overlayOpacity = (0, import_react29.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5611
|
+
const celebrationScale = (0, import_react29.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5612
|
+
const celebrationOpacity = (0, import_react29.useRef)(new import_react_native20.Animated.Value(0)).current;
|
|
5613
|
+
const [showCelebration, setShowCelebration] = (0, import_react29.useState)(false);
|
|
5614
|
+
(0, import_react29.useEffect)(() => {
|
|
5615
|
+
import_react_native20.Animated.timing(overlayOpacity, {
|
|
5292
5616
|
toValue: visible ? 1 : 0,
|
|
5293
5617
|
duration: 250,
|
|
5294
5618
|
useNativeDriver: true
|
|
5295
5619
|
}).start();
|
|
5296
5620
|
}, [visible, overlayOpacity]);
|
|
5297
|
-
(0,
|
|
5621
|
+
(0, import_react29.useEffect)(() => {
|
|
5298
5622
|
if (visible) {
|
|
5299
5623
|
mutation.reset();
|
|
5300
5624
|
setShowCelebration(false);
|
|
@@ -5302,17 +5626,17 @@ function ClaimPrizeSheet({
|
|
|
5302
5626
|
celebrationOpacity.setValue(0);
|
|
5303
5627
|
}
|
|
5304
5628
|
}, [visible]);
|
|
5305
|
-
(0,
|
|
5629
|
+
(0, import_react29.useEffect)(() => {
|
|
5306
5630
|
if (mutation.status === "success" && mutation.data) {
|
|
5307
5631
|
setShowCelebration(true);
|
|
5308
|
-
|
|
5309
|
-
|
|
5632
|
+
import_react_native20.Animated.parallel([
|
|
5633
|
+
import_react_native20.Animated.spring(celebrationScale, {
|
|
5310
5634
|
toValue: 1,
|
|
5311
5635
|
tension: 50,
|
|
5312
5636
|
friction: 6,
|
|
5313
5637
|
useNativeDriver: true
|
|
5314
5638
|
}),
|
|
5315
|
-
|
|
5639
|
+
import_react_native20.Animated.timing(celebrationOpacity, {
|
|
5316
5640
|
toValue: 1,
|
|
5317
5641
|
duration: 300,
|
|
5318
5642
|
useNativeDriver: true
|
|
@@ -5325,14 +5649,14 @@ function ClaimPrizeSheet({
|
|
|
5325
5649
|
return () => clearTimeout(timer);
|
|
5326
5650
|
}
|
|
5327
5651
|
}, [mutation.status, mutation.data]);
|
|
5328
|
-
(0,
|
|
5652
|
+
(0, import_react29.useEffect)(() => {
|
|
5329
5653
|
if (mutation.status === "error" && mutation.error) {
|
|
5330
5654
|
onError?.(mutation.error);
|
|
5331
5655
|
}
|
|
5332
5656
|
}, [mutation.status, mutation.error]);
|
|
5333
5657
|
const isMutating = mutation.status !== "idle" && mutation.status !== "success" && mutation.status !== "error";
|
|
5334
5658
|
const canClaim = !isMutating && mutation.status !== "success" && !!wallet.publicKey;
|
|
5335
|
-
const handleClaim = (0,
|
|
5659
|
+
const handleClaim = (0, import_react29.useCallback)(async () => {
|
|
5336
5660
|
if (!wallet.publicKey) return;
|
|
5337
5661
|
try {
|
|
5338
5662
|
await mutation.execute({
|
|
@@ -5344,62 +5668,62 @@ function ClaimPrizeSheet({
|
|
|
5344
5668
|
}
|
|
5345
5669
|
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
5346
5670
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
5347
|
-
return /* @__PURE__ */ (0,
|
|
5348
|
-
|
|
5671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5672
|
+
import_react_native20.Modal,
|
|
5349
5673
|
{
|
|
5350
5674
|
visible,
|
|
5351
5675
|
animationType: "slide",
|
|
5352
5676
|
transparent: true,
|
|
5353
5677
|
onRequestClose: onDismiss,
|
|
5354
5678
|
children: [
|
|
5355
|
-
/* @__PURE__ */ (0,
|
|
5356
|
-
/* @__PURE__ */ (0,
|
|
5357
|
-
|
|
5679
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Animated.View, { style: [styles14.overlay, { opacity: overlayOpacity }], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.TouchableOpacity, { style: styles14.overlayTap, activeOpacity: 1, onPress: onDismiss }) }),
|
|
5680
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5681
|
+
import_react_native20.KeyboardAvoidingView,
|
|
5358
5682
|
{
|
|
5359
|
-
style:
|
|
5360
|
-
behavior:
|
|
5361
|
-
children: /* @__PURE__ */ (0,
|
|
5362
|
-
/* @__PURE__ */ (0,
|
|
5363
|
-
/* @__PURE__ */ (0,
|
|
5364
|
-
/* @__PURE__ */ (0,
|
|
5365
|
-
/* @__PURE__ */ (0,
|
|
5683
|
+
style: styles14.keyboardView,
|
|
5684
|
+
behavior: import_react_native20.Platform.OS === "ios" ? "padding" : void 0,
|
|
5685
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.sheetPositioner, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.sheet, { backgroundColor: t.background }], children: [
|
|
5686
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: styles14.handleRow, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.handle, { backgroundColor: t.textMuted }] }) }),
|
|
5687
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.header, children: [
|
|
5688
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
5689
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.TouchableOpacity, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
5366
5690
|
] }),
|
|
5367
|
-
showCelebration && /* @__PURE__ */ (0,
|
|
5368
|
-
|
|
5691
|
+
showCelebration && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5692
|
+
import_react_native20.Animated.View,
|
|
5369
5693
|
{
|
|
5370
5694
|
style: [
|
|
5371
|
-
|
|
5695
|
+
styles14.celebrationContainer,
|
|
5372
5696
|
{
|
|
5373
5697
|
opacity: celebrationOpacity,
|
|
5374
5698
|
transform: [{ scale: celebrationScale }]
|
|
5375
5699
|
}
|
|
5376
5700
|
],
|
|
5377
5701
|
children: [
|
|
5378
|
-
/* @__PURE__ */ (0,
|
|
5379
|
-
/* @__PURE__ */ (0,
|
|
5702
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.celebrationEmoji, children: "\u{1F3C6}" }),
|
|
5703
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.celebrationText, { color: t.success }], children: [
|
|
5380
5704
|
"+",
|
|
5381
5705
|
prizeAmount,
|
|
5382
5706
|
" SOL"
|
|
5383
5707
|
] }),
|
|
5384
|
-
/* @__PURE__ */ (0,
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
5385
5709
|
]
|
|
5386
5710
|
}
|
|
5387
5711
|
),
|
|
5388
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5389
|
-
/* @__PURE__ */ (0,
|
|
5390
|
-
/* @__PURE__ */ (0,
|
|
5391
|
-
/* @__PURE__ */ (0,
|
|
5712
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: [styles14.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
5713
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5714
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.summaryValue, { color: t.success }], children: [
|
|
5392
5716
|
prizeAmount,
|
|
5393
5717
|
" SOL"
|
|
5394
5718
|
] })
|
|
5395
5719
|
] }),
|
|
5396
|
-
/* @__PURE__ */ (0,
|
|
5397
|
-
/* @__PURE__ */ (0,
|
|
5398
|
-
/* @__PURE__ */ (0,
|
|
5399
|
-
/* @__PURE__ */ (0,
|
|
5400
|
-
|
|
5720
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.View, { style: [styles14.summarySep, { backgroundColor: t.border }] }),
|
|
5721
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.summaryRow, children: [
|
|
5722
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.summaryLabel, { color: t.textMuted }], children: "Game" }),
|
|
5723
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5724
|
+
import_react_native20.Text,
|
|
5401
5725
|
{
|
|
5402
|
-
style: [
|
|
5726
|
+
style: [styles14.summaryValue, { color: t.text }],
|
|
5403
5727
|
numberOfLines: 1,
|
|
5404
5728
|
children: [
|
|
5405
5729
|
gameId.slice(0, 8),
|
|
@@ -5410,21 +5734,21 @@ function ClaimPrizeSheet({
|
|
|
5410
5734
|
)
|
|
5411
5735
|
] })
|
|
5412
5736
|
] }),
|
|
5413
|
-
mutation.error && /* @__PURE__ */ (0,
|
|
5414
|
-
!showCelebration && /* @__PURE__ */ (0,
|
|
5415
|
-
|
|
5737
|
+
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 }) }),
|
|
5738
|
+
!showCelebration && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
5739
|
+
import_react_native20.TouchableOpacity,
|
|
5416
5740
|
{
|
|
5417
5741
|
style: [
|
|
5418
|
-
|
|
5742
|
+
styles14.ctaButton,
|
|
5419
5743
|
{ backgroundColor: canClaim ? t.accent : t.border }
|
|
5420
5744
|
],
|
|
5421
5745
|
disabled: !canClaim,
|
|
5422
5746
|
onPress: handleClaim,
|
|
5423
5747
|
activeOpacity: 0.8,
|
|
5424
|
-
children: isMutating ? /* @__PURE__ */ (0,
|
|
5425
|
-
/* @__PURE__ */ (0,
|
|
5426
|
-
/* @__PURE__ */ (0,
|
|
5427
|
-
] }) : /* @__PURE__ */ (0,
|
|
5748
|
+
children: isMutating ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.View, { style: styles14.ctaLoading, children: [
|
|
5749
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.ActivityIndicator, { size: "small", color: "#FFFFFF" }),
|
|
5750
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: styles14.ctaText, children: statusLabel })
|
|
5751
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react_native20.Text, { style: [styles14.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
5428
5752
|
isRefund ? "Claim Refund" : "Claim Prize",
|
|
5429
5753
|
" \u2014 ",
|
|
5430
5754
|
prizeAmount,
|
|
@@ -5432,7 +5756,7 @@ function ClaimPrizeSheet({
|
|
|
5432
5756
|
] })
|
|
5433
5757
|
}
|
|
5434
5758
|
),
|
|
5435
|
-
mutation.data?.explorerUrl && /* @__PURE__ */ (0,
|
|
5759
|
+
mutation.data?.explorerUrl && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_native20.Text, { style: [styles14.explorerHint, { color: t.textMuted }], children: "View on Solscan" })
|
|
5436
5760
|
] }) })
|
|
5437
5761
|
}
|
|
5438
5762
|
)
|
|
@@ -5440,9 +5764,9 @@ function ClaimPrizeSheet({
|
|
|
5440
5764
|
}
|
|
5441
5765
|
);
|
|
5442
5766
|
}
|
|
5443
|
-
var
|
|
5767
|
+
var styles14 = import_react_native20.StyleSheet.create({
|
|
5444
5768
|
overlay: {
|
|
5445
|
-
...
|
|
5769
|
+
...import_react_native20.StyleSheet.absoluteFillObject,
|
|
5446
5770
|
backgroundColor: "rgba(0,0,0,0.5)"
|
|
5447
5771
|
},
|
|
5448
5772
|
overlayTap: {
|
|
@@ -5565,17 +5889,17 @@ var styles13 = import_react_native19.StyleSheet.create({
|
|
|
5565
5889
|
});
|
|
5566
5890
|
|
|
5567
5891
|
// src/ui/game/ClaimButton.tsx
|
|
5568
|
-
var
|
|
5569
|
-
var
|
|
5570
|
-
var
|
|
5892
|
+
var import_react30 = require("react");
|
|
5893
|
+
var import_react_native21 = require("react-native");
|
|
5894
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
5571
5895
|
function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
5572
5896
|
const t = useDubsTheme();
|
|
5573
5897
|
const { wallet } = useDubs();
|
|
5574
5898
|
const game = useGame(gameId);
|
|
5575
5899
|
const claimStatus = useHasClaimed(gameId);
|
|
5576
|
-
const [sheetVisible, setSheetVisible] = (0,
|
|
5900
|
+
const [sheetVisible, setSheetVisible] = (0, import_react30.useState)(false);
|
|
5577
5901
|
const walletAddress = wallet.publicKey?.toBase58() ?? null;
|
|
5578
|
-
const myBet = (0,
|
|
5902
|
+
const myBet = (0, import_react30.useMemo)(() => {
|
|
5579
5903
|
if (!walletAddress || !game.data?.bettors) return null;
|
|
5580
5904
|
return game.data.bettors.find((b) => b.wallet === walletAddress) ?? null;
|
|
5581
5905
|
}, [walletAddress, game.data?.bettors]);
|
|
@@ -5584,7 +5908,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5584
5908
|
const isWinner = isResolved && myBet != null && myBet.team === game.data?.winnerSide;
|
|
5585
5909
|
const isEligible = myBet != null && isResolved && (isWinner || isRefund);
|
|
5586
5910
|
const prizeAmount = isRefund ? myBet?.amount ?? 0 : game.data?.totalPool ?? 0;
|
|
5587
|
-
const handleSuccess = (0,
|
|
5911
|
+
const handleSuccess = (0, import_react30.useCallback)(
|
|
5588
5912
|
(result) => {
|
|
5589
5913
|
claimStatus.refetch();
|
|
5590
5914
|
onSuccess?.(result);
|
|
@@ -5597,13 +5921,13 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5597
5921
|
}
|
|
5598
5922
|
const label = isRefund ? "Refund" : "Prize";
|
|
5599
5923
|
if (claimStatus.hasClaimed) {
|
|
5600
|
-
return /* @__PURE__ */ (0,
|
|
5601
|
-
|
|
5924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5925
|
+
import_react_native21.TouchableOpacity,
|
|
5602
5926
|
{
|
|
5603
|
-
style: [
|
|
5927
|
+
style: [styles15.badge, { borderColor: t.accent }, style],
|
|
5604
5928
|
activeOpacity: 1,
|
|
5605
5929
|
disabled: true,
|
|
5606
|
-
children: /* @__PURE__ */ (0,
|
|
5930
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: [styles15.badgeText, { color: t.accent }], children: [
|
|
5607
5931
|
label,
|
|
5608
5932
|
" Claimed!"
|
|
5609
5933
|
] })
|
|
@@ -5613,14 +5937,14 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5613
5937
|
if (!isEligible) {
|
|
5614
5938
|
return null;
|
|
5615
5939
|
}
|
|
5616
|
-
return /* @__PURE__ */ (0,
|
|
5617
|
-
/* @__PURE__ */ (0,
|
|
5618
|
-
|
|
5940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
5941
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5942
|
+
import_react_native21.TouchableOpacity,
|
|
5619
5943
|
{
|
|
5620
|
-
style: [
|
|
5944
|
+
style: [styles15.button, { backgroundColor: t.accent }, style],
|
|
5621
5945
|
activeOpacity: 0.8,
|
|
5622
5946
|
onPress: () => setSheetVisible(true),
|
|
5623
|
-
children: /* @__PURE__ */ (0,
|
|
5947
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_native21.Text, { style: styles15.buttonText, children: [
|
|
5624
5948
|
"Claim ",
|
|
5625
5949
|
label,
|
|
5626
5950
|
" \u2014 ",
|
|
@@ -5629,7 +5953,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5629
5953
|
] })
|
|
5630
5954
|
}
|
|
5631
5955
|
),
|
|
5632
|
-
/* @__PURE__ */ (0,
|
|
5956
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
5633
5957
|
ClaimPrizeSheet,
|
|
5634
5958
|
{
|
|
5635
5959
|
visible: sheetVisible,
|
|
@@ -5643,7 +5967,7 @@ function ClaimButton({ gameId, style, onSuccess, onError }) {
|
|
|
5643
5967
|
)
|
|
5644
5968
|
] });
|
|
5645
5969
|
}
|
|
5646
|
-
var
|
|
5970
|
+
var styles15 = import_react_native21.StyleSheet.create({
|
|
5647
5971
|
button: {
|
|
5648
5972
|
height: 52,
|
|
5649
5973
|
borderRadius: 14,
|
|
@@ -5678,6 +6002,7 @@ var styles14 = import_react_native20.StyleSheet.create({
|
|
|
5678
6002
|
CreateCustomGameSheet,
|
|
5679
6003
|
DEFAULT_BASE_URL,
|
|
5680
6004
|
DEFAULT_RPC_URL,
|
|
6005
|
+
DeveloperDashboardSheet,
|
|
5681
6006
|
DubsApiError,
|
|
5682
6007
|
DubsClient,
|
|
5683
6008
|
DubsProvider,
|