Skip to content

Commit 8a59c3f

Browse files
committed
TCA-441 - update button style for secondary buttons on learn landing page
1 parent b45076e commit 8a59c3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src-ts/tools/learn/welcome/courses-card/CoursesCard.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import classNames from 'classnames'
22
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react'
33

4-
import { Button } from '../../../../lib'
4+
import { Button, ButtonStyle } from '../../../../lib'
55
import {
66
CourseTitle,
77
LearnCertification,
@@ -20,6 +20,8 @@ interface CoursesCardProps {
2020

2121
const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
2222

23+
const [buttonStyle, setButtonStyle]: [ButtonStyle, Dispatch<SetStateAction<ButtonStyle>>]
24+
= useState<ButtonStyle>('primary')
2325
const [buttonLabel, setButtonLabel]: [string, Dispatch<SetStateAction<string>>]
2426
= useState<string>('')
2527
const [link, setLink]: [string, Dispatch<SetStateAction<string>>]
@@ -42,6 +44,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
4244

4345
if (isCompleted) {
4446
// if the course is completed, View the Certificate
47+
setButtonStyle('secondary')
4548
setButtonLabel('View Certificate')
4649
setLink(getCertificatePath(
4750
props.certification.providerName,
@@ -58,6 +61,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
5861

5962
} else {
6063
// otherwise this course is in-progress, so Resume the course at the next lesson
64+
setButtonStyle('secondary')
6165
setButtonLabel('Resume')
6266
setLink(getLessonPathFromCurrentLesson(
6367
props.certification.providerName,
@@ -85,7 +89,7 @@ const CoursesCard: FC<CoursesCardProps> = (props: CoursesCardProps) => {
8589
<div className={styles['bottom']}>
8690
{!!link && (
8791
<Button
88-
buttonStyle='primary'
92+
buttonStyle={buttonStyle}
8993
size='sm'
9094
label={buttonLabel}
9195
route={link}

0 commit comments

Comments
 (0)