@@ -25,38 +25,35 @@ import { Container } from './Container';
2525import { ListSkeleton } from './ListSkeleton' ;
2626// import { LearnNavBar } from './nav'
2727
28+ const titles = {
29+ courses : {
30+ title : 'Open Courses' ,
31+ desc : 'Selected open courses from technical skills to practical tasks, accessible to everyone with no cost!' ,
32+ } ,
33+ challenges : {
34+ title : 'Challenges' ,
35+ desc : 'Hands-on Bootcamp, Workshop or Hackerhouse, etc.' ,
36+ } ,
37+ career_path : {
38+ title : 'Career Path' ,
39+ desc : 'Learning paths designed for different levels of builder' ,
40+ } ,
41+ } ;
2842
2943export default async function Page ( { params, searchParams } ) {
44+ const titleData = titles ?. [ params ?. type ] ;
45+
3046 return (
3147 < div >
3248 < div className = "px-6" >
33- { params . type === 'courses' && (
34- < Title
35- title = "Open Courses"
36- desc = "Selected open courses from technical skills to practical tasks, accessible to everyone with no cost!"
37- // link="https://forms.gle/s2tDbixtdqTU8xbp9"
38- // linkText="Click Here"
39- />
40- ) }
41- { params . type === 'challenges' && (
42- < Title
43- title = "Challenges"
44- desc = "Hands-on Bootcamp, Workshop or Hackerhouse, etc."
45- // link="https://forms.gle/s2tDbixtdqTU8xbp9"
46- // linkText="Click Here"
47- />
48- ) }
49- { params . type === 'career_path' && (
50- < Title
51- title = "Career Path"
52- desc = "Learning paths designed for different levels of builder"
53- />
54- ) }
49+ { titleData && < Title title = { titleData . title } desc = { titleData . desc } /> }
5550 { /* <LearnNavBar /> */ }
5651 < div className = "relative flex max-md:overflow-x-hidden" >
57- < Filter type = { params . type === 'courses' ? 'open_course' : params . type } > { params . type === 'challenges' && < ChallengesFilter /> } </ Filter >
52+ < Filter type = { params . type === 'courses' ? 'open_course' : params . type } >
53+ { params . type === 'challenges' && < ChallengesFilter /> }
54+ </ Filter >
5855 < Suspense fallback = { < ListSkeleton /> } >
59- < Container type = { params . type } searchParams = { searchParams } />
56+ < Container type = { params . type } searchParams = { searchParams } />
6057 </ Suspense >
6158 </ div >
6259 </ div >
0 commit comments