mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post): block posts via the minus button (to collapse) or via the post menu
This commit is contained in:
@@ -8,6 +8,12 @@ export const isAllView = (pathname: string): boolean => {
|
||||
return pathname.startsWith('/p/all');
|
||||
};
|
||||
|
||||
export const isBoardView = (pathname: string, params: ParamsType): boolean => {
|
||||
// some subs might use emojis in their address, so we need to decode the pathname
|
||||
const decodedPathname = decodeURIComponent(pathname);
|
||||
return params.subplebbitAddress ? decodedPathname.startsWith(`/p/${params.subplebbitAddress}`) : false;
|
||||
};
|
||||
|
||||
export const isCatalogView = (pathname: string): boolean => {
|
||||
return pathname.endsWith('/catalog') || pathname.endsWith('/catalog/settings');
|
||||
};
|
||||
@@ -44,6 +50,8 @@ export const isSubscriptionsView = (pathname: string): boolean => {
|
||||
|
||||
export const isNotFoundView = (pathname: string, params: ParamsType): boolean => {
|
||||
return (
|
||||
!isAllView(pathname) &&
|
||||
!isBoardView(pathname, params) &&
|
||||
!isCatalogView(pathname) &&
|
||||
!isDescriptionView(pathname, params) &&
|
||||
!isHomeView(pathname) &&
|
||||
|
||||
Reference in New Issue
Block a user