@@ -76,6 +76,8 @@ const FreeCodeCamp: FC<{}> = () => {
76
76
= useState ( textFormatGetSafeString ( routeParams . module ) )
77
77
const [ lessonParam , setLessonParam ] : [ string , Dispatch < SetStateAction < string > > ]
78
78
= useState ( textFormatGetSafeString ( routeParams . lesson ) )
79
+ const [ fccFrameReady , setFccFrameReady ] : [ boolean , Dispatch < SetStateAction < boolean > > ]
80
+ = useState ( false )
79
81
80
82
const {
81
83
certificationProgress : certificateProgress ,
@@ -205,6 +207,8 @@ const FreeCodeCamp: FC<{}> = () => {
205
207
}
206
208
207
209
const handleFccLessonReady : ( lessonPath : string ) => void = useCallback ( ( lessonPath : string ) => {
210
+ // mark fcc frame as being ready once we get the first "lesson ready"
211
+ setFccFrameReady ( true )
208
212
209
213
const [ nLessonPath , modulePath , coursePath ] : Array < string > = lessonPath . replace ( / \/ $ / , '' )
210
214
. split ( '/' )
@@ -622,12 +626,16 @@ const FreeCodeCamp: FC<{}> = () => {
622
626
onNavigate = { handleNavigate }
623
627
/>
624
628
< hr />
625
- < FccFrame
626
- lesson = { lesson }
627
- onFccLessonChange = { handleFccLessonReady }
628
- onFccLessonComplete = { handleFccLessonComplete }
629
- onFccLastLessonNavigation = { handleFccLastLessonNavigation }
630
- />
629
+
630
+ < div className = { styles [ 'course-iframe' ] } >
631
+ < LoadingSpinner className = { styles [ 'course-frame-loader' ] } hide = { fccFrameReady } />
632
+ < FccFrame
633
+ lesson = { lesson }
634
+ onFccLessonChange = { handleFccLessonReady }
635
+ onFccLessonComplete = { handleFccLessonComplete }
636
+ onFccLastLessonNavigation = { handleFccLastLessonNavigation }
637
+ />
638
+ </ div >
631
639
</ div >
632
640
</ div >
633
641
) }
0 commit comments