From d994cc9d9f807aa7cf664a4ad8fc50b76051324a Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 30 Dec 2024 18:01:38 -0800 Subject: [PATCH] Fix loading state --- src/components/interstitials/Trending.tsx | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/components/interstitials/Trending.tsx b/src/components/interstitials/Trending.tsx index a5830dbdb3..5d1afbbccf 100644 --- a/src/components/interstitials/Trending.tsx +++ b/src/components/interstitials/Trending.tsx @@ -9,20 +9,14 @@ 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, useGutters, useTheme} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' import {TimesLarge_Stroke2_Corner0_Rounded as X} from '#/components/icons/Times' import {Trending2_Stroke2_Corner2_Rounded as Graph} from '#/components/icons/Trending2' import * as Prompt from '#/components/Prompt' -import { - TrendingTopicLink, - TrendingTopicSkeleton, -} from '#/components/TrendingTopics' +import {TrendingTopicLink} from '#/components/TrendingTopics' import {Text} from '#/components/Typography' export function TrendingInterstitial() { @@ -54,11 +48,12 @@ export function Inner() { {isLoading ? ( - Array(TRENDING_TOPICS_COUNT) - .fill(0) - .map((_n, i) => ( - - )) + + + {' '} + + ) : !trending?.topics ? null : ( <> {trending.topics.map(topic => (