From 28d83146e6a5de208c50af5f997893f29f597654 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 17 Dec 2024 17:49:41 -0600 Subject: [PATCH] Limit # in sidebar, tweak spacing --- src/view/shell/desktop/SidebarTrendingTopics.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/view/shell/desktop/SidebarTrendingTopics.tsx b/src/view/shell/desktop/SidebarTrendingTopics.tsx index a50ea9719d..fdf0cf4eef 100644 --- a/src/view/shell/desktop/SidebarTrendingTopics.tsx +++ b/src/view/shell/desktop/SidebarTrendingTopics.tsx @@ -6,10 +6,7 @@ import { useTrendingSettings, useTrendingSettingsApi, } from '#/state/preferences/trending' -import { - DEFAULT_LIMIT as TRENDING_TOPICS_COUNT, - useTrendingTopics, -} from '#/state/queries/trending/useTrendingTopics' +import {useTrendingTopics} from '#/state/queries/trending/useTrendingTopics' import {useTrendingConfig} from '#/state/trending-config' import {atoms as a, useTheme} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' @@ -24,6 +21,8 @@ import { } from '#/components/TrendingTopics' import {Text} from '#/components/Typography' +const TRENDING_LIMIT = 6 + export function SidebarTrendingTopics() { const {enabled} = useTrendingConfig() const {trendingDisabled} = useTrendingSettings() @@ -40,7 +39,7 @@ function Inner() { return error || noTopics ? null : ( <> - + {isLoading ? ( - Array(TRENDING_TOPICS_COUNT) + Array(TRENDING_LIMIT) .fill(0) .map((_n, i) => ( )) ) : !trending?.topics ? null : ( <> - {trending.topics.map(topic => ( + {trending.topics.slice(0, TRENDING_LIMIT).map(topic => ( {({hovered}) => (