Skip to content

Commit

Permalink
fix: unique key of skeleton
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Oct 24, 2024
1 parent 99478f1 commit ab43626
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions apps/renderer/src/modules/entry-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { LoadingCircle } from "@follow/components/ui/loading/index.jsx"
import type { FeedViewType } from "@follow/constants"
import { views } from "@follow/constants"
import { cn } from "@follow/utils/utils"
import type { FC, ReactNode } from "react"
import type { FC } from "react"
import { memo } from "react"

import { useAuthQuery } from "~/hooks/common"
Expand Down Expand Up @@ -79,17 +79,18 @@ export const EntryItemSkeleton: FC<{

return SkeletonItem ? (
<div className={cn(views[view].gridMode ? girdClassNames : "flex flex-col")}>
{createSkeletonItems(SkeletonItem, count || 10)}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
{SkeletonItem}
</div>
) : (
LoadingCircleFallback
)
})

const createSkeletonItems = (element: ReactNode, count: number) => {
const children = [] as ReactNode[]
for (let i = 0; i < count; i++) {
children.push(element)
}
return children
}

0 comments on commit ab43626

Please sign in to comment.