Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

Commit f8184d5

Browse files
committed
🎨 Mise a jour du code de la page d'accueil et du ProposeController
1 parent c961b3a commit f8184d5

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

Modules/Blog/Http/Controllers/Frontend/ProposeController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Modules\Blog\Http\Controllers\Frontend;
44

55
use Illuminate\Http\Request;
6-
use Illuminate\Support\Facades\Gate;
76
use Inertia\Inertia;
87
use Modules\Blog\Entities\Category;
98
use Modules\Blog\Entities\Post;

resources/assets/ts/pages/home/Index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,22 @@ const Home = () => {
129129
</span>
130130
</InertiaLink>
131131
</div>
132-
<h2 className="text-gray-700 mb-6 text-2xl font-medium lg:text-3xl">Les derniers tutoriels</h2>
133-
<div className="grid gap-6 max-w-lg mx-auto md:grid-cols-2 md:max-w-3xl lg:grid-cols-3 lg:max-w-none sm:mb-18">
134-
{tutorials.map((tutorial: TutorialType) => <Tutorial key={tutorial.id} tutorial={tutorial} />)}
135-
</div>
136-
<h2 className="text-gray-700 mb-6 text-2xl font-medium lg:text-3xl">Les derniers articles</h2>
137-
<div className="grid gap-6 max-w-lg mx-auto md:grid-cols-2 md:max-w-3xl lg:grid-cols-3 lg:max-w-none sm:mb-18">
138-
{posts.map((post: PostType) => <Post key={post.id} post={post} />)}
139-
</div>
132+
{tutorials.length > 0 && (
133+
<>
134+
<h2 className="text-gray-700 mb-6 text-2xl font-medium lg:text-3xl">Les derniers tutoriels</h2>
135+
<div className="grid gap-6 max-w-lg mx-auto md:grid-cols-2 md:max-w-3xl lg:grid-cols-3 lg:max-w-none sm:mb-18">
136+
{tutorials.map((tutorial: TutorialType) => <Tutorial key={tutorial.id} tutorial={tutorial} />)}
137+
</div>
138+
</>
139+
)}
140+
{posts.length > 0 && (
141+
<>
142+
<h2 className="text-gray-700 mb-6 text-2xl font-medium lg:text-3xl">Les derniers articles</h2>
143+
<div className="grid gap-6 max-w-lg mx-auto md:grid-cols-2 md:max-w-3xl lg:grid-cols-3 lg:max-w-none sm:mb-18">
144+
{posts.map((post: PostType) => <Post key={post.id} post={post} />)}
145+
</div>
146+
</>
147+
)}
140148
</div>
141149
<div className="bg-gradient-green text-white py-6 lg:py-16">
142150
<div className="container">

0 commit comments

Comments
 (0)