mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(catalog): add catalog filters
This commit is contained in:
@@ -13,7 +13,6 @@ import useCountLinksInReplies from '../../hooks/use-count-links-in-replies';
|
||||
import _ from 'lodash';
|
||||
import useIsMobile from '../../hooks/use-is-mobile';
|
||||
import useCatalogFiltersStore from '../../stores/use-catalog-filters-store';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
interface BoardButtonsProps {
|
||||
address?: string | undefined;
|
||||
@@ -244,13 +243,7 @@ export const MobileBoardButtons = () => {
|
||||
const accountComment = useAccountComment({ commentIndex: params?.accountCommentIndex as any });
|
||||
const subplebbitAddress = params?.subplebbitAddress || accountComment?.subplebbitAddress;
|
||||
|
||||
const { filteredCount, resetFilteredCount } = useCatalogFiltersStore();
|
||||
|
||||
useEffect(() => {
|
||||
if (subplebbitAddress) {
|
||||
resetFilteredCount();
|
||||
}
|
||||
}, [subplebbitAddress, resetFilteredCount]);
|
||||
const { filteredCount } = useCatalogFiltersStore();
|
||||
|
||||
return (
|
||||
<div className={`${styles.mobileBoardButtons} ${!isInCatalogView ? styles.addMargin : ''}`}>
|
||||
@@ -334,13 +327,7 @@ export const DesktopBoardButtons = () => {
|
||||
const isInPostView = isPostPageView(location.pathname, params);
|
||||
const isInSubscriptionsView = isSubscriptionsView(location.pathname, useParams());
|
||||
|
||||
const { filteredCount, resetFilteredCount } = useCatalogFiltersStore();
|
||||
|
||||
useEffect(() => {
|
||||
if (subplebbitAddress) {
|
||||
resetFilteredCount();
|
||||
}
|
||||
}, [subplebbitAddress, resetFilteredCount]);
|
||||
const { filteredCount } = useCatalogFiltersStore();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user