diff --git a/src-ts/tools/learn/my-learning/MyLearning.module.scss b/src-ts/tools/learn/my-learning/MyLearning.module.scss index 1bf71cb38..c0a505fd7 100755 --- a/src-ts/tools/learn/my-learning/MyLearning.module.scss +++ b/src-ts/tools/learn/my-learning/MyLearning.module.scss @@ -1,5 +1,10 @@ @import '../../../lib/styles/includes'; +.wrap { + flex: 1 1 auto; + position: relative; +} + .content-layout { background: $black-5; } @@ -34,6 +39,7 @@ gap: $pad-lg; display: flex; flex-direction: column; + position: relative; &:empty { display: none; } @@ -57,4 +63,8 @@ flex: 1 1 0; } } +} + +.loading-spinner { + background: none; } \ No newline at end of file diff --git a/src-ts/tools/learn/my-learning/MyLearning.tsx b/src-ts/tools/learn/my-learning/MyLearning.tsx index 2d408485f..115f63ce6 100755 --- a/src-ts/tools/learn/my-learning/MyLearning.tsx +++ b/src-ts/tools/learn/my-learning/MyLearning.tsx @@ -1,6 +1,6 @@ import { FC, useContext, useMemo } from 'react' -import { Breadcrumb, BreadcrumbItemModel, ContentLayout, Portal, profileContext, ProfileContextData } from '../../../lib' +import { Breadcrumb, BreadcrumbItemModel, ContentLayout, LoadingSpinner, Portal, profileContext, ProfileContextData } from '../../../lib' import { AllCertificationsProviderData, LearnCertification, @@ -24,9 +24,11 @@ interface CertificatesByIdType { const MyLearning: FC<{}> = () => { - const { profile }: ProfileContextData = useContext(profileContext) - const { completed, inProgress }: UserCertificationsProviderData = useUserCertifications() - const { certifications }: AllCertificationsProviderData = useAllCertifications() + const { profile, initialized: profileReady }: ProfileContextData = useContext(profileContext) + const { completed, inProgress, ready: coursesReady }: UserCertificationsProviderData = useUserCertifications() + const { certifications, ready: certificatesReady }: AllCertificationsProviderData = useAllCertifications() + + const ready: boolean = profileReady && coursesReady && certificatesReady const certificatesById: CertificatesByIdType = useMemo(() => ( certifications.reduce((certifs, certificate) => { @@ -46,6 +48,8 @@ const MyLearning: FC<{}> = () => {
+ +
= () => {
-
- {inProgress.map((certif) => ( - - ))} -
- - {!!completed.length && ( -
-
- -

Completed Courses

-
- -
- {completed.map((certif) => ( - +
+ {inProgress.map((certif) => ( + ))}
-
+ + {!!completed.length && ( +
+
+ +

Completed Courses

+
+ +
+ {completed.map((certif) => ( + + ))} +
+
+ )} + )}