From 18c0bd94eff682510fac38558ea00625e6622a85 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 16 Apr 2024 11:39:42 +0800 Subject: [PATCH] feat: entry column animation --- src/renderer/src/components/entry-column.tsx | 66 +++++++++++--------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/src/renderer/src/components/entry-column.tsx b/src/renderer/src/components/entry-column.tsx index a6ff9fb00..364913e1b 100644 --- a/src/renderer/src/components/entry-column.tsx +++ b/src/renderer/src/components/entry-column.tsx @@ -1,7 +1,7 @@ import { useEntries } from '@renderer/lib/entries' import { ActivedList } from '@renderer/lib/types' import dayjs from '@renderer/lib/dayjs' -import { parseHtml } from '@renderer/lib/parse-html' +import { m } from 'framer-motion' export function EntryColumn({ activedList }: { activedList: ActivedList }) { const entries = useEntries({ @@ -11,39 +11,49 @@ export function EntryColumn({ activedList }: { activedList: ActivedList }) { return (
-
+
{activedList?.name}
{entries.data?.pages?.[0].total} Items
- {entries.data?.pages?.map((page) => - page.entries.map((entry) => ( -
- -
-
- {dayjs - .duration(dayjs(entry.published_at).diff(dayjs(), 'minute'), 'minute') - .humanize()} ago +
+ {entries.data?.pages?.map((page, index) => ( + + {page.entries.map((entry) => ( +
+ +
+
+ {dayjs + .duration(dayjs(entry.published_at).diff(dayjs(), 'minute'), 'minute') + .humanize()}{' '} + ago +
+
{entry.title}
+
{entry.text}
+
+ {entry.images?.[0] && ( + + )}
-
{entry.title}
-
{entry.text}
-
- {entry.images?.[0] && ( - - )} -
- )) - )} + ))} + + ))} +
) }