diff --git a/src/components/TrendingTopics.tsx b/src/components/TrendingTopics.tsx
index f20e1f5268..e765f03ea4 100644
--- a/src/components/TrendingTopics.tsx
+++ b/src/components/TrendingTopics.tsx
@@ -103,6 +103,30 @@ export function TrendingTopic({
)
}
+export function TrendingTopicSkeleton({size}: {size: 'large' | 'small'}) {
+ const t = useTheme()
+ const isSmall = size === 'small'
+ return (
+
+ )
+}
+
export function TrendingTopicLink({
topic: raw,
children,
diff --git a/src/view/shell/desktop/SidebarTrendingTopics.tsx b/src/view/shell/desktop/SidebarTrendingTopics.tsx
index c62d0c8898..28f47d9810 100644
--- a/src/view/shell/desktop/SidebarTrendingTopics.tsx
+++ b/src/view/shell/desktop/SidebarTrendingTopics.tsx
@@ -13,7 +13,11 @@ import {Divider} from '#/components/Divider'
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 {TrendingTopic, TrendingTopicLink} from '#/components/TrendingTopics'
+import {
+ TrendingTopic,
+ TrendingTopicLink,
+ TrendingTopicSkeleton,
+} from '#/components/TrendingTopics'
import {Text} from '#/components/Typography'
export function SidebarTrendingTopics() {
@@ -28,8 +32,9 @@ function Inner() {
const {setTrendingSidebarHidden} = useTrendingSettingsApi()
const {data: topics, error, isLoading} = useTrendingTopics()
+ const noTopics = !isLoading && !error && !topics
- return (
+ return error || noTopics ? null : (
<>
@@ -55,7 +60,11 @@ function Inner() {
- {isLoading ? null : error || !topics ? null : (
+ {isLoading ? (
+ Array(8)
+ .fill(0)
+ .map((_, i) => )
+ ) : error || !topics ? null : (
<>
{topics.map(topic => (