-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add task solution #1135
base: master
Are you sure you want to change the base?
add task solution #1135
Conversation
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.
GJ 👍
Suggested a few small improvements
src/components/NewCommentForm.tsx
Outdated
const handleSubmit = (event: React.FormEvent) => { | ||
event.preventDefault(); | ||
|
||
const nameNormalize = name.trim(); |
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 nameNormalize = name.trim(); | |
const nameNormalized = name.trim(); |
it's not a function but already normalized value
src/App.tsx
Outdated
</div> | ||
|
||
<PostsList /> | ||
{loading ? ( |
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.
nested ternary is not the easiest thing to read
instead, make your conditions more specific, but separated:
{loading && !errorMessage && <Loader />}
It also might not look really good if the condition contains a lot of variables, so you can create separate variables above, like:
const showLoader = loading and !errorMessage;
and so on
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.
Same in PostDetails
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.
Great work 🔥
DEMO LINK