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