Skip to content

Commit

Permalink
feat(bookmarks-list): updated layout view fro row layout
Browse files Browse the repository at this point in the history
  • Loading branch information
JaleelB committed Aug 4, 2024
1 parent d627d28 commit e714e08
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions app/bookmarks/components/bookmark-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export default function BookmarksList({
userId={userId}
pathname={pathname}
articleId={id}
layout={layout}
/>
))
) : (
Expand Down Expand Up @@ -200,11 +201,13 @@ function BookmarkCard({
userId,
articleId,
pathname,
layout,
}: {
bookmark: Bookmark;
userId: number;
articleId: string;
pathname: string;
layout: Layout;
}) {
const [dialogState, setDialogState] = useState<
"closed" | "dropdown" | "alert"
Expand All @@ -229,12 +232,18 @@ function BookmarkCard({
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<div className="flex flex-col">
<Link
href={(bookmark.authorProfileURL as string) || "#"}
className="font-medium"
>
{bookmark.authorName}
</Link>
{layout === "grid" ? (
<Link
href={(bookmark.authorProfileURL as string) || "#"}
className="pb-1 font-medium"
>
{bookmark.authorName}
</Link>
) : (
<Balancer as="h3" className="pb-1 font-medium">
{bookmark.title}
</Balancer>
)}
<div className="text-sm text-muted-foreground">
{bookmark.readTime}
{bookmark.publishDate && <span className="px-2">·</span>}
Expand Down Expand Up @@ -466,15 +475,19 @@ function BookmarkCard({
</AlertDialog>
</div>
</div>
<Balancer
as="h3"
className={`truncate pt-4 font-semibold leading-6 transition-colors md:text-xl`}
>
{bookmark.title}
</Balancer>
<CardDescription className={cn("pt-2")}>
{extractFirstSentence(bookmark.content)}
</CardDescription>
{layout === "grid" ? (
<>
<Balancer
as="h3"
className={`truncate pt-4 font-semibold leading-6 transition-colors md:text-xl`}
>
{bookmark.title}
</Balancer>
<CardDescription className={cn("pt-2")}>
{extractFirstSentence(bookmark.content)}
</CardDescription>
</>
) : null}
</CardContent>
</Card>
);
Expand Down

0 comments on commit e714e08

Please sign in to comment.