fix: Update shuffle icon to crossed arrows and dismiss toast on card flip
All checks were successful
Automated Container Build / build-and-push (push) Successful in 56s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 56s
This commit is contained in:
parent
e4985d07e1
commit
515bc84990
1 changed files with 4 additions and 2 deletions
|
|
@ -128,6 +128,7 @@ export function FlashcardViewer({ cards, deckId, isShared = false, initialProgre
|
||||||
|
|
||||||
if (e.key === " " || e.key === "Enter" || e.key === "ArrowUp" || e.key === "ArrowDown") {
|
if (e.key === " " || e.key === "Enter" || e.key === "ArrowUp" || e.key === "ArrowDown") {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
setToastMessage(null);
|
||||||
setIsFlipped((prev) => {
|
setIsFlipped((prev) => {
|
||||||
if (!prev) setHasFlippedOnce(true);
|
if (!prev) setHasFlippedOnce(true);
|
||||||
return !prev;
|
return !prev;
|
||||||
|
|
@ -323,6 +324,7 @@ export function FlashcardViewer({ cards, deckId, isShared = false, initialProgre
|
||||||
ref={cardRef}
|
ref={cardRef}
|
||||||
className={`perspective-1000 cursor-pointer select-none relative ${swipeClass}`}
|
className={`perspective-1000 cursor-pointer select-none relative ${swipeClass}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setToastMessage(null);
|
||||||
setIsFlipped(!isFlipped);
|
setIsFlipped(!isFlipped);
|
||||||
if (!isFlipped) setHasFlippedOnce(true);
|
if (!isFlipped) setHasFlippedOnce(true);
|
||||||
}}
|
}}
|
||||||
|
|
@ -452,8 +454,8 @@ export function FlashcardViewer({ cards, deckId, isShared = false, initialProgre
|
||||||
}`}
|
}`}
|
||||||
title={isShuffled ? "Turn shuffle off" : "Turn shuffle on"}
|
title={isShuffled ? "Turn shuffle off" : "Turn shuffle on"}
|
||||||
>
|
>
|
||||||
<svg className={`w-5 h-5 ${isShuffled ? "stroke-[3]" : "stroke-2"}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg className={`w-5 h-5 ${isShuffled ? "stroke-[2.5]" : "stroke-2"}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" />
|
<path strokeLinecap="round" strokeLinejoin="round" d="M16 3h5v5M4 20L21 3M21 16v5h-5M15 15l6 6M4 4l5 5" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue