Skip to content

Commit

Permalink
fix(TagsFilterDropdown): remove extra void in callback
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Mar 4, 2023
1 parent c3aae34 commit 6b217bd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/components/TagsFilterDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import dynamic from 'next/dynamic';
import { Tag as TagModel } from '../../graphql/@generated/genql';

import { FiltersMenuItem } from './FiltersMenuItem';
import { Tag } from './Tag';
import { MenuItem } from './MenuItem';

const Dropdown = dynamic(() => import('./Dropdown'));

Expand All @@ -24,7 +24,7 @@ export const TagsFilterDropdown: React.FC<TagsFilterDropdownProps> = React.forwa
const [selected, setSelected] = useState<Set<string>>(new Set(value));

const onTagClick = useCallback(
(t: TagModel) => () => {
(t: TagModel) => {
selected.has(t.id) ? selected.delete(t.id) : selected.add(t.id);
const newSelected = new Set(selected);
setSelected(newSelected);
Expand Down Expand Up @@ -53,12 +53,9 @@ export const TagsFilterDropdown: React.FC<TagsFilterDropdownProps> = React.forwa
</FiltersMenuItem>
)}
renderItem={(props) => (
<Tag
key={props.item.id}
title={props.item.title}
checked={selected.has(props.item.id)}
onClick={props.onClick}
/>
<MenuItem ghost key={props.item.id} selected={selected.has(props.item.id)} onClick={props.onClick}>
{props.item.title}
</MenuItem>
)}
/>
);
Expand Down

0 comments on commit 6b217bd

Please sign in to comment.