@@ -8,124 +8,124 @@ import Markdown from '../../../components/Markdown'
88import ProcessEvents from '../../../components/ProcessEvents'
99
1010const styles = {
11- page : {
12- backgroundColor : 'white' ,
13- position : 'relative' as 'relative' ,
14- display : 'flex' as 'flex' ,
15- flexDirection : 'column' as 'column' ,
16- padding : 0 ,
17- paddingBottom : '36px' ,
18- height : 'auto' ,
19- width : '100%' ,
20- } ,
21- header : {
22- height : '36px' ,
23- backgroundColor : '#EBEBEB' ,
24- fontSize : '16px' ,
25- lineHeight : '16px' ,
26- padding : '10px 1rem' ,
27- } ,
28- content : {
29- padding : '0rem 1rem' ,
30- paddingBottom : '1rem' ,
31- } ,
32- tasks : {
33- paddingBottom : '5rem' ,
34- } ,
35- steps : {
36- padding : '1rem 16px' ,
37- } ,
38- title : {
39- fontSize : '1.2rem' ,
40- fontWeight : 'bold' as 'bold' ,
41- lineHeight : '1.2rem' ,
42- } ,
43- processes : {
44- padding : '0 1rem' ,
45- position : 'absolute' as 'absolute' ,
46- bottom : '36px' ,
47- } ,
48- footer : {
49- display : 'flex' as 'flex' ,
50- flexDirection : 'row' as 'row' ,
51- justifyContent : 'space-between' ,
52- alignItems : 'center' ,
53- height : '36px' ,
54- backgroundColor : 'black' ,
55- fontSize : '16px' ,
56- lineHeight : '16px' ,
57- padding : '10px 1rem' ,
58- position : 'fixed' as 'fixed' ,
59- bottom : 0 ,
60- left : 0 ,
61- right : 0 ,
62- color : 'white' ,
63- } ,
11+ page : {
12+ backgroundColor : 'white' ,
13+ position : 'relative' as 'relative' ,
14+ display : 'flex' as 'flex' ,
15+ flexDirection : 'column' as 'column' ,
16+ padding : 0 ,
17+ paddingBottom : '36px' ,
18+ height : 'auto' ,
19+ width : '100%' ,
20+ } ,
21+ header : {
22+ height : '36px' ,
23+ backgroundColor : '#EBEBEB' ,
24+ fontSize : '16px' ,
25+ lineHeight : '16px' ,
26+ padding : '10px 1rem' ,
27+ } ,
28+ content : {
29+ padding : '0rem 1rem' ,
30+ paddingBottom : '1rem' ,
31+ } ,
32+ tasks : {
33+ paddingBottom : '5rem' ,
34+ } ,
35+ steps : {
36+ padding : '1rem 16px' ,
37+ } ,
38+ title : {
39+ fontSize : '1.2rem' ,
40+ fontWeight : 'bold' as 'bold' ,
41+ lineHeight : '1.2rem' ,
42+ } ,
43+ processes : {
44+ padding : '0 1rem' ,
45+ position : 'absolute' as 'absolute' ,
46+ bottom : '36px' ,
47+ } ,
48+ footer : {
49+ display : 'flex' as 'flex' ,
50+ flexDirection : 'row' as 'row' ,
51+ justifyContent : 'space-between' ,
52+ alignItems : 'center' ,
53+ height : '36px' ,
54+ backgroundColor : 'black' ,
55+ fontSize : '16px' ,
56+ lineHeight : '16px' ,
57+ padding : '10px 1rem' ,
58+ position : 'fixed' as 'fixed' ,
59+ bottom : 0 ,
60+ left : 0 ,
61+ right : 0 ,
62+ color : 'white' ,
63+ } ,
6464}
6565
6666interface Props {
67- level : G . Level & { status : T . ProgressStatus ; index : number ; steps : Array < G . Step & { status : T . ProgressStatus } > }
68- processes : T . ProcessEvent [ ]
69- onContinue ( ) : void
70- onLoadSolution ( ) : void
67+ level : G . Level & { status : T . ProgressStatus ; index : number ; steps : Array < G . Step & { status : T . ProgressStatus } > }
68+ processes : T . ProcessEvent [ ]
69+ onContinue ( ) : void
70+ onLoadSolution ( ) : void
7171}
7272
7373const Level = ( { level, onContinue, onLoadSolution, processes } : Props ) => {
74- if ( ! level . steps ) {
75- throw new Error ( 'No Stage steps found' )
76- }
74+ if ( ! level . steps ) {
75+ throw new Error ( 'No Stage steps found' )
76+ }
7777
78- return (
79- < div style = { styles . page } >
80- < div style = { styles . header } >
81- < span > Learn</ span >
82- </ div >
83- < div style = { styles . content } >
84- < h2 style = { styles . title } > { level . title } </ h2 >
85- < Markdown > { level . content || '' } </ Markdown >
86- </ div >
78+ return (
79+ < div style = { styles . page } >
80+ < div style = { styles . header } >
81+ < span > Learn</ span >
82+ </ div >
83+ < div style = { styles . content } >
84+ < h2 style = { styles . title } > { level . title } </ h2 >
85+ < Markdown > { level . content || '' } </ Markdown >
86+ </ div >
8787
88- < div style = { styles . tasks } >
89- < div style = { styles . header } > Tasks</ div >
90- < div style = { styles . steps } >
91- { level . steps . map ( ( step : ( G . Step & { status : T . ProgressStatus } ) | null , index : number ) => {
92- if ( ! step ) {
93- return null
94- }
95- return (
96- < Step
97- key = { step . id }
98- order = { index + 1 }
99- status = { step . status }
100- content = { step . content }
101- onLoadSolution = { onLoadSolution }
102- />
103- )
104- } ) }
105- </ div >
106- </ div >
88+ < div style = { styles . tasks } >
89+ < div style = { styles . header } > Tasks</ div >
90+ < div style = { styles . steps } >
91+ { level . steps . map ( ( step : ( G . Step & { status : T . ProgressStatus } ) | null , index : number ) => {
92+ if ( ! step ) {
93+ return null
94+ }
95+ return (
96+ < Step
97+ key = { step . id }
98+ order = { index + 1 }
99+ status = { step . status }
100+ content = { step . content }
101+ onLoadSolution = { onLoadSolution }
102+ />
103+ )
104+ } ) }
105+ </ div >
106+ </ div >
107107
108- { processes . length > 0 && (
109- < div style = { styles . processes } >
110- < ProcessEvents processes = { processes } />
111- </ div >
112- ) }
108+ { processes . length > 0 && (
109+ < div style = { styles . processes } >
110+ < ProcessEvents processes = { processes } />
111+ </ div >
112+ ) }
113113
114- < div style = { styles . footer } >
115- < span >
116- { typeof level . index === 'number' ? `${ level . index + 1 } . ` : '' }
117- { level . title }
118- </ span >
119- < span >
120- { level . status === 'COMPLETE' && (
121- < Button type = "primary" onClick = { onContinue } >
122- Continue
123- </ Button >
124- ) }
125- </ span >
126- </ div >
127- </ div >
128- )
114+ < div style = { styles . footer } >
115+ < span >
116+ { typeof level . index === 'number' ? `${ level . index + 1 } . ` : '' }
117+ { level . title }
118+ </ span >
119+ < span >
120+ { level . status === 'COMPLETE' && (
121+ < Button type = "primary" onClick = { onContinue } >
122+ Continue
123+ </ Button >
124+ ) }
125+ </ span >
126+ </ div >
127+ </ div >
128+ )
129129}
130130
131131export default Level
0 commit comments