diff --git a/src/components/Confirm.js b/src/components/Confirm.js index 414ba77..d11b30f 100644 --- a/src/components/Confirm.js +++ b/src/components/Confirm.js @@ -13,17 +13,15 @@ function ConfirmationCheckbox() { }; const [person, setPerson] = useState(null); - - const [isActive, setIsActive] = useState(false); const [isChecked, setIsChecked] = useState(false); const [buttonPlayed, setButtonPlayed] = useState(false); function handleClick() { - setIsChecked(oldIsChecked => !oldIsChecked); + setIsChecked(prevIsChecked => !prevIsChecked); // Toggle isChecked state } function checkboxon() { - setIsActive(oldIsActive => !oldIsActive); + setIsChecked(oldIsChecked => !oldIsChecked); } function generatorRandomNumber() { @@ -42,6 +40,11 @@ function ConfirmationCheckbox() { setPerson(wives[randomNum]); }; + const goBack = () => { + setIsChecked(false); + setButtonPlayed(false); + }; + const wifestyle2 = { margin: "0", color: "white", @@ -94,7 +97,7 @@ function ConfirmationCheckbox() {   Whichever wife I get, I will accept for the rest of my life.

+ )} ); } -export default ConfirmationCheckbox; \ No newline at end of file +export default ConfirmationCheckbox;