feat: improve list virtualization

This commit is contained in:
reya
2024-06-20 13:22:28 +07:00
parent f8280ec8ee
commit 9779d020c7
15 changed files with 582 additions and 313 deletions

View File

@@ -96,7 +96,9 @@ export function NoteContent({
<div
className={cn(
"select-text text-pretty content-break overflow-hidden",
event.content.length > 620 ? "max-h-[250px] gradient-mask-b-0" : "",
event.meta?.content.length > 400
? "max-h-[250px] gradient-mask-b-0"
: "",
className,
)}
>

View File

@@ -42,8 +42,8 @@ export function Images({ urls }: { urls: string[] }) {
return (
<Carousel
items={imageUrls}
renderItem={({ item, isSnapPoint }) => (
<CarouselItem key={item} isSnapPoint={isSnapPoint}>
renderItem={({ item, index, isSnapPoint }) => (
<CarouselItem key={item + index} isSnapPoint={isSnapPoint}>
<img
src={item}
alt={item}