fix: hide stories when no articles are published

This commit is contained in:
Sol Irvine 2023-08-23 20:49:17 -07:00
parent 70e75dc725
commit 01f38e04cb
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ import Navbar from 'components/layout/navbar';
import NewsletterSignup from 'components/layout/newsletter-signup';
import SagyobarPreview from 'components/layout/sagyobar-preview';
import Shoplist from 'components/layout/shoplist';
import Stories from 'components/layout/stories';
import StoriesPreview from 'components/layout/stories-preview';
import { BLOG_HANDLE } from 'lib/constants';
import { getCart } from 'lib/shopify';
import { cookies } from 'next/headers';
@ -132,7 +132,7 @@ export default async function HomePage({
</div>
<div className="relative">
<Stories handle={BLOG_HANDLE} articles={3} locale={locale} more />
<StoriesPreview handle={BLOG_HANDLE} articles={3} locale={locale} more />
</div>
<div className="relative">

View File

@ -4,7 +4,7 @@ import Image from 'next/image';
import Link from 'next/link';
import { SupportedLocale } from './navbar/language-control';
export default async function Stories({
export default async function StoriesPreview({
locale,
handle,
articles,
@ -21,7 +21,7 @@ export default async function Stories({
language: locale?.toUpperCase()
});
if (!blog) return null;
if (!blog || !!blog?.articles) return null;
return (
<div className="bg-white px-6 py-24 text-black">