Skip to content

Commit

Permalink
Show giveup only when playing
Browse files Browse the repository at this point in the history
Show Give Up button only when playing, not after a game is lost (6 attempts or giving up) or won
  • Loading branch information
aishug134 committed Feb 19, 2022
1 parent bb9f878 commit 3b300f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function App() {
}

const [hideGiveUp,setHideGiveUp] = useState(true)

useEffect(()=>{
setTimeout(() => {
setHideGiveUp(false)
Expand Down Expand Up @@ -414,10 +414,10 @@ function App() {
</span>
))
)}
</div>
</div>
<div
className={`flex justify-center pt-6 ${
hideGiveUp ? 'hidden' : ''
hideGiveUp || gameState !== state.playing ? 'hidden' : ''
}`}
>
<div className={darkMode ? 'dark' : ''}>
Expand Down

0 comments on commit 3b300f7

Please sign in to comment.