Skip to content

Commit

Permalink
fix: activity ticker filter button not working on network change (#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp authored Feb 22, 2024
1 parent 6fcda45 commit d9e1b42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/components/Home/ActivityTickerFilter.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.ActivityTickerFilter {
z-index: 1;
}

.ActivityTickerFilter__ButtonContainer {
height: 18px;
flex-shrink: 0;
display: flex;
Expand Down
12 changes: 8 additions & 4 deletions src/components/Home/ActivityTickerFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ export default function ActivityTickerFilter({ onApply, filterState }: Props) {
setCheckedFilters((prev) => ({ ...prev, [filterClicked]: !prev[filterClicked] }))
}

useClickOutside('.ActivityTickerFilterBox', isOpen, () => setIsOpen(false))
useClickOutside('.ActivityTickerFilter', isOpen, () => setIsOpen(false))

return (
<>
<div className={classNames('ActivityTickerFilter')} onMouseDown={() => setIsOpen(!isOpen)}>
<div className="ActivityTickerFilter">
<div
role="button"
className="ActivityTickerFilter__ButtonContainer"
onClick={() => setIsOpen((prevState) => !prevState)}
>
{selectedFiltersCount !== 0 && <Counter count={selectedFiltersCount} size="small" />}
<div
className={classNames(
Expand Down Expand Up @@ -122,6 +126,6 @@ export default function ActivityTickerFilter({ onApply, filterState }: Props) {
</div>
</div>
)}
</>
</div>
)
}

0 comments on commit d9e1b42

Please sign in to comment.