@devrongx/games 0.4.29 → 0.4.31

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.29",
3
+ "version": "0.4.31",
4
4
  "description": "Game UI components for sports prediction markets",
5
5
  "license": "MIT",
6
6
  "main": "./src/index.ts",
@@ -341,32 +341,16 @@ export const PreMatchGame = ({
341
341
  );
342
342
  })()}
343
343
 
344
- {/* Per-market action: edit / ignore / confirm+cancel */}
344
+ {/* Per-market header action: pencil or ignore */}
345
345
  {hasSubmittedBet ? (
346
- isEditingThis ? (
347
- <div className="flex items-center gap-1.5 flex-shrink-0">
348
- <button onClick={(e) => { e.stopPropagation(); onCancelMarketEdit?.(mIdx); }}
349
- className="w-[22px] h-[22px] rounded-full flex items-center justify-center bg-white/[0.06]">
350
- <X size={12} className="text-white/50" />
351
- </button>
352
- {isDirty && (
353
- <button onClick={(e) => { e.stopPropagation(); onConfirmMarketEdit?.(mIdx); }}
354
- className="w-[22px] h-[22px] rounded-full flex items-center justify-center"
355
- style={{ background: "rgba(34,227,232,0.15)", border: "1px solid rgba(34,227,232,0.3)" }}>
356
- {editSubmitting === mIdx
357
- ? <Loader2 size={12} className="animate-spin text-[#22E3E8]" />
358
- : <Check size={12} className="text-[#22E3E8]" />}
359
- </button>
360
- )}
361
- </div>
362
- ) : (
346
+ !isEditingThis && (
363
347
  <button onClick={(e) => { e.stopPropagation(); onEditMarket?.(mIdx); }}
364
348
  className="flex-shrink-0 w-[22px] h-[22px] rounded-full flex items-center justify-center bg-white/[0.04]">
365
349
  <Pencil size={11} className="text-white/40" />
366
350
  </button>
367
351
  )
368
352
  ) : (
369
- onToggleIgnore && (
353
+ !selection && onToggleIgnore && (
370
354
  <button onClick={(e) => { e.stopPropagation(); onToggleIgnore(mIdx); }}
371
355
  className="flex-shrink-0 w-[22px] h-[22px] rounded-full flex items-center justify-center"
372
356
  style={{ background: ignoredMarkets.has(mIdx) ? "rgba(34,227,232,0.1)" : "transparent" }}>
@@ -470,10 +454,7 @@ export const PreMatchGame = ({
470
454
  );
471
455
  })}
472
456
 
473
- {/* AI Insights */}
474
- <div className="col-span-2 flex justify-end pr-4 mt-3">
475
- <AiInsightButton question={market.question} options={market.options.map(o => o.label)} />
476
- </div>
457
+ {/* AI Insights — hidden for now */}
477
458
 
478
459
  {/* Amount picker */}
479
460
  {isPickerOpenForMarket && interactive && (
@@ -544,6 +525,48 @@ export const PreMatchGame = ({
544
525
  </motion.div>
545
526
  )}
546
527
  </AnimatePresence>
528
+
529
+ {/* Per-market save/cancel — new bet */}
530
+ {hasSubmitted && !hasSubmittedBet && selection && (
531
+ <div className="col-span-2 flex items-center gap-4 mt-1.5 px-0.5">
532
+ {betAmount > 0 && (
533
+ <button
534
+ onClick={(e) => { e.stopPropagation(); onConfirmMarketEdit?.(mIdx); }}
535
+ disabled={editSubmitting === mIdx}
536
+ className="text-[11px] font-semibold"
537
+ style={{ ...OUTFIT, color: "#22E3E8", opacity: editSubmitting === mIdx ? 0.5 : 1 }}>
538
+ {editSubmitting === mIdx ? "Saving..." : "Save bet"}
539
+ </button>
540
+ )}
541
+ <button
542
+ onClick={(e) => { e.stopPropagation(); onCancelMarketEdit?.(mIdx); }}
543
+ className="text-[11px] font-semibold"
544
+ style={{ ...OUTFIT, color: "rgba(255,255,255,0.4)" }}>
545
+ Cancel
546
+ </button>
547
+ </div>
548
+ )}
549
+
550
+ {/* Per-market save/cancel — editing existing bet */}
551
+ {hasSubmitted && isEditingThis && (
552
+ <div className="col-span-2 flex items-center gap-4 mt-1.5 px-0.5">
553
+ {isDirty && (
554
+ <button
555
+ onClick={(e) => { e.stopPropagation(); onConfirmMarketEdit?.(mIdx); }}
556
+ disabled={editSubmitting === mIdx}
557
+ className="text-[11px] font-semibold"
558
+ style={{ ...OUTFIT, color: "#22E3E8", opacity: editSubmitting === mIdx ? 0.5 : 1 }}>
559
+ {editSubmitting === mIdx ? "Saving..." : "Change bet"}
560
+ </button>
561
+ )}
562
+ <button
563
+ onClick={(e) => { e.stopPropagation(); onCancelMarketEdit?.(mIdx); }}
564
+ className="text-[11px] font-semibold"
565
+ style={{ ...OUTFIT, color: "rgba(255,255,255,0.4)" }}>
566
+ Cancel
567
+ </button>
568
+ </div>
569
+ )}
547
570
  </div>
548
571
  </motion.div>
549
572
  )}