mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(subplebbit): add automatic theme based on nsfw or sfw tags
This commit is contained in:
@@ -9,8 +9,9 @@ const FiltersModal = ({ closeModal }: { closeModal: () => void }) => {
|
||||
const { t } = useTranslation();
|
||||
const { showAdultBoards, setShowAdultBoards, showGoreBoards, setShowGoreBoards, showTextOnlyThreads, setShowTextOnlyThreads } = useCatalogFiltersStore();
|
||||
const location = useLocation();
|
||||
const isInCatalogView = isCatalogView(location.pathname, useParams());
|
||||
const isInAllView = isAllView(location.pathname);
|
||||
const params = useParams();
|
||||
const isInCatalogView = isCatalogView(location.pathname, params);
|
||||
const isInAllView = isAllView(location.pathname, params);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -27,7 +27,7 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp
|
||||
const { avatarUrl } = suggested || {};
|
||||
|
||||
const location = useLocation();
|
||||
const isInAllView = isAllView(location.pathname);
|
||||
const isInAllView = isAllView(location.pathname, useParams());
|
||||
const multisub = useMultisubMetadata();
|
||||
|
||||
const feedWithDescriptionAndRules = useMemo(() => {
|
||||
@@ -90,13 +90,13 @@ const Catalog = () => {
|
||||
const location = useLocation();
|
||||
const { subplebbitAddress } = useParams<{ subplebbitAddress: string }>();
|
||||
|
||||
const isInAllView = isAllView(location.pathname);
|
||||
const isInAllView = isAllView(location.pathname, useParams());
|
||||
const defaultSubplebbits = useDefaultSubplebbits();
|
||||
const { showAdultBoards, showGoreBoards } = useCatalogFiltersStore();
|
||||
|
||||
const account = useAccount();
|
||||
const subscriptions = account?.subscriptions;
|
||||
const isInSubscriptionsView = isSubscriptionsView(location.pathname);
|
||||
const isInSubscriptionsView = isSubscriptionsView(location.pathname, useParams());
|
||||
|
||||
const subplebbitAddresses = useMemo(() => {
|
||||
const filteredDefaultSubplebbits = defaultSubplebbits
|
||||
@@ -121,10 +121,6 @@ const Catalog = () => {
|
||||
return [subplebbitAddress];
|
||||
}, [isInAllView, isInSubscriptionsView, subplebbitAddress, defaultSubplebbits, subscriptions, showAdultBoards, showGoreBoards]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(showAdultBoards, showGoreBoards);
|
||||
}, [showAdultBoards, showGoreBoards]);
|
||||
|
||||
const columnCount = Math.floor(useWindowWidth() / columnWidth);
|
||||
// postPerPage based on columnCount for optimized feed, dont change value after first render
|
||||
// eslint-disable-next-line
|
||||
|
||||
Reference in New Issue
Block a user