@devrongx/games 0.4.29 → 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devrongx/games",
3
- "version": "0.4.29",
3
+ "version": "0.4.30",
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" }}>
@@ -544,6 +528,48 @@ export const PreMatchGame = ({
544
528
  </motion.div>
545
529
  )}
546
530
  </AnimatePresence>
531
+
532
+ {/* Per-market save/cancel — new bet */}
533
+ {hasSubmitted && !hasSubmittedBet && selection && (
534
+ <div className="col-span-2 flex items-center gap-4 mt-1.5 px-0.5">
535
+ {betAmount > 0 && (
536
+ <button
537
+ onClick={(e) => { e.stopPropagation(); onConfirmMarketEdit?.(mIdx); }}
538
+ disabled={editSubmitting === mIdx}
539
+ className="text-[11px] font-semibold"
540
+ style={{ ...OUTFIT, color: "#22E3E8", opacity: editSubmitting === mIdx ? 0.5 : 1 }}>
541
+ {editSubmitting === mIdx ? "Saving..." : "Save bet"}
542
+ </button>
543
+ )}
544
+ <button
545
+ onClick={(e) => { e.stopPropagation(); onCancelMarketEdit?.(mIdx); }}
546
+ className="text-[11px] font-semibold"
547
+ style={{ ...OUTFIT, color: "rgba(255,255,255,0.4)" }}>
548
+ Cancel
549
+ </button>
550
+ </div>
551
+ )}
552
+
553
+ {/* Per-market save/cancel — editing existing bet */}
554
+ {hasSubmitted && isEditingThis && (
555
+ <div className="col-span-2 flex items-center gap-4 mt-1.5 px-0.5">
556
+ {isDirty && (
557
+ <button
558
+ onClick={(e) => { e.stopPropagation(); onConfirmMarketEdit?.(mIdx); }}
559
+ disabled={editSubmitting === mIdx}
560
+ className="text-[11px] font-semibold"
561
+ style={{ ...OUTFIT, color: "#22E3E8", opacity: editSubmitting === mIdx ? 0.5 : 1 }}>
562
+ {editSubmitting === mIdx ? "Saving..." : "Change bet"}
563
+ </button>
564
+ )}
565
+ <button
566
+ onClick={(e) => { e.stopPropagation(); onCancelMarketEdit?.(mIdx); }}
567
+ className="text-[11px] font-semibold"
568
+ style={{ ...OUTFIT, color: "rgba(255,255,255,0.4)" }}>
569
+ Cancel
570
+ </button>
571
+ </div>
572
+ )}
547
573
  </div>
548
574
  </motion.div>
549
575
  )}