@@ -15,44 +15,6 @@ import useStyles from './styles';
1515export interface Params {
1616 readonly courseSlug : string ;
1717}
18-
19- // FETCH FROM API
20- const sections = [
21- {
22- id : '1' ,
23- title : 'Introduction and setup' ,
24- } ,
25- {
26- id : '2' ,
27- title : 'Helm basics' ,
28- } ,
29- {
30- id : '3' ,
31- title : 'Jenkins CI/CD setup' ,
32- } ,
33- {
34- id : '4' ,
35- title : 'Dockerizing node.js application' ,
36- } ,
37- {
38- id : '5' ,
39- title : 'Deployment on AWS' ,
40- } ,
41- ] . map ( section => ( { ...section , units : [
42- {
43- title : 'Introduction and the goal of this course'
44- } ,
45- {
46- title : 'V8 Under the Hood'
47- } ,
48- {
49- title : 'The Javascript Core'
50- } ,
51- {
52- title : 'RESTful APIs and JSON'
53- }
54- ] } ) ) ;
55-
5618const CourseView = ( { match } : RouteComponentProps < Params > ) => {
5719 const classes = useStyles ( ) ;
5820
@@ -76,6 +38,23 @@ const CourseView = ({ match }: RouteComponentProps<Params>) => {
7638 ? assetsUrl ( course . imageUrl )
7739 : courseImagePlaceholder ;
7840 const coursePrice = Number ( Math . random ( ) * 10 + 9 ) . toFixed ( 2 ) ;
41+ const sections = course . sections . map ( section => ( {
42+ ...section ,
43+ units : [
44+ {
45+ title : 'Introduction and the goal of this course' ,
46+ } ,
47+ {
48+ title : 'V8 Under the Hood' ,
49+ } ,
50+ {
51+ title : 'The Javascript Core' ,
52+ } ,
53+ {
54+ title : 'RESTful APIs and JSON' ,
55+ } ,
56+ ] ,
57+ } ) ) ;
7958
8059 return (
8160 < div className = { classes . root } >
@@ -103,18 +82,12 @@ const CourseView = ({ match }: RouteComponentProps<Params>) => {
10382 < Container >
10483 < Grid container spacing = { 3 } >
10584 < Grid item xs = { 12 } sm = { 9 } >
106- < Paper className = { classes . paper } >
107- { /* <div
108- dangerouslySetInnerHTML={{
109- __html: course.description as string,
110- }}
111- /> */ }
112- < Typography variant = "h3" className = { classes . contentHeadline } >
113- Learning content:
114- </ Typography >
115-
116- < CourseSections sections = { sections } />
117- </ Paper >
85+
86+ < Typography variant = "h3" className = { classes . contentHeadline } >
87+ Learning content:
88+ </ Typography >
89+
90+ < CourseSections sections = { sections } />
11891 </ Grid >
11992 < Grid item xs = { 12 } sm = { 3 } > </ Grid >
12093 </ Grid >
0 commit comments