-
Notifications
You must be signed in to change notification settings - Fork 0
Homework9 #2
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
base: main
Are you sure you want to change the base?
Conversation
| if (id === "playerOne") { | ||
| return userNameOne; | ||
| } | ||
| if (id === "playerTwo") { | ||
| return userNameTwo; | ||
| } | ||
| return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
` if (id === "playerOne") return userNameOne;
if (id === "playerTwo") return userNameTwo;
return "";`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats java code style - always use { ... } after if
| if (id === "playerOne") { | ||
| onSubmit(id, userNameOne); | ||
| } else { | ||
| onSubmit(id, userNameTwo); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const player = id === "playerOne" ? userNameOne : userNameTwo
onSubmit(id, player);
| <TableRow> | ||
| <TableCell>Id</TableCell> | ||
| <TableCell>Name</TableCell> | ||
| <TableCell>Stars</TableCell> | ||
| </TableRow> | ||
| </TableHead> | ||
| <TableBody> | ||
| {profiles.map((profile) => { | ||
| return ( | ||
| <TableRow key={profile.id}> | ||
| <TableCell>{profile.id}</TableCell> | ||
| <TableCell>{profile.profileName}</TableCell> | ||
| <TableCell>{profile.starsCount}</TableCell> | ||
| </TableRow> | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened with tabulations?
| dispatch(setLoading(true)); | ||
| fetchPopularRepos(selectedLanguageIndex) | ||
| .then((repos) => dispatch(setRepos(repos))) | ||
| .catch((error) => dispatch(setErrors(error))) | ||
| .finally(() => dispatch(setLoading(false))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to cover in callback
| if (error) { | ||
| return <p>{error}</p>; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (error) return <p>{error}</p>;
| if (loading) { | ||
| return ( | ||
| <div> | ||
| <LanguageSelector selectedLanguageIndex={selectedLanguageIndex} /> | ||
| <Loading isLoading={loading} /> | ||
| </div> | ||
| ); | ||
| } else { | ||
| return ( | ||
| <div> | ||
| <LanguageSelector selectedLanguageIndex={selectedLanguageIndex} /> | ||
| <Repositories repos={repos} /> | ||
| </div> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (loading) return (
<>
<LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
<Loading isLoading={loading} />
</>
);
return (
<div>
<LanguageSelector selectedLanguageIndex={selectedLanguageIndex} />
<Repositories repos={repos} />
</div>
);
No description provided.