mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(multisubs): add settings modal
This commit is contained in:
+6
-6
@@ -70,22 +70,22 @@ const App = () => {
|
||||
<Route element={<BoardLayout />}>
|
||||
<Route path='/p/:subplebbitAddress' element={<Board />} />
|
||||
<Route path='/p/:subplebbitAddress/settings' element={<Board />} />
|
||||
|
||||
<Route path='/p/all' element={<Board />} />
|
||||
<Route path='/p/all/settings' element={<Board />} />
|
||||
<Route path='/p/subscriptions' element={<Board />} />
|
||||
<Route path='/p/subscriptions/settings' element={<Board />} />
|
||||
|
||||
<Route path='/p/all' element={<Board />} />
|
||||
<Route path='/p/all/settings' element={<Board />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/catalog' element={<Catalog />} />
|
||||
<Route path='/p/:subplebbitAddress/catalog/settings' element={<Catalog />} />
|
||||
<Route path='/p/all/catalog' element={<Catalog />} />
|
||||
<Route path='/p/all/catalog/settings' element={<Catalog />} />
|
||||
<Route path='/p/subscriptions/catalog' element={<Catalog />} />
|
||||
<Route path='/p/subscriptions/catalog/settings' element={<Catalog />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/c/:commentCid' element={<PostPage />} />
|
||||
<Route path='/p/:subplebbitAddress/c/:commentCid/settings' element={<PostPage />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/description' element={<PostPage />} />
|
||||
<Route path='/p/:subplebbitAddress/description/settings' element={<PostPage />} />
|
||||
|
||||
<Route path='/p/:subplebbitAddress/rules' element={<PostPage />} />
|
||||
<Route path='/p/:subplebbitAddress/rules/settings' element={<PostPage />} />
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ export type ParamsType = {
|
||||
};
|
||||
|
||||
export const isAllView = (pathname: string): boolean => {
|
||||
return pathname === '/p/all';
|
||||
return pathname.startsWith('/p/all');
|
||||
};
|
||||
|
||||
export const isCatalogView = (pathname: string, params: ParamsType): boolean => {
|
||||
@@ -40,7 +40,7 @@ export const isRulesView = (pathname: string, params: ParamsType): boolean => {
|
||||
};
|
||||
|
||||
export const isSubscriptionsView = (pathname: string): boolean => {
|
||||
return pathname === '/p/subscriptions';
|
||||
return pathname.startsWith('/p/subscriptions');
|
||||
};
|
||||
|
||||
export const isNotFoundView = (pathname: string, params: ParamsType): boolean => {
|
||||
|
||||
@@ -84,7 +84,7 @@ const Board = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.content}>
|
||||
{location.pathname === `/p/${subplebbitAddress}/settings` && <SettingsModal />}
|
||||
{location.pathname.endsWith('/settings') && <SettingsModal />}
|
||||
{showReplyModal && activeCid && <ReplyModal closeModal={closeModal} parentCid={activeCid} scrollY={scrollY} />}
|
||||
{feed.length > 0 && (
|
||||
<>
|
||||
|
||||
@@ -124,7 +124,7 @@ const Catalog = () => {
|
||||
|
||||
return (
|
||||
<div className={styles.content}>
|
||||
{location.pathname === `/p/${subplebbitAddress}/catalog/settings` && <SettingsModal />}
|
||||
{location.pathname.endsWith('/settings') && <SettingsModal />}
|
||||
<hr />
|
||||
<div className={styles.catalog}>
|
||||
<Virtuoso
|
||||
|
||||
Reference in New Issue
Block a user