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

add task solution #1135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add task solution #1135

wants to merge 2 commits into from

Conversation

wasik07
Copy link

@wasik07 wasik07 commented Jul 10, 2024

Copy link

@TarasHoliuk TarasHoliuk left a 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

const handleSubmit = (event: React.FormEvent) => {
event.preventDefault();

const nameNormalize = name.trim();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const nameNormalize = name.trim();
const nameNormalized = name.trim();

it's not a function but already normalized value

src/App.tsx Outdated
</div>

<PostsList />
{loading ? (

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in PostDetails

@wasik07 wasik07 requested a review from TarasHoliuk July 10, 2024 19:40
Copy link

@volodymyr-soltys97 volodymyr-soltys97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🔥

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

Successfully merging this pull request may close these issues.

3 participants