@@ -5,53 +5,26 @@ import color from "@cdo/apps/util/color";
5
5
import i18n from '@cdo/locale' ;
6
6
7
7
const styles = {
8
- legendBox : {
9
- borderWidth : 1 ,
10
- float : 'left' ,
11
- display : 'inline-block' ,
12
- marginTop : 20 ,
13
- boxSizing : 'content-box' ,
14
- } ,
15
- progressBox : {
16
- float : 'left' ,
17
- width : 130 ,
18
- borderColor : color . lightest_gray ,
19
- borderWidth : 2 ,
20
- borderBottomStyle : 'solid' ,
21
- borderRightStyle : 'solid' ,
22
- } ,
23
- leftBorder : {
24
- borderColor : color . lightest_gray ,
25
- borderWidth : 2 ,
26
- borderLeftStyle : 'solid' ,
27
- } ,
28
- heading : {
29
- fontSize : 18 ,
8
+ header : {
30
9
fontWeight : 'bold' ,
31
10
color : color . charcoal ,
32
- float : 'left' ,
33
- paddingTop : 10 ,
34
- paddingBottom : 10 ,
35
11
textAlign : 'center' ,
36
12
} ,
37
- label : {
38
- fontSize : 14 ,
39
- fontWeight : 900 ,
40
- color : color . charcoal ,
41
- } ,
42
- parenthetical : {
43
- fontSize : 10 ,
13
+ th : {
14
+ backgroundColor : color . lightest_gray ,
44
15
color : color . charcoal ,
16
+ border : `1px solid ${ color . lightest_gray } ` ,
17
+ fontFamily : '"Gotham 4r", sans-serif' ,
18
+ fontSize : 14 ,
19
+ textAlign : 'center' ,
20
+ padding : 15 ,
45
21
} ,
46
- labelBox : {
47
- padding : 10 ,
48
- height : 60 ,
49
- width : '100%' ,
50
- backgroundColor : color . lightest_gray ,
51
- textAlign : 'center'
22
+ td : {
23
+ border : `1px solid ${ color . lightest_gray } ` ,
24
+ padding : 15 ,
52
25
} ,
53
- boxContainer : {
54
- padding : '15px 50px ' ,
26
+ boxStyle : {
27
+ margin : '0 auto ' ,
55
28
}
56
29
} ;
57
30
@@ -61,78 +34,87 @@ export default class SummaryViewLegend extends Component {
61
34
} ;
62
35
63
36
render ( ) {
64
- const { showCSFProgressBox } = this . props ;
65
- const headingStyle = {
66
- ...styles . heading ,
67
- width : showCSFProgressBox ? '48%' : '100%'
68
- } ;
37
+ const { showCSFProgressBox} = this . props ;
38
+ const headerColSpan = showCSFProgressBox ? 2 : 3 ;
69
39
70
40
return (
71
- < div style = { styles . legendBox } >
72
- < div >
73
- < div style = { headingStyle } > { i18n . lessonStatus ( ) } </ div >
74
- { showCSFProgressBox &&
75
- < div style = { headingStyle } > { i18n . completionStatus ( ) } </ div >
76
- }
77
- </ div >
78
- < div style = { styles . progressBox } >
79
- < div style = { styles . labelBox } >
80
- < div > { i18n . notStarted ( ) } </ div >
81
- </ div >
82
- < div style = { { ...styles . boxContainer , ...styles . leftBorder } } >
83
- < ProgressBox
84
- started = { false }
85
- incomplete = { 20 }
86
- imperfect = { 0 }
87
- perfect = { 0 }
88
- />
89
- </ div >
90
- </ div >
91
- < div style = { styles . progressBox } >
92
- < div style = { styles . labelBox } >
93
- < div > { i18n . inProgress ( ) } </ div >
94
- </ div >
95
- < div style = { styles . boxContainer } >
96
- < ProgressBox
97
- started = { true }
98
- incomplete = { 20 }
99
- imperfect = { 0 }
100
- perfect = { 0 }
101
- />
102
- </ div >
103
- </ div >
104
- < div style = { styles . progressBox } >
105
- < div style = { styles . labelBox } >
106
- < div > { i18n . completed ( ) } </ div >
107
- { showCSFProgressBox &&
108
- < div style = { styles . parenthetical } > ({ i18n . perfect ( ) } )</ div >
109
- }
110
- </ div >
111
- < div style = { styles . boxContainer } >
112
- < ProgressBox
113
- started = { true }
114
- incomplete = { 0 }
115
- imperfect = { 0 }
116
- perfect = { 20 }
117
- />
118
- </ div >
119
- </ div >
120
- { showCSFProgressBox &&
121
- < div style = { styles . progressBox } >
122
- < div style = { styles . labelBox } >
123
- < div > { i18n . completed ( ) } </ div >
124
- < div style = { styles . parenthetical } > ({ i18n . tooManyBlocks ( ) } )</ div >
125
- </ div >
126
- < div style = { styles . boxContainer } >
127
- < ProgressBox
128
- started = { true }
129
- incomplete = { 0 }
130
- imperfect = { 20 }
131
- perfect = { 0 }
132
- />
133
- </ div >
134
- </ div >
135
- }
41
+ < div style = { { marginTop : 60 } } >
42
+ < table >
43
+ < thead >
44
+ < tr >
45
+ < td colSpan = { headerColSpan } >
46
+ < h3 style = { styles . header } > { i18n . lessonStatus ( ) } </ h3 >
47
+ </ td >
48
+ { showCSFProgressBox &&
49
+ < td colSpan = { 2 } >
50
+ < h3 style = { styles . header } > { i18n . completionStatus ( ) } </ h3 >
51
+ </ td >
52
+ }
53
+ </ tr >
54
+ < tr >
55
+ < th style = { styles . th } > { i18n . notStarted ( ) } </ th >
56
+ < th style = { styles . th } > { i18n . inProgress ( ) } </ th >
57
+ < th style = { styles . th } >
58
+ { i18n . completed ( ) }
59
+ { showCSFProgressBox &&
60
+ < span >
61
+ < br />
62
+ { `(${ i18n . perfect ( ) } )` }
63
+ </ span >
64
+ }
65
+ </ th >
66
+ { showCSFProgressBox &&
67
+ < th style = { styles . th } >
68
+ { i18n . completed ( ) }
69
+ < br />
70
+ { `(${ i18n . tooManyBlocks ( ) } )` }
71
+ </ th >
72
+ }
73
+ </ tr >
74
+ </ thead >
75
+ < tbody >
76
+ < tr >
77
+ < td style = { styles . td } >
78
+ < ProgressBox
79
+ style = { styles . boxStyle }
80
+ started = { false }
81
+ incomplete = { 20 }
82
+ imperfect = { 0 }
83
+ perfect = { 0 }
84
+ />
85
+ </ td >
86
+ < td style = { styles . td } >
87
+ < ProgressBox
88
+ style = { styles . boxStyle }
89
+ started = { true }
90
+ incomplete = { 20 }
91
+ imperfect = { 0 }
92
+ perfect = { 0 }
93
+ />
94
+ </ td >
95
+ < td style = { styles . td } >
96
+ < ProgressBox
97
+ style = { styles . boxStyle }
98
+ started = { true }
99
+ incomplete = { 0 }
100
+ imperfect = { 0 }
101
+ perfect = { 20 }
102
+ />
103
+ </ td >
104
+ { showCSFProgressBox &&
105
+ < td style = { styles . td } >
106
+ < ProgressBox
107
+ style = { styles . boxStyle }
108
+ started = { true }
109
+ incomplete = { 0 }
110
+ imperfect = { 20 }
111
+ perfect = { 0 }
112
+ />
113
+ </ td >
114
+ }
115
+ </ tr >
116
+ </ tbody >
117
+ </ table >
136
118
</ div >
137
119
) ;
138
120
}
0 commit comments