File tree Expand file tree Collapse file tree
frontend/main/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,6 +167,46 @@ export default function PostLayout({
167167 </ section >
168168
169169 < section className = "grid grid-cols-1 gap-4 p-10 2xl:grid-cols-sidebar 2xl:pl-10" >
170+ { /* LESSONS */ }
171+ { course && course . sections && (
172+ < section className = "grid content-start grid-cols-1 row-start-2 gap-4 2xl:col-start-2 2xl:row-start-1" >
173+ { course . sections . map ( ( section ) => (
174+ < section
175+ key = { section . id }
176+ className = "flex flex-col bg-basics-50 rounded-t-md"
177+ >
178+ < h2 className = "p-2 m-0 text-2xl font-bold xl:p-4 rounded-t-md xl:flex-shrink-0 bg-secondary-600 dark:bg-secondary-600 text-basics-50 dark:text-basics-50" >
179+ { section . title }
180+ </ h2 >
181+ < ul className = "flex flex-col flex-grow justify-items-stretch" >
182+ { section . lessons &&
183+ section . lessons . map ( ( lesson ) => (
184+ < li key = { lesson . id } className = "ml-0 list-none" >
185+ < Link
186+ href = { `/course/${ course . slug } /lesson/${ lesson . slug } ` }
187+ key = { lesson . id }
188+ >
189+ < div
190+ className = { `p-2 cursor-pointer
191+ ${
192+ isActiveLink ( course , lesson )
193+ ? 'bg-primary-200'
194+ : 'bg-transparent'
195+ }
196+ ` }
197+ >
198+ < a className = "no-underline text-basics-900 hover:text-primary-900 hover:underline" >
199+ { lesson . title }
200+ </ a >
201+ </ div >
202+ </ Link >
203+ </ li >
204+ ) ) }
205+ </ ul >
206+ </ section >
207+ ) ) }
208+ </ section >
209+ ) }
170210 { /* RECENTS */ }
171211 { recentPosts && (
172212 < section className = "grid content-start grid-cols-1 row-start-2 gap-4 2xl:col-start-2 2xl:row-start-1" >
You can’t perform that action at this time.
0 commit comments