@dubsdotapp/expo 0.5.29 → 0.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/game/JoinGameSheet.tsx +14 -7
package/package.json
CHANGED
|
@@ -167,19 +167,26 @@ export function JoinGameSheet({
|
|
|
167
167
|
const homeBetsCount = bettors.filter(b => b.team === 'home').length;
|
|
168
168
|
const awayBetsCount = bettors.filter(b => b.team === 'away').length;
|
|
169
169
|
const drawBetsCount = bettors.filter(b => b.team === 'draw').length;
|
|
170
|
+
// Show comparable odds for every side by computing each as "if I bet
|
|
171
|
+
// `wager` on this team". Total pool grows by `wager` regardless of
|
|
172
|
+
// which side you pick, so newPool is constant; only the side pool
|
|
173
|
+
// shifts. Previously this only added `wager` to the *selected* side,
|
|
174
|
+
// which left an unbetted side with sidePool === 0 → odds shown as
|
|
175
|
+
// "—". Empty sides now show their (high) implied multiplier so the
|
|
176
|
+
// user can actually compare risk/return before committing.
|
|
170
177
|
const newPool = totalPool + wager;
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
const
|
|
178
|
+
const homeWith = homePool + wager;
|
|
179
|
+
const awayWith = awayPool + wager;
|
|
180
|
+
const drawWith = drawPool + wager;
|
|
174
181
|
return {
|
|
175
|
-
homeOdds:
|
|
176
|
-
awayOdds:
|
|
177
|
-
drawOdds:
|
|
182
|
+
homeOdds: homeWith > 0 ? (newPool / homeWith).toFixed(2) : '—',
|
|
183
|
+
awayOdds: awayWith > 0 ? (newPool / awayWith).toFixed(2) : '—',
|
|
184
|
+
drawOdds: drawWith > 0 ? (newPool / drawWith).toFixed(2) : '—',
|
|
178
185
|
homeBets: homeBetsCount,
|
|
179
186
|
awayBets: awayBetsCount,
|
|
180
187
|
drawBets: drawBetsCount,
|
|
181
188
|
};
|
|
182
|
-
}, [totalPool, homePool, awayPool, drawPool, bettors, wager
|
|
189
|
+
}, [totalPool, homePool, awayPool, drawPool, bettors, wager]);
|
|
183
190
|
|
|
184
191
|
const selectedOdds = selectedTeam === 'home' ? homeOdds : selectedTeam === 'away' ? awayOdds : selectedTeam === 'draw' ? drawOdds : '—';
|
|
185
192
|
const potentialWinnings = selectedOdds !== '—' ? formatSol(parseFloat(selectedOdds) * wager) : '—';
|