Skip to content

Commit

Permalink
feat: hide module when no data (#322)
Browse files Browse the repository at this point in the history
* feat: hide module when no data

* chore: simplified writing
  • Loading branch information
TinsFox authored Mar 29, 2024
1 parent f358934 commit c878b8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/(app)/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ const Hero = () => {
const PostScreen = () => {
const { posts } = useHomeQueryData()

if (posts.length <= 0) return null
return (
<Screen className="h-fit min-h-[120vh]">
<TwoColumnLayout leftContainerClassName="h-[30rem] lg:h-1/2">
Expand Down Expand Up @@ -488,6 +489,9 @@ const FriendScreen = () => {
}, []),
staleTime: 1000 * 60 * 10,
})

if (!data || data?.length <= 0) return null

return (
<Screen className="flex h-auto min-h-screen center">
<div className="flex min-w-0 flex-col">
Expand Down

0 comments on commit c878b8f

Please sign in to comment.