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 #1053

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

Solution #1053

wants to merge 3 commits into from

Conversation

opalahecha
Copy link

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.

Great job! A few things should be improved

onCenturyFilterChange,
}) => {
const [selectedSex, setSelectedSex] = useState<string | null>(null);
const handleSexFilterChange = (sex: string | null) => {

Choose a reason for hiding this comment

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

it's redundant function wrapper. You can just use setSelectedSex everywhere instead of handleSexFilterChange

return matchesQuery && matchesCentury && matchesSex;
});

const sortedPeople = [...filteredPeople].sort((a, b) => {

Choose a reason for hiding this comment

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

You can wrap it into useMemo to avoid recalculating it every time an unrelated state or search parameter changes. Same for filteredPeople

return (
<td>
<Link
to={`./${person.slug}`}

Choose a reason for hiding this comment

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

It resets all filters. That unexpected behavior - should be fixed

Copy link

@anastasiiavorobiova anastasiiavorobiova 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!
Screenshot 2024-09-10 at 15 40 47
Consider setting the same parameter just once

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.

4 participants