@devrongx/games 0.4.25 → 0.4.26

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.25",
3
+ "version": "0.4.26",
4
4
  "description": "Game UI components for sports prediction markets",
5
5
  "license": "MIT",
6
6
  "main": "./src/index.ts",
@@ -173,10 +173,6 @@ export const PreMatchGame = ({
173
173
  return indices;
174
174
  }, [config.markets, activeFilters, ignoredMarkets, bets]);
175
175
 
176
- // Computed expand/collapse "active" states for the pills
177
- const allExpanded = visibleMarketIndices.length > 0 && visibleMarketIndices.every(i => !collapsedMarkets.has(i));
178
- const allCollapsed = visibleMarketIndices.length > 0 && visibleMarketIndices.every(i => collapsedMarkets.has(i));
179
-
180
176
  // Category headers — only shown when no sort is active
181
177
  const categoryForIndex = useMemo(() => {
182
178
  const map = new Map<number, string>();
@@ -259,8 +255,8 @@ export const PreMatchGame = ({
259
255
  <FilterPill label="Bets first" active={activeFilters.has("bets_first")} onClick={() => toggleFilter("bets_first")} />
260
256
  <FilterPill label="Unanswered first" active={activeFilters.has("unanswered_first")} onClick={() => toggleFilter("unanswered_first")} />
261
257
  <FilterPill label="Hide ignored" active={activeFilters.has("hide_ignored")} onClick={() => toggleFilter("hide_ignored")} />
262
- <FilterPill label="Expand all" active={allExpanded} onClick={handleExpandAll} />
263
- <FilterPill label="Collapse all" active={allCollapsed} onClick={handleCollapseAll} />
258
+ <FilterPill label="Expand all" active={false} onClick={handleExpandAll} />
259
+ <FilterPill label="Collapse all" active={false} onClick={handleCollapseAll} />
264
260
  </div>
265
261
  </>
266
262
  )}
@@ -277,7 +273,6 @@ export const PreMatchGame = ({
277
273
  {/* Markets */}
278
274
  <div className="w-full">
279
275
  <div className="flex flex-col gap-3">
280
- <AnimatePresence initial={false}>
281
276
  {visibleMarketIndices.map((mIdx) => {
282
277
  const market = config.markets[mIdx];
283
278
  const selection = bets[mIdx];
@@ -300,14 +295,7 @@ export const PreMatchGame = ({
300
295
  const hasSubmittedBet = !!submittedBets?.[mIdx];
301
296
 
302
297
  return (
303
- <motion.div
304
- key={market.id}
305
- layout="position"
306
- initial={{ opacity: 0, height: 0 }}
307
- animate={{ opacity: 1, height: "auto" }}
308
- exit={{ opacity: 0, height: 0 }}
309
- transition={{ layout: { type: "spring", stiffness: 300, damping: 30 }, opacity: { duration: 0.2 } }}
310
- >
298
+ <div key={market.id}>
311
299
  {/* Category header */}
312
300
  {showCategoryHeader && (
313
301
  <div className="px-1 pt-1 pb-1.5">
@@ -558,10 +546,9 @@ export const PreMatchGame = ({
558
546
  </motion.div>
559
547
  )}
560
548
  </AnimatePresence>
561
- </motion.div>
549
+ </div>
562
550
  );
563
551
  })}
564
- </AnimatePresence>
565
552
  </div>
566
553
  </div>
567
554
 
@@ -588,9 +575,9 @@ export const PreMatchGame = ({
588
575
  )}
589
576
  </AnimatePresence>
590
577
 
591
- {/* Saved max outcome */}
578
+ {/* Saved max outcome — only visible when editing creates a diff */}
592
579
  <AnimatePresence>
593
- {savedBetSummary && savedBetSummary.totalEntry > 0 && (
580
+ {savedBetSummary && hasUnsavedEdits && savedBetSummary.totalEntry > 0 && (
594
581
  <motion.div className="overflow-hidden" initial={{ height: 0, opacity: 0 }} animate={{ height: "auto", opacity: 1 }} exit={{ height: 0, opacity: 0 }}
595
582
  transition={{ height: { duration: 0.35, ease: "easeOut" }, opacity: { duration: 0.3, delay: 0.1 } }}>
596
583
  <div className="flex items-baseline gap-1 flex-nowrap">
@@ -605,14 +592,14 @@ export const PreMatchGame = ({
605
592
  )}
606
593
  </AnimatePresence>
607
594
 
608
- {/* Current/unsaved max outcome */}
595
+ {/* Max outcome — always visible when there are bets */}
609
596
  <AnimatePresence>
610
- {totalEntry > 0 && (!hasSubmitted || hasUnsavedEdits) && (
597
+ {totalEntry > 0 && (
611
598
  <motion.div className="overflow-hidden" initial={{ height: 0, opacity: 0 }} animate={{ height: "auto", opacity: 1 }} exit={{ height: 0, opacity: 0 }}
612
599
  transition={{ height: { duration: 0.35, ease: "easeOut" }, opacity: { duration: 0.3, delay: 0.1 } }}>
613
600
  <div className="flex items-baseline gap-1 flex-nowrap">
614
601
  <span className="text-[13px] text-white font-medium leading-none flex-shrink-0" style={OUTFIT}>
615
- {hasSubmitted ? "Pending" : "Max outcome"}
602
+ {hasSubmitted && hasUnsavedEdits ? "Pending" : "Max outcome"}
616
603
  </span>
617
604
  <Image src="/iamgame_square_logo.jpg" alt="" width={18} height={18} className="rounded-[2px] flex-shrink-0" />
618
605
  <AnimatedNumber value={totalEntry} className="text-[22px] text-white font-bold leading-none" style={OUTFIT} />
@@ -668,13 +655,11 @@ export const PreMatchGame = ({
668
655
  {buttonState === "submitted" && (
669
656
  <motion.div
670
657
  className="w-[54px] min-h-[54px] rounded-xl flex-shrink-0 flex items-center justify-center"
671
- style={{ background: "rgba(34,197,94,0.12)", border: "1px solid rgba(34,197,94,0.3)" }}
658
+ style={{ background: "rgba(74,222,128,0.10)" }}
672
659
  initial={{ opacity: 0, scale: 0.8 }}
673
660
  animate={{ opacity: 1, scale: 1 }}
674
661
  transition={{ type: "spring", stiffness: 300, damping: 20 }}>
675
- <div className="w-[28px] h-[28px] rounded-full flex items-center justify-center" style={{ background: "rgba(34,197,94,0.25)" }}>
676
- <Check size={16} className="text-green-400" />
677
- </div>
662
+ <Check size={22} strokeWidth={2.5} className="text-white" />
678
663
  </motion.div>
679
664
  )}
680
665
  </AnimatePresence>