Skip to content

Commit

Permalink
Update RollDice
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaRethy committed Sep 9, 2024
1 parent bc70730 commit ca7f119
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions client/src/components/RollDice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ const RollDice = () => {
}, 1000);
}

const deleteGames = () => {
setState({
dice1: 1,
dice2: 1,
rolling: false,
result: "",
totalScore: 0,
rollCount: 0
});
}

return (
<>
<div>
Expand All @@ -46,6 +57,9 @@ const RollDice = () => {
</button>
<p className="text-white text-2xl">{result}</p>
<p className="text-white text-2xl">Total Score: {totalScore} / {rollCount}</p>
<button onClick={deleteGames} className="py-3 px-6 m-2 rounded-md bg-slate-800 text-white text-lg font-semibold hover:opacity-85">
{rollCount > 0 ? "Delete History" : ""}
</button>
</div>
</>
);
Expand Down

0 comments on commit ca7f119

Please sign in to comment.