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

Develop #1029

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

Develop #1029

wants to merge 6 commits into from

Conversation

jdifek
Copy link

@jdifek jdifek commented Sep 17, 2024

Copy link

@GUSILLUS GUSILLUS left a comment

Choose a reason for hiding this comment

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

GJ!

Comment on lines 24 to 26
<option value={Status.All}>All</option>
<option value={Status.Active}>Active</option>
<option value={Status.Completed}>Completed</option>

Choose a reason for hiding this comment

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

Consider using Object.values(your enum) and map() method

Comment on lines 38 to 40
onChange={event => {
dispatch(filterActions.setQuery(event.target.value));
}}

Choose a reason for hiding this comment

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

Consider creating handler function


<td className="is-vcentered is-expanded">
<p className={todo.completed ? 'has-text-success' : 'has-text-danger'}>
{todo.title}

Choose a reason for hiding this comment

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

Consider using destruction assignment for todo object


export const TodoFilter: React.FC = () => {
const dispatch = useDispatch<AppDispatch>();
const query = useSelector((state: RootState) => state.filter.query);
Copy link

@etojeDenys etojeDenys Sep 17, 2024

Choose a reason for hiding this comment

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

do you know how to create useAppSelector and useAppDispatch hooks? better to use them and remove types everywhere

Suggested change
const query = useSelector((state: RootState) => state.filter.query);
const query = useAppSelector(state => state.filter.query);

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