Skip to content

Commit 97ebd8f

Browse files
committed
fix: update tag link and improve image handling in TagArticleFeed component
1 parent f4d7732 commit 97ebd8f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/app/(home)/_components/HomeLeftSidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const tags = [
9696
{
9797
icon: "https://res.cloudinary.com/techdiary-dev/image/upload/v1620782239/static-assets/tag-icons/erfbu54l2mquphszheck.svg",
9898
label: "react",
99-
link: "/tags/react",
99+
link: "/tags/186e052a-9c5b-4ffe-b753-ea172ac2e663",
100100
},
101101
{
102102
icon: "https://res.cloudinary.com/techdiary-dev/image/upload/v1620782240/static-assets/tag-icons/rh7xfiz28bxklfzymftd.svg",

src/app/tags/[tag_id]/_components/TagArticleFeed.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ const TagArticleFeed: React.FC<TagArticleFeedProps> = ({ tagId }) => {
106106
handle={article?.handle ?? ""}
107107
title={article?.title ?? ""}
108108
excerpt={article?.excerpt ?? ""}
109-
coverImage={getFileUrl(article?.cover_image!)}
109+
coverImage={article?.cover_image ? getFileUrl(article.cover_image) : ""}
110110
author={{
111111
id: article?.user?.id ?? "",
112112
name: article?.user?.name ?? "",
113113
avatar: article?.user?.profile_photo
114-
? getFileUrl(article?.user?.profile_photo!)
114+
? getFileUrl(article.user.profile_photo)
115115
: "",
116116
username: article?.user?.username ?? "",
117117
}}
@@ -124,7 +124,6 @@ const TagArticleFeed: React.FC<TagArticleFeedProps> = ({ tagId }) => {
124124
<VisibilitySensor
125125
visible={tagFeedQuery.hasNextPage}
126126
onLoadmore={async () => {
127-
console.log(`fetching next page for tag: ${tagId}`);
128127
await tagFeedQuery.fetchNextPage();
129128
}}
130129
/>

0 commit comments

Comments
 (0)