refactor(desktop): split to avoid circular imports

This commit is contained in:
Stephen Zhou
2025-05-06 16:39:56 +08:00
parent eb98f898e8
commit 07b46a6d10
3 changed files with 27 additions and 27 deletions
@@ -3,7 +3,7 @@ import { FeedViewType } from "@follow/constants"
import { ArticleItemSkeleton } from "./article-item"
import { AudioItemSkeleton } from "./audio-item"
import { NotificationItemSkeleton } from "./notification-item"
import { PictureItemSkeleton } from "./picture-item"
import { PictureItemSkeleton } from "./picture-item-skeleton"
import { SocialMediaItemSkeleton } from "./social-media-item"
import { VideoItemSkeleton } from "./video-item"
@@ -0,0 +1,26 @@
import { Skeleton } from "@follow/components/ui/skeleton/index.jsx"
export const PictureItemSkeleton = (
<div className="relative max-w-md rounded-md">
<div className="relative">
<div className="p-1.5">
<div className="relative flex gap-2 overflow-x-auto">
<div className="relative flex aspect-square w-full shrink-0 items-center overflow-hidden rounded-md">
<Skeleton className="size-full overflow-hidden" />
</div>
</div>
<div className="relative flex-1 px-2 pb-3 pt-1 text-sm">
<div className="relative mb-1 mt-1.5 truncate font-medium leading-none">
<Skeleton className="h-4 w-3/4" />
</div>
<div className="mt-1 flex items-center gap-1 truncate text-[13px]">
<Skeleton className="mr-0.5 size-4" />
<Skeleton className="h-3 w-1/2" />
<span className="text-material-opaque">·</span>
<Skeleton className="h-3 w-12" />
</div>
</div>
</div>
</div>
</div>
)
@@ -4,7 +4,6 @@ import {
useMasonryItemWidth,
useSetStableMasonryItemRatio,
} from "@follow/components/ui/masonry/contexts.jsx"
import { Skeleton } from "@follow/components/ui/skeleton/index.jsx"
import { FeedViewType } from "@follow/constants"
import { cn } from "@follow/utils/utils"
import type { PropsWithChildren } from "react"
@@ -176,28 +175,3 @@ const MasonryItemFixedDimensionWrapper = (
MasonryItemFixedDimensionWrapper.whyDidYouRender = {
logOnDifferentValues: true,
}
export const PictureItemSkeleton = (
<div className="relative max-w-md rounded-md">
<div className="relative">
<div className="p-1.5">
<div className="relative flex gap-2 overflow-x-auto">
<div className="relative flex aspect-square w-full shrink-0 items-center overflow-hidden rounded-md">
<Skeleton className="size-full overflow-hidden" />
</div>
</div>
<div className="relative flex-1 px-2 pb-3 pt-1 text-sm">
<div className="relative mb-1 mt-1.5 truncate font-medium leading-none">
<Skeleton className="h-4 w-3/4" />
</div>
<div className="mt-1 flex items-center gap-1 truncate text-[13px]">
<Skeleton className="mr-0.5 size-4" />
<Skeleton className="h-3 w-1/2" />
<span className="text-material-opaque">·</span>
<Skeleton className="h-3 w-12" />
</div>
</div>
</div>
</div>
</div>
)