@@ -4,93 +4,29 @@ import Link from 'gatsby-link'
44import cx from 'classnames'
55
66const ProgramSchedule = ( ) => (
7- < StaticQuery
8- query = { graphql `
9- query {
10- allCohort(sort: { order: ASC, fields: beginsOn }) {
11- nodes {
12- id
13- name
14- isEnrolling
15- beginsOn(formatString: "MMMM D, YYYY")
16- endsOn(formatString: "MMMM Do, YYYY")
17- altBeginsOn: beginsOn(formatString: "MMMM YYYY")
18- altEndsOn: endsOn(formatString: "MMMM YYYY")
19- daysFromNow: beginsOn(difference: "days")
20- format
21- delivery
22- note
23- }
24- }
25- }
26- ` }
27- render = { ( data ) => (
28- < >
29- < h3 className = "title is-3" > Program Schedule</ h3 >
30- < div className = "table-container" >
31- < table className = "table is-fullwidth program-schedule" >
32- < thead >
33- < tr >
34- < th > Cohort</ th >
35- < th > Status</ th >
36- < th > Classes Start</ th >
37- < th > Expected Graduation</ th >
38- < th > Format</ th >
39- < th > Daily Schedule</ th >
40- </ tr >
41- </ thead >
42- < tbody >
43- { data . allCohort . nodes . map ( ( cohort ) => (
44- < tr
45- key = { cohort . id }
46- className = { cx ( {
47- upcoming :
48- cohort . isEnrolling && parseInt ( cohort . daysFromNow ) > - 90 ,
49- } ) }
50- >
51- < td > Cohort { cohort . name } </ td >
52- < td >
53- { cohort . isEnrolling && (
54- < Link to = "/academy/apply" > Now Enrolling</ Link >
55- ) }
56- </ td >
57- < td >
58- { parseInt ( cohort . daysFromNow ) < - 180
59- ? cohort . altBeginsOn
60- : cohort . beginsOn }
61- </ td >
62- < td >
63- { parseInt ( cohort . daysFromNow ) < - 180
64- ? cohort . altEndsOn
65- : cohort . endsOn }
66- </ td >
67- < td >
68- { cohort . format === 'Night Shift' ? (
69- < > { cohort . format } </ >
70- ) : (
71- < >
72- { cohort . format } / { cohort . delivery }
73- </ >
74- ) }
75- </ td >
76- < td >
77- { cohort . format === 'Night Shift' ? (
78- < > { cohort . note } </ >
79- ) : (
80- < >
81- Mon–Thu — 9 a.m.–5 p.m., Fri — 9
82- a.m.–3 p.m.
83- </ >
84- ) }
85- </ td >
86- </ tr >
87- ) ) }
88- </ tbody >
89- </ table >
90- </ div >
91- </ >
92- ) }
93- />
7+ < >
8+ < h3 className = "title is-3" > Program Schedule</ h3 >
9+ < div className = "table-container" >
10+ < table className = "table is-fullwidth program-schedule" >
11+ < thead >
12+ < tr >
13+ < th > Cohort</ th >
14+ < th > Status</ th >
15+ < th > Classes Start</ th >
16+ < th > Expected Graduation</ th >
17+ < th > Format</ th >
18+ < th > Daily Schedule</ th >
19+ </ tr >
20+ </ thead >
21+ < tbody >
22+ < tr >
23+ < td colSpan = { 6 } > There are currently no cohorts scheduled.</ td >
24+ </ tr >
25+ ))}
26+ </ tbody >
27+ </ table >
28+ </ div >
29+ </ >
9430)
9531
9632export default ProgramSchedule
0 commit comments