mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(board-pagination): hide pagelist in multiboards, right-align style selector
This commit is contained in:
@@ -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))}>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user