fix(board-pagination): hide pagelist in multiboards, right-align style selector

This commit is contained in:
plebeius
2026-02-24 21:18:51 +08:00
parent 1c55a79581
commit 15d8103391
3 changed files with 16 additions and 4 deletions
@@ -11,9 +11,11 @@ export interface BoardPaginationProps {
totalPages: number;
/** When true, renders pagelist: [All] [1] [2] ... [10] Catalog Archive + Style select */
footerStyle?: boolean;
/** When true, pagelist is never shown (multiboards always use infinite scroll) */
isMultiboard?: boolean;
}
const BoardPagination = ({ basePath, currentPage, totalPages, footerStyle = false }: BoardPaginationProps) => {
const BoardPagination = ({ basePath, currentPage, totalPages, footerStyle = false, isMultiboard = false }: BoardPaginationProps) => {
const { t } = useTranslation();
const navigate = useNavigate();
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
@@ -31,8 +33,8 @@ const BoardPagination = ({ basePath, currentPage, totalPages, footerStyle = fals
const archiveHref = `${basePath}/archive`;
return (
<div className={footerStyles.footerRow}>
{!enableInfiniteScroll && (
<div className={`${footerStyles.footerRow} ${isMultiboard ? footerStyles.footerRowRightOnly : ''}`}>
{!isMultiboard && !enableInfiniteScroll && (
<div className={styles.pagelist}>
{currentPage > 1 && (
<button type='button' className={styles.pagelistNavButton} onClick={() => navigate(pageHref(currentPage - 1))}>
+5
View File
@@ -57,6 +57,11 @@
width: 100%;
}
/* When only footerRight is shown (e.g. multiboards), align it right */
.footerRowRightOnly {
justify-content: flex-end;
}
.footerLeft {
display: flex;
align-items: center;
+6 -1
View File
@@ -261,7 +261,11 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, i
accountSubplebbitAddressesLength={accountSubplebbitAddresses?.length || 0}
showLoadingEllipsis={effectiveInfiniteScroll || combinedFeed.length === 0}
/>
<PageFooterDesktop firstRow={<BoardPagination basePath={paginationBasePath} currentPage={currentPage} totalPages={totalPages} footerStyle />} />
<PageFooterDesktop
firstRow={
<BoardPagination basePath={paginationBasePath} currentPage={currentPage} totalPages={totalPages} footerStyle isMultiboard={isForcedInfiniteScroll} />
}
/>
</>
),
}),
@@ -276,6 +280,7 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, i
subscriptions?.length,
accountSubplebbitAddresses?.length,
effectiveInfiniteScroll,
isForcedInfiniteScroll,
paginationBasePath,
currentPage,
totalPages,