Skip to content

Commit c878b8f

Browse files
authored
feat: hide module when no data (#322)
* feat: hide module when no data * chore: simplified writing
1 parent f358934 commit c878b8f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app/(app)/(home)/page.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ const Hero = () => {
221221
const PostScreen = () => {
222222
const { posts } = useHomeQueryData()
223223

224+
if (posts.length <= 0) return null
224225
return (
225226
<Screen className="h-fit min-h-[120vh]">
226227
<TwoColumnLayout leftContainerClassName="h-[30rem] lg:h-1/2">
@@ -488,6 +489,9 @@ const FriendScreen = () => {
488489
}, []),
489490
staleTime: 1000 * 60 * 10,
490491
})
492+
493+
if (!data || data?.length <= 0) return null
494+
491495
return (
492496
<Screen className="flex h-auto min-h-screen center">
493497
<div className="flex min-w-0 flex-col">

0 commit comments

Comments
 (0)