mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(board-buttons): hide catalog controls on flash upload boards
Flash boards do not use catalog view, so hide catalog links and OP search without leaving empty bracket placeholders in desktop board controls.
This commit is contained in:
+7
-2
@@ -29,6 +29,7 @@ import {
|
||||
isModQueueRoute,
|
||||
isValidBoardModRoute,
|
||||
isValidModRoute,
|
||||
isFlashBoardRoute,
|
||||
} from './lib/utils/route-utils';
|
||||
import styles from './app.module.css';
|
||||
import { DesktopBoardButtons, MobileAllFeedFilter, MobileBoardButtons } from './components/board-buttons';
|
||||
@@ -112,6 +113,10 @@ const BoardLayout = () => {
|
||||
return <Navigate to='/not-found' replace />;
|
||||
}
|
||||
|
||||
if (isCatalogView(pathname, params) && isFlashBoardRoute(boardIdentifier, directories)) {
|
||||
return <Navigate to='/not-found' replace />;
|
||||
}
|
||||
|
||||
// Invalid /mod/ paths (e.g. /mod/modqueue, /mod/asdoijasd) -> not-found
|
||||
if (pathname.startsWith('/mod/') && !isValidModRoute(pathname)) {
|
||||
return <Navigate to='/not-found' replace />;
|
||||
@@ -335,12 +340,12 @@ const App = () => {
|
||||
<Route path='/subs/*' element={<Navigate to='/not-found' replace />} />
|
||||
<Route path='/mod/*' element={<Navigate to='/not-found' replace />} />
|
||||
|
||||
<Route path='/:boardIdentifier/catalog' element={catalogFeedElement} />
|
||||
<Route path='/:boardIdentifier/catalog/settings' element={catalogFeedElement} />
|
||||
<Route path='/:boardIdentifier/:pageNumber' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/:pageNumber/settings' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/settings' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/catalog' element={catalogFeedElement} />
|
||||
<Route path='/:boardIdentifier/catalog/settings' element={catalogFeedElement} />
|
||||
<Route path='/:boardIdentifier/archive' element={<Archive />} />
|
||||
<Route path='/:boardIdentifier/archive/settings' element={<Archive />} />
|
||||
<Route path='/:boardIdentifier/directory' element={<Directory />} />
|
||||
|
||||
Reference in New Issue
Block a user