Skip to content

Commit 77ea31c

Browse files
author
Ethan Jon
committed
no articles found on homepage
1 parent 17bb8f7 commit 77ea31c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

react/pages/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const Home = ({pageData, postsData}: Object, {siteData}: Object) => {
5353
{siteData.description}
5454
</div>
5555

56-
{postsData.filter(didPassPasswordAuthorization).map(postData => (
56+
{postsData.length ? postsData.filter(didPassPasswordAuthorization).map(postData => (
5757
<Link
5858
as={postData.link}
5959
href={getUrlObj(postData)}
@@ -91,7 +91,9 @@ export const Home = ({pageData, postsData}: Object, {siteData}: Object) => {
9191
</div>
9292
</a>
9393
</Link>
94-
))}
94+
)) : (
95+
<div className='center my3 h2'>{'No articles published yet.'}</div>
96+
)}
9597

9698
<hr />
9799
</div>

0 commit comments

Comments
 (0)