Update catalog.tsx

This commit is contained in:
Tom (plebeius.eth)
2024-05-30 18:11:48 +02:00
parent fd092f1bee
commit 67ac2b662b
+4 -1
View File
@@ -63,7 +63,6 @@ const useFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subp
return _feed; return _feed;
}, [feed, description, rules, address, isFeedLoaded, createdAt, title, shortAddress, avatarUrl, t, isInAllView, multisub, includeDescriptionAndRules]); }, [feed, description, rules, address, isFeedLoaded, createdAt, title, shortAddress, avatarUrl, t, isInAllView, multisub, includeDescriptionAndRules]);
// Memoize rows calculation, ensuring it updates on changes to the modified feed or column count
const rows = useMemo(() => { const rows = useMemo(() => {
const rows = []; const rows = [];
for (let i = 0; i < feedWithDescriptionAndRules.length; i += columnCount) { for (let i = 0; i < feedWithDescriptionAndRules.length; i += columnCount) {
@@ -178,6 +177,9 @@ const Catalog = () => {
{location.pathname.endsWith('/settings') && <SettingsModal />} {location.pathname.endsWith('/settings') && <SettingsModal />}
<hr /> <hr />
<div className={styles.catalog}> <div className={styles.catalog}>
{showBlockedComments ? (
rows.map((row, index) => <CatalogRow key={index} index={index} row={row} />)
) : (
<Virtuoso <Virtuoso
increaseViewportBy={{ bottom: 1200, top: 1200 }} increaseViewportBy={{ bottom: 1200, top: 1200 }}
totalCount={rows?.length || 0} totalCount={rows?.length || 0}
@@ -190,6 +192,7 @@ const Catalog = () => {
restoreStateFrom={lastVirtuosoState} restoreStateFrom={lastVirtuosoState}
initialScrollTop={lastVirtuosoState?.scrollTop} initialScrollTop={lastVirtuosoState?.scrollTop}
/> />
)}
</div> </div>
</div> </div>
); );