-
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
Solution #638
base: master
Are you sure you want to change the base?
Solution #638
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.
Good job 👍
Let's improve your code
src/components/PeopleFilters.tsx
Outdated
search: getSearchWith({ sex: 'm' || null }, searchParams), | ||
}} | ||
className={classNames({ | ||
'is-active': sex === 'm', |
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.
Create a enum for this magic words and use it everywhere
src/components/PersonLink.tsx
Outdated
'has-text-danger': person.sex === 'f', | ||
})} | ||
> | ||
{person.name} |
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.
Use a destruction for person
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.
looks awesome
{fatherName | ||
&& father | ||
? ( | ||
<Link | ||
to={{ | ||
pathname: `/people/${father.slug}`, | ||
search: searchParams.toString(), | ||
}} | ||
> | ||
{father.name} | ||
</Link> | ||
) | ||
: fatherName} | ||
|
||
{!fatherName && '-'} |
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.
{fatherName | |
&& father | |
? ( | |
<Link | |
to={{ | |
pathname: `/people/${father.slug}`, | |
search: searchParams.toString(), | |
}} | |
> | |
{father.name} | |
</Link> | |
) | |
: fatherName} | |
{!fatherName && '-'} | |
{father | |
? ( | |
<Link | |
to={{ | |
pathname: `/people/${father.slug}`, | |
search: searchParams.toString(), | |
}} | |
> | |
{father.name} | |
</Link> | |
) | |
: fatherName || '-'} |
DEMO LINK