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

solution #1175

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

solution #1175

wants to merge 1 commit into from

Conversation

k0tlik02
Copy link

@k0tlik02 k0tlik02 commented Jan 2, 2025

Copy link

@yuliiazubenko yuliiazubenko left a comment

Choose a reason for hiding this comment

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

Great job!

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the task requirements! 🎉 While there are a few minor issues, such as ensuring non-null values and improving class name readability, these do not significantly impact the functionality. Keep up the good work and consider the feedback for future improvements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +19 to +20
<Route path="people" element={<PeoplePage />}>
<Route path=":slug?" element={<PeoplePage />} />

Choose a reason for hiding this comment

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

The nested route for PeoplePage seems to render PeoplePage twice: once for the people path and again for the optional :slug? parameter. This might lead to rendering issues or unexpected behavior. Consider reviewing the intended behavior and adjusting the route structure if necessary.

<a className="" href="#/people?sex=m">
</SearchLink>
<SearchLink
className={classNames({ 'is-active ': sex === Sex.Male })}

Choose a reason for hiding this comment

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

There is an extra space in the class name 'is-active ' which might cause styling issues. Consider removing the trailing space to ensure consistent styling.

Comment on lines +37 to +39
person.name.toLocaleLowerCase().includes(query.toLowerCase()) ||
person.fatherName?.toLocaleLowerCase().includes(query.toLowerCase()) ||
person.motherName?.toLowerCase().includes(query.toLowerCase()),

Choose a reason for hiding this comment

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

Consider using toLowerCase() consistently for string comparison to avoid potential issues with locale-specific behavior. Replace toLocaleLowerCase() with toLowerCase() for uniformity.

return true;
}

return centuries.includes(Math.ceil(person.born / 100).toString());

Choose a reason for hiding this comment

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

Ensure that the Math.ceil(person.born / 100).toString() calculation correctly represents the century. If there are any edge cases (e.g., year 2000), verify that the logic handles them as expected.

<NavLink
to={`${person.slug}`}
className={classNames({
'has-text-danger': person.sex === 'f',

Choose a reason for hiding this comment

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

Consider using a more descriptive class name for gender-based styling, such as 'female-text' instead of 'has-text-danger', to improve code readability and maintainability.

<td>
{person.mother ? (
<NavLink
to={`${person.mother?.slug}`}

Choose a reason for hiding this comment

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

Ensure that person.mother?.slug is not null or undefined before using it in the to prop of NavLink. This will prevent potential runtime errors if slug is not available.

</td>
<td>
{person.father ? (
<NavLink to={`${person.father?.slug}`}>

Choose a reason for hiding this comment

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

Ensure that person.father?.slug is not null or undefined before using it in the to prop of NavLink. This will prevent potential runtime errors if slug is not available.

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