feat(catalog): add catalog filters

This commit is contained in:
Tom (plebeius.eth)
2025-03-06 00:07:08 +01:00
parent 64c857fb9d
commit b127876ce4
41 changed files with 411 additions and 173 deletions
+2 -15
View File
@@ -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 (
<>