Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Taha's things #24

Open
Taha-Hassan-Git opened this issue Jun 14, 2023 · 1 comment
Open

Taha's things #24

Taha-Hassan-Git opened this issue Jun 14, 2023 · 1 comment

Comments

@Taha-Hassan-Git
Copy link

I love the alien names and stats, slimeFactor is particularly funny. It's all very neatly component-ised and you use props/state etc very well!

Some things about the UI that I'm sure you're aware of:

  • You can submit your card without having selected an attribute.
  • It's not clear to me what the start game button does.
  • It wasn't obvious to me how to submit my card, I think the "unleash..." button is a bit too wordy and wide to seem like a button
  • It's not clear what attribute the computer is using against you.
  • Everything is quite small on mobile.

Some questions:

  • Many of your components return a single element, could you return some of these on one line instead of using brackets?
    For example:
    instead of this
if(winner) {
    return (
      <p>Player 1 crushes the competition!</p>
    )
  }
  if(!winner) {
    return (
      <p>Defeated by player 2!</p>
    )
  }

this

if (winner) return <p>Player 1 crushes the competition!</p>;
return <p>Defeated by player 2!</p>;
  • You used state a lot! Would it have been possible to collate some of the state declarations? Or use one to determine others?
    For example:
  const [showWinMsg, setShowWinMsg] = useState(false);
  const [winner, setWinner] = useState(true);
@Psydwinder
Copy link

Hey team,

Piggy backing off what Taha said about condensing your if statement down into the following code:

if (winner) return <p>Player 1 crushes the competition!</p>;
return <p>Defeated by player 2!</p>;

You could simplyfy it further and just use a ternary operator, like this:

return (
  winner ? <p>Player 1 crushes the competition!</p> : <p>Defeated by player 2!</p>
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants