-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1074
base: master
Are you sure you want to change the base?
add task solution #1074
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.
return searchParams.getAll('centuries') || []; | ||
}, [searchParams]); | ||
|
||
function setSearchWith(paramsToUpdate: Params) { |
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.
It is important to stick to the same way of functions everywhere, fix it everywhere
function setSearchWith(paramsToUpdate: Params) { | |
const setSearchWith = (paramsToUpdate: Params) => { |
return 'All'; | ||
} | ||
|
||
return sex === 'm' ? 'Male' : 'Female'; |
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.
Move gender values to enum and use it everywhere
case 'm': | ||
return person.sex === 'm'; | ||
|
||
case 'f': | ||
return person.sex === 'f'; |
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.
The same as above
<div className="panel-block"> | ||
<div className="level is-flex-grow-1 is-mobile" data-cy="CenturyFilter"> | ||
<div className="level-left"> | ||
{['16', '17', '18', '19', '20'].map(item => ( |
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.
Move this array to the variable and use it here
> | ||
<thead> | ||
<tr> | ||
{['Name', 'Sex', 'Born', 'Died'].map(item => { |
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.
The same as above
https://oleksandr-vol.github.io/react_people-table-advanced/