This repository was archived by the owner on Mar 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
Modules/Blog/Http/Controllers/Frontend
resources/assets/ts/pages/home Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 33namespace Modules \Blog \Http \Controllers \Frontend ;
44
55use Illuminate \Http \Request ;
6- use Illuminate \Support \Facades \Gate ;
76use Inertia \Inertia ;
87use Modules \Blog \Entities \Category ;
98use Modules \Blog \Entities \Post ;
Original file line number Diff line number Diff 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" >
You can’t perform that action at this time.
0 commit comments