Skip to content

Commit

Permalink
feat(frontend): better align of grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Nov 2, 2024
1 parent f10fdc1 commit 794cc9d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions apps/frontend/src/components/blog/recent-articles.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,18 @@ const articles = await getArticles({
<section class:list={['max-sm:py-6 py-16 pt-8 recent-articles', className]}>
<div class="container mx-auto px-4">
<h2 class="mb-8 text-3xl font-semibold text-center">Recent Articles</h2>
<div class="grid grid-cols-1 max-sm:gap-4 gap-6 lg:gap-16 md:grid-cols-3">
{articles.map(article => (
<ArticleCard article={article} />
))}
<div
class={
articles.length < 3
? 'flex flex-col md:flex-row items-top gap-6 max-w-[1100px] mx-auto'
: 'grid grid-cols-1 max-sm:gap-4 gap-6 lg:gap-16 md:grid-cols-3'
}
>
{
articles.length > 0
? articles.map(article => <ArticleCard article={article} />)
: <p class="text-center col-span-full">No articles available.</p>
}
</div>
</div>
</section>

0 comments on commit 794cc9d

Please sign in to comment.