@devrongx/games 0.4.21 → 0.4.23
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrongx/games",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.23",
|
|
4
4
|
"description": "Game UI components for sports prediction markets",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"
|
|
20
|
-
"react-dom": ">=18",
|
|
21
|
-
"next": ">=14",
|
|
19
|
+
"clsx": ">=2",
|
|
22
20
|
"framer-motion": ">=10",
|
|
23
|
-
"zustand": ">=4",
|
|
24
21
|
"lucide-react": ">=0.300",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
22
|
+
"next": ">=14",
|
|
23
|
+
"react": ">=18",
|
|
24
|
+
"react-dom": ">=18",
|
|
25
|
+
"seedrandom": ">=3",
|
|
26
|
+
"zustand": ">=4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/react": "^19",
|
|
@@ -129,9 +129,7 @@ export const PreMatchBetsPopup = ({ poolId, matchId: _matchId, match: matchProp
|
|
|
129
129
|
const loaded: IUserBets = {};
|
|
130
130
|
for (const bet of entryData.bets) {
|
|
131
131
|
if (bet.parlay_id !== null) continue;
|
|
132
|
-
|
|
133
|
-
// The bets response has both pool_challenge_id (= backendChallengeId) and challenge_id (different).
|
|
134
|
-
const mIdx = config.markets.findIndex((m) => m.backendChallengeId === bet.pool_challenge_id);
|
|
132
|
+
const mIdx = config.markets.findIndex((m) => m.backendChallengeId === bet.challenge_id);
|
|
135
133
|
if (mIdx < 0) continue;
|
|
136
134
|
const oIdx = config.markets[mIdx].options.findIndex(
|
|
137
135
|
(o) => (o.key ?? o.label.toLowerCase().replace(/\s+/g, "_")) === bet.selected_option,
|
|
@@ -619,10 +619,10 @@ export const PreMatchGame = ({ config, bets, onBetsChange, onOptionClick, onAmou
|
|
|
619
619
|
|
|
620
620
|
return (
|
|
621
621
|
<motion.button
|
|
622
|
-
onClick={onSubmit
|
|
623
|
-
disabled={submitting
|
|
622
|
+
onClick={onSubmit ? onSubmit : undefined}
|
|
623
|
+
disabled={submitting}
|
|
624
624
|
className="relative w-[65px] min-h-[54px] rounded-xl overflow-hidden flex-shrink-0 flex items-center justify-center py-3"
|
|
625
|
-
style={{ background: bgColor, cursor:
|
|
625
|
+
style={{ background: bgColor, cursor: "pointer" }}
|
|
626
626
|
initial={{ opacity: 0, width: 0 }}
|
|
627
627
|
animate={{ opacity: 1, width: 65 }}
|
|
628
628
|
exit={{ opacity: 0, width: 0 }}
|
|
@@ -412,7 +412,7 @@ export function calcBetSummary(
|
|
|
412
412
|
config: IChallengeConfig,
|
|
413
413
|
): IBetSummary {
|
|
414
414
|
const { markets, startingBalance } = config;
|
|
415
|
-
const selectedCount = Object.
|
|
415
|
+
const selectedCount = Object.values(bets).filter(b => b.amount > 0).length;
|
|
416
416
|
const compoundMultiplier = config.compoundMultipliers[selectedCount] ?? 1;
|
|
417
417
|
|
|
418
418
|
const parlayGroups = deriveParlayGroups(bets);
|