11import * as React from 'react'
22import * as G from 'typings/graphql'
3+ import moment from 'moment'
34import Button from '../../components/Button'
4- import Icon from '../../components/Icon'
5- import { Divider } from '@alifd/next'
65import Markdown from '../../components/Markdown'
6+ import { Breadcrumb } from '@alifd/next'
77
88const footerHeight = '3rem'
99
@@ -14,27 +14,32 @@ const styles = {
1414 flexDirection : 'column' as 'column' ,
1515 width : '100%' ,
1616 } ,
17+ nav : {
18+ display : 'flex' ,
19+ height : '2rem' ,
20+ fontSize : '1rem' ,
21+ lineHeight : '1rem' ,
22+ alignItems : 'center' ,
23+ } ,
24+ navLink : {
25+ fontSize : '14px' ,
26+ color : 'white' ,
27+ cursor : 'pointer' ,
28+ } ,
1729 content : {
1830 paddingBottom : '3rem' ,
1931 } ,
20- summary : {
21- padding : '0rem 1rem 1rem 1rem' ,
32+ header : {
33+ color : 'white' ,
34+ backgroundColor : '#0066B8' ,
35+ padding : '1rem 1rem 1.5rem 1rem' ,
2236 } ,
2337 title : {
2438 fontWeight : 'bold' as 'bold' ,
2539 } ,
2640 description : {
2741 fontSize : '1rem' ,
2842 } ,
29- header : {
30- display : 'flex' ,
31- height : '2rem' ,
32- backgroundColor : '#EBEBEB' ,
33- fontSize : '1rem' ,
34- lineHeight : '1rem' ,
35- padding : '10px 1rem' ,
36- alignItems : 'center' ,
37- } ,
3843 levelList : {
3944 padding : '0rem 1rem' ,
4045 } ,
@@ -61,46 +66,55 @@ const styles = {
6166interface Props {
6267 title : string
6368 description : string
69+ createdBy : G . User
70+ updatedAt : string
6471 levels : G . Level [ ]
6572 onNext ( ) : void
6673 onBack ( ) : void
6774}
6875
69- const Summary = ( { title , description , levels , onNext , onBack } : Props ) => (
76+ const Summary = ( props : Props ) => (
7077 < div css = { styles . page } >
7178 < div css = { styles . content } >
7279 < div css = { styles . header } >
73- < button onClick = { onBack } >
74- < Icon type = "arrow-left" size = "xxs" />
75- </ button >
76- < span > </ span >
77- < span > CodeRoad</ span >
78- </ div >
79- < div css = { styles . summary } >
80- < h2 css = { styles . title } > { title } </ h2 >
81- < Markdown > { description } </ Markdown >
80+ < div css = { styles . nav } >
81+ < Breadcrumb separator = "/" >
82+ < Breadcrumb . Item >
83+ < div css = { styles . navLink } onClick = { props . onBack } >
84+ < Back to Tutorials
85+ </ div >
86+ </ Breadcrumb . Item >
87+ </ Breadcrumb >
88+ </ div >
89+ < h1 css = { styles . title } > { props . title } </ h1 >
90+ < h3 > { props . description } </ h3 >
91+ < h4 >
92+ < span css = { { marginRight : '2rem' } } > Created by { props . createdBy . name } </ span >
93+ < span > Last updated { moment ( props . updatedAt ) . format ( 'M/YYYY' ) } </ span >
94+ </ h4 >
8295 </ div >
8396 < div >
84- < div css = { styles . header } >
85- < span > Levels</ span >
86- </ div >
8797 < div css = { styles . levelList } >
88- { levels . map ( ( level : G . Level , index : number ) => (
98+ < h2 > Content</ h2 >
99+ { props . levels . map ( ( level : G . Level , index : number ) => (
89100 < div key = { index } >
90- < h4 >
101+ < h3 >
91102 { index + 1 } . { level . title }
92- </ h4 >
93- < div css = { styles . levelSummary } > { level . summary } </ div >
94- < Divider />
103+ </ h3 >
104+ < div css = { styles . levelSummary } >
105+ < Markdown > { level . summary } </ Markdown >
106+ </ div >
95107 </ div >
96108 ) ) }
97109 </ div >
98110 </ div >
99111 </ div >
100112
113+ < div css = { { height : '3rem ' } } />
114+
101115 < div css = { styles . footer } >
102116 { /* TODO Add back button */ }
103- < Button type = "primary" onClick = { ( ) => onNext ( ) } >
117+ < Button type = "primary" onClick = { props . onNext } >
104118 Start
105119 </ Button >
106120 </ div >
0 commit comments