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;
|
totalPages: number;
|
||||||
/** When true, renders pagelist: [All] [1] [2] ... [10] Catalog Archive + Style select */
|
/** When true, renders pagelist: [All] [1] [2] ... [10] Catalog Archive + Style select */
|
||||||
footerStyle?: boolean;
|
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 { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
|
const enableInfiniteScroll = useFeedViewSettingsStore((state) => state.enableInfiniteScroll);
|
||||||
@@ -31,8 +33,8 @@ const BoardPagination = ({ basePath, currentPage, totalPages, footerStyle = fals
|
|||||||
const archiveHref = `${basePath}/archive`;
|
const archiveHref = `${basePath}/archive`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={footerStyles.footerRow}>
|
<div className={`${footerStyles.footerRow} ${isMultiboard ? footerStyles.footerRowRightOnly : ''}`}>
|
||||||
{!enableInfiniteScroll && (
|
{!isMultiboard && !enableInfiniteScroll && (
|
||||||
<div className={styles.pagelist}>
|
<div className={styles.pagelist}>
|
||||||
{currentPage > 1 && (
|
{currentPage > 1 && (
|
||||||
<button type='button' className={styles.pagelistNavButton} onClick={() => navigate(pageHref(currentPage - 1))}>
|
<button type='button' className={styles.pagelistNavButton} onClick={() => navigate(pageHref(currentPage - 1))}>
|
||||||
|
|||||||
@@ -57,6 +57,11 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* When only footerRight is shown (e.g. multiboards), align it right */
|
||||||
|
.footerRowRightOnly {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
.footerLeft {
|
.footerLeft {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -261,7 +261,11 @@ const Board = ({ feedCacheKey, viewType, boardIdentifier: boardIdentifierProp, i
|
|||||||
accountSubplebbitAddressesLength={accountSubplebbitAddresses?.length || 0}
|
accountSubplebbitAddressesLength={accountSubplebbitAddresses?.length || 0}
|
||||||
showLoadingEllipsis={effectiveInfiniteScroll || combinedFeed.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,
|
subscriptions?.length,
|
||||||
accountSubplebbitAddresses?.length,
|
accountSubplebbitAddresses?.length,
|
||||||
effectiveInfiniteScroll,
|
effectiveInfiniteScroll,
|
||||||
|
isForcedInfiniteScroll,
|
||||||
paginationBasePath,
|
paginationBasePath,
|
||||||
currentPage,
|
currentPage,
|
||||||
totalPages,
|
totalPages,
|
||||||
|
|||||||
Reference in New Issue
Block a user