feat(multisubs): add settings modal

This commit is contained in:
plebeius.eth
2024-05-17 16:28:09 +02:00
parent 25e261bb55
commit 970c726720
4 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -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 />} />
+2 -2
View File
@@ -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 => {
+1 -1
View File
@@ -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 && (
<>
+1 -1
View File
@@ -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