mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(board-pagination): redirect /boardIdentifier/1 to not-found, refine [All] button, hide pagelist when infinite scroll enabled
This commit is contained in:
+9
-1
@@ -180,6 +180,14 @@ const CatalogFeedRoute = () => {
|
||||
return <Catalog viewType={viewType} boardIdentifier={params.boardIdentifier} />;
|
||||
};
|
||||
|
||||
const PageOneGuard = () => {
|
||||
const { pageNumber } = useParams();
|
||||
if (pageNumber === '1') {
|
||||
return <Navigate to='/not-found' replace />;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
const ModQueueRoute = () => {
|
||||
const { boardIdentifier } = useParams();
|
||||
const account = useAccount();
|
||||
@@ -261,7 +269,7 @@ const App = () => {
|
||||
<Route path='/subs/*' element={<Navigate to='/not-found' replace />} />
|
||||
<Route path='/mod/*' element={<Navigate to='/not-found' replace />} />
|
||||
|
||||
<Route path='/:boardIdentifier/:pageNumber' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/:pageNumber' element={<PageOneGuard />} />
|
||||
<Route path='/:boardIdentifier' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/settings' element={boardFeedElement} />
|
||||
<Route path='/:boardIdentifier/catalog' element={catalogFeedElement} />
|
||||
|
||||
Reference in New Issue
Block a user