@@ -76,6 +76,8 @@ const FreeCodeCamp: FC<{}> = () => {
7676 = useState ( textFormatGetSafeString ( routeParams . module ) )
7777 const [ lessonParam , setLessonParam ] : [ string , Dispatch < SetStateAction < string > > ]
7878 = useState ( textFormatGetSafeString ( routeParams . lesson ) )
79+ const [ fccFrameReady , setFccFrameReady ] : [ boolean , Dispatch < SetStateAction < boolean > > ]
80+ = useState ( false )
7981
8082 const {
8183 certificationProgress : certificateProgress ,
@@ -205,6 +207,8 @@ const FreeCodeCamp: FC<{}> = () => {
205207 }
206208
207209 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 )
208212
209213 const [ nLessonPath , modulePath , coursePath ] : Array < string > = lessonPath . replace ( / \/ $ / , '' )
210214 . split ( '/' )
@@ -622,12 +626,16 @@ const FreeCodeCamp: FC<{}> = () => {
622626 onNavigate = { handleNavigate }
623627 />
624628 < 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 >
631639 </ div >
632640 </ div >
633641 ) }
0 commit comments