Skip to content

Commit 09c7bdf

Browse files
committed
TCA-407 - add empty placeholder & update cards theme
1 parent 7565194 commit 09c7bdf

File tree

12 files changed

+103
-12
lines changed

12 files changed

+103
-12
lines changed

src-ts/lib/form/form-groups/form-input/input-select/InputSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const InputSelect: FC<InputSelectProps> = (props: InputSelectProps) => {
6868
hideInlineErrors={props.hideInlineErrors}
6969
ref={triggerRef}
7070
>
71-
<div className={styles['selected']} onClick={toggleMenu}>
71+
<div className={styles['selected']} onClick={() => !props.disabled && toggleMenu}>
7272
<span className='body-small'>{selectedOption ? label(selectedOption) : ''}</span>
7373
<span className={styles['selected-icon']}>
7474
<IconOutline.ChevronDownIcon />

src-ts/lib/form/form-groups/form-input/input-wrapper/InputWrapper.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ $error-line-height: 14px;
7878
background-color: $black-10;
7979
background: $black-10;
8080
border-color: $black-40;
81+
pointer-events: none;
8182
}
8283

8384
&.input-error {

src-ts/tools/learn/learn-lib/my-course-card/completed/Completed.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import classNames from 'classnames'
12
import { FC } from 'react'
23

34
import { Button, textFormatDateLocaleShortString } from '../../../../../lib'
@@ -18,7 +19,7 @@ const Completed: FC<CompletedProps> = (props: CompletedProps) => {
1819
}
1920

2021
return (
21-
<div className={styles['wrap']}>
22+
<div className={classNames(styles['wrap'], 'course-card-wrap', 'completed')}>
2223
<div className={styles['line']}>
2324
<CourseTitle
2425
title={props.certification.title}

src-ts/tools/learn/learn-lib/my-course-card/in-progress/InProgress.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const InProgress: FC<InProgressProps> = (props: InProgressProps) => {
5050
}
5151

5252
return (
53-
<div className={classNames(styles['wrap'], styles['large'])}>
53+
<div className={classNames(styles['wrap'], styles['large'], 'course-card-wrap', 'in-progress')}>
5454
<div className={styles['inner']}>
5555
<div className={styles['line']}>
5656
<CourseTitle

src-ts/tools/learn/my-learning/MyLearning.module.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
.wrap {
44
flex: 1 1 auto;
55
position: relative;
6-
}
7-
8-
.content-layout {
9-
background: $black-5;
6+
margin-top: $space-xxxxl;
7+
display: flex;
8+
flex-direction: column;
109
}
1110

1211
.hero-wrap {

src-ts/tools/learn/my-learning/MyLearning.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const MyLearning: FC<{}> = () => {
7777
<div className={styles['hero-wrap']}>
7878
<WaveHero
7979
title='my learning'
80+
theme='light'
8081
text={`
8182
This is your very own page to keep track of your professional education and skill building.
8283
From here you can resume your courses in progress or review past accomplishments.

src-ts/tools/learn/my-learning/completed-tab/CompletedTab.module.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,22 @@
99
flex: 0 1 calc(50% - calc($space-xxl / 2));
1010
}
1111

12+
> :global(.course-card-wrap) {
13+
background: $black-5;
14+
}
15+
1216
@include ltemd {
1317
> * {
1418
flex: 1 1 0;
1519
}
1620
}
1721
}
22+
23+
.placeholder-wrap {
24+
flex: 1 1 auto;
25+
display: flex;
26+
flex-direction: column;
27+
align-items: center;
28+
justify-content: center;
29+
gap: $space-xxl;
30+
}

src-ts/tools/learn/my-learning/completed-tab/CompletedTab.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { FC, ReactNode } from 'react'
22

3+
import { Button } from '../../../../lib'
34
import { LearnCertification, MyCourseCompletedCard, UserCertificationCompleted } from '../../learn-lib'
5+
import { LEARN_PATHS } from '../../learn.routes'
46
import { sortOptions } from '../my-learning-sort-options'
57
import { MyTabsViews } from '../my-tabs-navbar'
68
import { TabContentLayout } from '../tab-content-layout'
@@ -25,14 +27,30 @@ const CompletedTab: FC<CompletedTabProps> = (props: CompletedTabProps) => {
2527
props.certifications
2628
)
2729

30+
const hasCertifications: boolean = certifications.length >= 1
31+
32+
const renderPlaceholder: () => ReactNode = () => (
33+
<div className={styles['placeholder-wrap']}>
34+
<div className='body-medium-bold'>
35+
Your Completed courses will live here. Let’s go!
36+
</div>
37+
<Button
38+
route={LEARN_PATHS.root}
39+
buttonStyle='primary'
40+
size='md'
41+
label='Start a course'
42+
/>
43+
</div>
44+
)
45+
2846
const renderCertificationsList: () => ReactNode = () => (
29-
certifications.map((certif) => (
47+
hasCertifications ? certifications.map((certif) => (
3048
<MyCourseCompletedCard
3149
certification={props.certificatesById[certif.certificationId]}
3250
key={certif.certificationId}
3351
completed={certif.completedDate}
3452
/>
35-
))
53+
)) : renderPlaceholder()
3654
)
3755

3856
return (
@@ -42,6 +60,7 @@ const CompletedTab: FC<CompletedTabProps> = (props: CompletedTabProps) => {
4260
sortOptions={sortOptions.completed}
4361
onSortChange={handleSortChange}
4462
onCategoryChange={handleCategoryChange}
63+
disableFilters={!hasCertifications}
4564
>
4665
<div className={styles['cards-wrap']}>
4766
{renderCertificationsList()}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
@import '../../../../lib/styles/includes';
2+
3+
.wrap {
4+
gap: $space-lg;
5+
display: flex;
6+
flex-direction: column;
7+
position: relative;
8+
9+
@include ltemd {
10+
gap: $space-xxl;
11+
}
12+
13+
> :global(.course-card-wrap) {
14+
background: $black-5;
15+
}
16+
}
17+
18+
.placeholder-wrap {
19+
flex: 1 1 auto;
20+
display: flex;
21+
flex-direction: column;
22+
align-items: center;
23+
justify-content: center;
24+
gap: $space-xxl;
25+
}

src-ts/tools/learn/my-learning/in-progress-tab/InProgressTab.tsx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { FC, ReactNode } from 'react'
22

3+
import { Button } from '../../../../lib'
34
import { LearnCertification, MyCourseInProgressCard, UserCertificationInProgress } from '../../learn-lib'
5+
import { LEARN_PATHS } from '../../learn.routes'
46
import { sortOptions } from '../my-learning-sort-options'
57
import { MyTabsViews } from '../my-tabs-navbar'
68
import { TabContentLayout } from '../tab-content-layout'
79
import { useSortAndFilter, UseSortAndFilterValue } from '../use-sort-and-filter'
810

11+
import styles from './InProgressTab.module.scss'
12+
913
interface InProgressTabProps {
1014
allCertificates: ReadonlyArray<LearnCertification>
1115
certificatesById: {[key: string]: LearnCertification}
@@ -23,8 +27,24 @@ const InProgressTab: FC<InProgressTabProps> = (props: InProgressTabProps) => {
2327
props.certifications
2428
)
2529

30+
const hasCertifications: boolean = certifications.length >= 1
31+
32+
const renderPlaceholder: () => ReactNode = () => (
33+
<div className={styles['placeholder-wrap']}>
34+
<div className='body-medium-bold'>
35+
Your In Progress courses will live here. Let’s go!
36+
</div>
37+
<Button
38+
route={LEARN_PATHS.root}
39+
buttonStyle='primary'
40+
size='md'
41+
label='Start a course'
42+
/>
43+
</div>
44+
)
45+
2646
const renderCertificationsList: () => ReactNode = () => (
27-
certifications.map((certif) => (
47+
hasCertifications ? certifications.map((certif) => (
2848
<MyCourseInProgressCard
2949
certification={props.certificatesById[certif.certificationId]}
3050
key={certif.certificationId}
@@ -33,7 +53,7 @@ const InProgressTab: FC<InProgressTabProps> = (props: InProgressTabProps) => {
3353
completedPercentage={certif.courseProgressPercentage / 100}
3454
startDate={certif.startDate}
3555
/>
36-
))
56+
)) : renderPlaceholder()
3757
)
3858

3959
return (
@@ -43,8 +63,11 @@ const InProgressTab: FC<InProgressTabProps> = (props: InProgressTabProps) => {
4363
sortOptions={sortOptions.inProgress}
4464
onSortChange={handleSortChange}
4565
onCategoryChange={handleCategoryChange}
66+
disableFilters={!hasCertifications}
4667
>
47-
{renderCertificationsList()}
68+
<div className={styles.wrap}>
69+
{renderCertificationsList()}
70+
</div>
4871
</TabContentLayout>
4972
)
5073
}

0 commit comments

Comments
 (0)