From 41c4ca341532694d17ce9644d688e948a70e524e Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 28 Apr 2024 18:37:56 +0800 Subject: [PATCH] feat: entry columns --- .../components/entry-column/notification-item.tsx | 13 +++++++++---- .../src/components/entry-column/picture-item.tsx | 9 +++++---- .../components/entry-column/social-media-item.tsx | 9 +++++---- .../src/components/entry-column/video-item.tsx | 7 ++++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/components/entry-column/notification-item.tsx b/src/renderer/src/components/entry-column/notification-item.tsx index 2d4bb4e445..cb6365cfcc 100644 --- a/src/renderer/src/components/entry-column/notification-item.tsx +++ b/src/renderer/src/components/entry-column/notification-item.tsx @@ -1,18 +1,23 @@ import dayjs from "@renderer/lib/dayjs" import { SiteIcon } from "../site-icon" +import { EntriesResponse } from "@renderer/lib/types" -export function NotificationItem({ entry }: { entry: any }) { +export function NotificationItem({ + entry, +}: { + entry: EntriesResponse[number] +}) { return (
- +
- {entry.feed.title} + {entry.feeds.title} · {dayjs .duration( - dayjs(entry.published_at).diff(dayjs(), "minute"), + dayjs(entry.publishedAt).diff(dayjs(), "minute"), "minute", ) .humanize()} diff --git a/src/renderer/src/components/entry-column/picture-item.tsx b/src/renderer/src/components/entry-column/picture-item.tsx index b59acfdacc..b9c07214ca 100644 --- a/src/renderer/src/components/entry-column/picture-item.tsx +++ b/src/renderer/src/components/entry-column/picture-item.tsx @@ -1,7 +1,8 @@ import dayjs from "@renderer/lib/dayjs" import { SiteIcon } from "../site-icon" +import { EntriesResponse } from "@renderer/lib/types" -export function PictureItem({ entry }: { entry: any }) { +export function PictureItem({ entry }: { entry: EntriesResponse[number] }) { return (
@@ -22,14 +23,14 @@ export function PictureItem({ entry }: { entry: any }) {
- {entry.feed.title} + {entry.feeds.title} · {dayjs .duration( - dayjs(entry.published_at).diff(dayjs(), "minute"), + dayjs(entry.publishedAt).diff(dayjs(), "minute"), "minute", ) .humanize()} diff --git a/src/renderer/src/components/entry-column/social-media-item.tsx b/src/renderer/src/components/entry-column/social-media-item.tsx index d3866567f3..c3116cc5cb 100644 --- a/src/renderer/src/components/entry-column/social-media-item.tsx +++ b/src/renderer/src/components/entry-column/social-media-item.tsx @@ -1,10 +1,11 @@ import dayjs from "@renderer/lib/dayjs" import { SiteIcon } from "@renderer/components/site-icon" +import { EntriesResponse } from "@renderer/lib/types" -export function SocialMediaItem({ entry }: { entry: any }) { +export function SocialMediaItem({ entry }: { entry: EntriesResponse[number] }) { return (
- +
@@ -13,13 +14,13 @@ export function SocialMediaItem({ entry }: { entry: any }) { {dayjs .duration( - dayjs(entry.published_at).diff(dayjs(), "minute"), + dayjs(entry.publishedAt).diff(dayjs(), "minute"), "minute", ) .humanize()}
-
{entry.text}
+
{entry.description}
{entry.images?.map((image) => ( diff --git a/src/renderer/src/components/entry-column/video-item.tsx b/src/renderer/src/components/entry-column/video-item.tsx index 0aa0444495..b7e1a91210 100644 --- a/src/renderer/src/components/entry-column/video-item.tsx +++ b/src/renderer/src/components/entry-column/video-item.tsx @@ -1,7 +1,8 @@ import dayjs from "@renderer/lib/dayjs" import { SiteIcon } from "../site-icon" +import { EntriesResponse } from "@renderer/lib/types" -export function VideoItem({ entry }: { entry: any }) { +export function VideoItem({ entry }: { entry: EntriesResponse[number] }) { return (
@@ -22,14 +23,14 @@ export function VideoItem({ entry }: { entry: any }) {
{entry.author} · {dayjs .duration( - dayjs(entry.published_at).diff(dayjs(), "minute"), + dayjs(entry.publishedAt).diff(dayjs(), "minute"), "minute", ) .humanize()}