Skip to content

Commit dea61a3

Browse files
authored
allow puzzle resubmission (#54)
## Motivation Enable users to resubmit puzzle solutions to the latest scoring chain after initial completion. ## Proposal Modified PuzzleSubmit component to allow resubmission of completed puzzles: - Changed button text from "Already Completed" to "Resubmit Solution" - Removed disabled state and gray styling to keep button functional - Maintained completed message indicator while allowing resubmission ## Test Plan Tested frontend locally
1 parent 7aefdde commit dea61a3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

frontend/src/components/puzzles/PuzzleSubmit.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,9 @@ export function PuzzleSubmit({
144144
return <p className="text-sm text-gray-500">Place your cells and press submit when ready.</p>;
145145
};
146146

147-
const buttonClassName = isPuzzleCompleted
148-
? "bg-gray-400 cursor-not-allowed text-white"
149-
: "bg-linera-primary hover:bg-linera-primary-dark text-white";
147+
const buttonClassName = "bg-linera-primary hover:bg-linera-primary-dark text-white";
150148

151-
const buttonText = isPuzzleCompleted ? "Already Completed" : "Submit Solution";
149+
const buttonText = isPuzzleCompleted ? "Resubmit Solution" : "Submit Solution";
152150

153151
return (
154152
<Card className="bg-white shadow-lg">
@@ -161,7 +159,6 @@ export function PuzzleSubmit({
161159
<Button
162160
onPress={onSubmit}
163161
isLoading={isSubmitting}
164-
isDisabled={isPuzzleCompleted}
165162
className={`w-full font-medium ${buttonClassName}`}
166163
size="lg"
167164
>

0 commit comments

Comments
 (0)