feat(subplebbit): add automatic theme based on nsfw or sfw tags

This commit is contained in:
Tom (plebeius.eth)
2024-06-17 12:17:36 +02:00
parent 77ccf0c849
commit 22c1acdd3d
20 changed files with 189 additions and 87 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
import { Link, useLocation } from 'react-router-dom';
import { Link, useLocation, useParams } from 'react-router-dom';
import { Comment, useComment } from '@plebbit/plebbit-react-hooks';
import { useFloating, offset, shift, size, autoUpdate, Placement } from '@floating-ui/react';
import { getCommentMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils';
@@ -106,7 +106,7 @@ const CatalogPost = ({ post }: { post: Comment }) => {
const { hidden } = useHide({ cid });
const location = useLocation();
const isInAllView = isAllView(location.pathname);
const isInAllView = isAllView(location.pathname, useParams());
const postLink = isInAllView && isDescription ? `/p/all/description` : `/p/${subplebbitAddress}/${isDescription ? 'description' : isRules ? 'rules' : `c/${cid}`}`;