Skip to content

Commit

Permalink
changed null ternirary to logical &&
Browse files Browse the repository at this point in the history
  • Loading branch information
jfaMan committed Sep 19, 2021
1 parent 04a59aa commit ae599e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const App = () => {
score={score}
start={showStart}
/>
{showStart ? <Start handleStart={handleStart} /> : null}
{showLogin ? <Login handleLogin={handleLogin} calculateScore={calculateScore} /> : null}
{showStart && <Start handleStart={handleStart} />}
{showLogin && <Login handleLogin={handleLogin} calculateScore={calculateScore} />}
{renderGame()}
</div>
)
Expand Down
2 changes: 1 addition & 1 deletion src/components/Game.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Game = (props) => {
<div className='game' style={{ display: 'flex' }}>
<div className="game-left">
{showEndGame ? <EndGame playerName={playerName} score={score} handleEndGame={handleEndGame} refreshImages={refreshImages} /> : <div></div>}
<img className={score !== 0 ? "bounce" : ""} src={Logo} alt="Logo" />
<img className={score !== 0 && "bounce"} src={Logo} alt="Logo" />
</div>
<Images
key={imagesKey}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const Navbar = (props) => {
return (
<div className="navbar">
<img src={NavbarLogo} alt="Logo" />
{score >= 0 ? <div className="score">TRIES REMAINING: {score}</div> : null}
{start ? null : <div className="name">NAME: {name}</div>}
{score >= 0 && <div className="score">TRIES REMAINING: {score}</div>}
{!start && <div className="name">NAME: {name}</div>}
</div>
)
}
Expand Down

0 comments on commit ae599e0

Please sign in to comment.