@@ -99,7 +99,6 @@ function generateHexagonPoints(halfWidth: number, quarterHeight: number) {
99
99
export function FastTrackProgress ( { doc, search} : { doc : IsaacFastTrackQuestionPageDTO ; search : string } ) {
100
100
const { questionHistory : qhs } : { questionHistory ?: string } = queryString . parse ( search ) ;
101
101
const questionHistory = qhs ? qhs . split ( "," ) : [ ] ;
102
-
103
102
const dispatch = useDispatch ( ) ;
104
103
const gameboardMaybeNull = useSelector ( board . currentGameboard ) ;
105
104
const fasttrackConcepts = useSelector ( ( appState : AppState ) => appState && appState . fasttrackConcepts ) ;
@@ -127,7 +126,7 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
127
126
}
128
127
} , [ gameboardMaybeNull , doc , conceptQuestions ] ) ;
129
128
130
- if ( ! gameboardMaybeNull || conceptQuestions === null ) return null ;
129
+ if ( gameboardMaybeNull === null && conceptQuestions === null ) return null ;
131
130
132
131
// @ts -ignore Assert the properties we use and we know the API returns
133
132
const gameboard : GameboardDTO & { id : string ; title : string ; questions : GameboardItem [ ] } = gameboardMaybeNull ;
@@ -143,8 +142,7 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
143
142
}
144
143
145
144
const currentlyWorkingOn = getCurrentlyWorkingOn ( ) ;
146
-
147
- if ( ! currentlyWorkingOn . isConcept || currentlyWorkingOn . fastTrackLevel === undefined ) {
145
+ if ( currentlyWorkingOn . fastTrackLevel === undefined ) {
148
146
return null ;
149
147
}
150
148
@@ -259,7 +257,7 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
259
257
interface Progress {
260
258
title : string ;
261
259
conceptTitle : string ;
262
- questions : { [ key in QuestionLevel ] : AugmentedQuestion [ ] } ;
260
+ questions : { [ key in QuestionLevel ] : AugmentedQuestion [ ] } ;
263
261
connections : {
264
262
topTenToUpper : Connection [ ] ;
265
263
upperToLower : Connection [ ] ;
@@ -464,13 +462,13 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
464
462
}
465
463
466
464
function renderProgress ( progress : Progress ) {
467
- return < RS . Row className = "my -sm-3" >
465
+ return < RS . Row className = "mt -sm-3 mb-sm-4 " >
468
466
< RS . Col cols = { 12 } md = { 3 } lg = { 4 } >
469
- < h4 > { gameboard . title } </ h4 >
467
+ < h4 className = "mt-lg-1" > { gameboard . title } </ h4 >
470
468
< div className = "d-none d-md-block" >
471
469
< br className = "d-none d-md-block" />
472
470
< br className = "d-none d-lg-block" />
473
- { currentlyWorkingOn . isConcept && < h4 > { currentlyWorkingOn . title } Practice</ h4 > }
471
+ { currentlyWorkingOn . isConcept && < h4 className = "mt-lg-1" > { currentlyWorkingOn . title } Practice</ h4 > }
474
472
</ div >
475
473
</ RS . Col >
476
474
< RS . Col cols = { 12 } md = { 9 } lg = { 8 } >
@@ -500,8 +498,7 @@ export function FastTrackProgress({doc, search}: {doc: IsaacFastTrackQuestionPag
500
498
</ RS . Row > ;
501
499
}
502
500
503
- const categorisedConceptQuestions = categoriseConceptQuestions ( conceptQuestions ) ;
504
- if ( ! categorisedConceptQuestions ) return null ;
501
+ const categorisedConceptQuestions = categoriseConceptQuestions ( conceptQuestions || [ ] ) ;
505
502
const progress = evaluateProgress ( categorisedConceptQuestions , questionHistory ) ;
506
503
return renderProgress ( progress ) ;
507
504
}
0 commit comments