revert "hidden threads" feat, must wait for 'filterHidden: false' API

This commit is contained in:
Tom (plebeius.eth)
2024-05-31 09:38:59 +02:00
parent d314100308
commit 6609d00e82
5 changed files with 35 additions and 138 deletions
@@ -3,8 +3,6 @@ import { Link, useLocation, useParams } from 'react-router-dom';
import { useAccountComment, useSubscribe } from '@plebbit/plebbit-react-hooks';
import styles from './board-buttons.module.css';
import { isAllView, isCatalogView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils';
import useBlockedComments from '../../hooks/use-blocked-comments';
import useBlockedCommentsStore from '../../stores/useBlockedCommentsStore';
interface BoardButtonsProps {
isInAllView?: boolean;
@@ -107,9 +105,6 @@ export const DesktopBoardButtons = () => {
const isInPostView = isPostPageView(location.pathname, params);
const isInSubscriptionsView = isSubscriptionsView(location.pathname);
const { showBlockedComments, setShowBlockedComments } = useBlockedCommentsStore();
const blockedComments = useBlockedComments(params?.subplebbitAddress);
return (
<div className={styles.desktopBoardButtons}>
<hr />
@@ -125,16 +120,6 @@ export const DesktopBoardButtons = () => {
<>
[<OptionsButton />] [
<CatalogButton address={subplebbitAddress} isInAllView={isInAllView} isInCatalogView={isInCatalogView} isInSubscriptionsView={isInSubscriptionsView} />]
{blockedComments?.length > 0 && (
<span className={styles.blockedAddresses}>
{' '}
Hidden threads: <strong>{blockedComments.length}</strong> [
<span className={styles.showBlockedButton} onClick={() => setShowBlockedComments(!showBlockedComments)}>
{showBlockedComments ? 'Back' : 'Show'}
</span>
]
</span>
)}
{!(isInAllView || isInSubscriptionsView) && (
<span className={styles.subscribeButton}>
[<SubscribeButton address={subplebbitAddress} />]