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

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

Conversation

Oleksandr-Vol
Copy link

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.

Good job 👍
Let's improve your code
Fix the search UI logic
Demo
image

Working example
image

return searchParams.getAll('centuries') || [];
}, [searchParams]);

function setSearchWith(paramsToUpdate: Params) {

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

Suggested change
function setSearchWith(paramsToUpdate: Params) {
const setSearchWith = (paramsToUpdate: Params) => {

return 'All';
}

return sex === 'm' ? 'Male' : 'Female';

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

Comment on lines +69 to +73
case 'm':
return person.sex === 'm';

case 'f':
return person.sex === 'f';

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 => (

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 => {

Choose a reason for hiding this comment

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

The same as above

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.

2 participants