Skip to content

Commit 88606c5

Browse files
committed
fix: streamline loading component rendering in Articles, Notifications, and SavedPosts pages
1 parent f6945d9 commit 88606c5

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

app/(app)/articles/_client.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,7 @@ const ArticlesPage = () => {
105105
</div>
106106
)}
107107
{status === "pending" &&
108-
Array.from({ length: 7 }, (_, i) => (
109-
<ArticleLoading key={i} />
110-
))}
108+
Array.from({ length: 7 }, (_, i) => <ArticleLoading key={i} />)}
111109
{status === "success" &&
112110
data.pages.map((page) => {
113111
return (

app/(app)/notifications/_client.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ const Notifications = () => {
9191
<div>Something went wrong... Please refresh your page.</div>
9292
)}
9393
{status === "pending" &&
94-
Array.from({ length: 7 }, (_, i) => (
95-
<Placeholder key={i} />
96-
))}
94+
Array.from({ length: 7 }, (_, i) => <Placeholder key={i} />)}
9795
{status !== "pending" && noNotifications && (
9896
<p className="text-lg font-semibold text-neutral-900 dark:text-neutral-50">
9997
No new notifications. ✅{" "}

app/(app)/saved/_client.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ const SavedPosts = () => {
3232
<PageHeading>Saved items</PageHeading>
3333
<div>
3434
{bookmarkStatus === "pending" &&
35-
Array.from({ length: 7 }, (_, i) => (
36-
<ArticleLoading key={i} />
37-
))}
35+
Array.from({ length: 7 }, (_, i) => <ArticleLoading key={i} />)}
3836
{bookmarkStatus === "error" && (
3937
<p className="py-4 font-medium">
4038
Something went wrong fetching your saved posts... Refresh the page.

0 commit comments

Comments
 (0)