Skip to content

Commit

Permalink
feat: entry columns
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Apr 28, 2024
1 parent 39e1d4e commit 41c4ca3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
13 changes: 9 additions & 4 deletions src/renderer/src/components/entry-column/notification-item.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex my-5 px-2 py-3">
<SiteIcon url={entry.feed.site_url} />
<SiteIcon url={entry.feeds.siteUrl} />
<div className="line-clamp-5 text-sm flex-1 -mt-0.5 leading-tight">
<div className="text-zinc-500 text-[10px] space-x-1">
<span>{entry.feed.title}</span>
<span>{entry.feeds.title}</span>
<span>·</span>
<span>
{dayjs
.duration(
dayjs(entry.published_at).diff(dayjs(), "minute"),
dayjs(entry.publishedAt).diff(dayjs(), "minute"),
"minute",
)
.humanize()}
Expand Down
9 changes: 5 additions & 4 deletions src/renderer/src/components/entry-column/picture-item.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex">
<div>
Expand All @@ -22,14 +23,14 @@ export function PictureItem({ entry }: { entry: any }) {
<div className="space-x-1 text-[13px]">
<SiteIcon
className="w-3.5 h-3.5 inline-block mr-0 align-sub"
url={entry.feed.site_url}
url={entry.feeds.siteUrl}
/>
<span>{entry.feed.title}</span>
<span>{entry.feeds.title}</span>
<span className="text-zinc-500">·</span>
<span className="text-zinc-500">
{dayjs
.duration(
dayjs(entry.published_at).diff(dayjs(), "minute"),
dayjs(entry.publishedAt).diff(dayjs(), "minute"),
"minute",
)
.humanize()}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex my-5 px-2 py-3">
<SiteIcon url={entry.feed.site_url} />
<SiteIcon url={entry.feeds.siteUrl} />
<div>
<div className="line-clamp-5 text-sm flex-1 -mt-0.5">
<div className="space-x-1">
Expand All @@ -13,13 +14,13 @@ export function SocialMediaItem({ entry }: { entry: any }) {
<span className="text-zinc-500">
{dayjs
.duration(
dayjs(entry.published_at).diff(dayjs(), "minute"),
dayjs(entry.publishedAt).diff(dayjs(), "minute"),
"minute",
)
.humanize()}
</span>
</div>
<div className="mt-0.5">{entry.text}</div>
<div className="mt-0.5">{entry.description}</div>
</div>
<div className="flex gap-2 overflow-x-auto mt-1">
{entry.images?.map((image) => (
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/src/components/entry-column/video-item.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="flex">
<div>
Expand All @@ -22,14 +23,14 @@ export function VideoItem({ entry }: { entry: any }) {
<div className="space-x-1 text-[13px]">
<SiteIcon
className="w-3.5 h-3.5 inline-block mr-0 align-sub"
url={entry.feed.site_url}
url={entry.feeds.siteUrl}
/>
<span>{entry.author}</span>
<span className="text-zinc-500">·</span>
<span className="text-zinc-500">
{dayjs
.duration(
dayjs(entry.published_at).diff(dayjs(), "minute"),
dayjs(entry.publishedAt).diff(dayjs(), "minute"),
"minute",
)
.humanize()}
Expand Down

0 comments on commit 41c4ca3

Please sign in to comment.