File tree Expand file tree Collapse file tree 6 files changed +24
-7
lines changed
certification-details-modal
course-outline/collapsible-item
tca-certification-completed-modal Expand file tree Collapse file tree 6 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 1
- import { FC , ReactNode } from 'react'
1
+ import { FC , ReactNode , useEffect } from 'react'
2
2
import Modal , { ModalProps } from 'react-responsive-modal'
3
3
import classNames from 'classnames'
4
4
@@ -37,6 +37,13 @@ const BaseModal: FC<BaseModalProps> = (props: BaseModalProps) => {
37
37
)
38
38
}
39
39
40
+ useEffect ( ( ) => {
41
+ if ( props . blockScroll === false ) {
42
+ document . documentElement . style . overflow = props . open ? 'hidden' : ''
43
+ document . body . style . overflow = props . open ? 'hidden' : ''
44
+ }
45
+ } , [ props . blockScroll , props . open ] )
46
+
40
47
return (
41
48
< Modal
42
49
{ ...props }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const CertificationDetailsModal: FC<CertificationDetailsModalProps> = (props: Ce
23
23
return (
24
24
< BaseModal
25
25
onClose = { props . onClose }
26
+ blockScroll = { false }
26
27
open = { isOpen }
27
28
size = 'body'
28
29
title = { `${ props . certification . title } Details` }
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
84
84
< CompletionTimeRange range = { props . certification . completionTimeRange } />
85
85
< Tooltip
86
86
content = { renderTooltipContents ( < IconSolid . ClockIcon /> , [
87
- 'Assuming 4 hour' ,
87
+ 'Assuming 1 to 4 hour' ,
88
88
'learning per day' ,
89
89
] ) }
90
90
place = 'bottom'
@@ -115,7 +115,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
115
115
) }
116
116
</ ul >
117
117
118
- < div className = { classNames ( 'body-main -medium' , styles [ 'section-header' ] ) } >
118
+ < div className = { classNames ( 'body-small -medium' , styles [ 'section-header' ] ) } >
119
119
Skills Covered
120
120
</ div >
121
121
< ul className = { styles [ 'certification-skills-list' ] } >
Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ const EnrolledModal: FC<EnrolledModalProps> = (props: EnrolledModalProps) => {
30
30
< h2 className = 'details' >
31
31
You have successfully enrolled!
32
32
</ h2 >
33
- < Button buttonStyle = 'outline' label = 'Close' onClick = { props . onClose } />
33
+ < Button
34
+ buttonStyle = 'outline'
35
+ label = 'Go to the certification details'
36
+ onClick = { props . onClose }
37
+ />
34
38
</ >
35
39
36
40
</ BaseModal >
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ const CollapsibleItem: FC<CollapsibleItemProps> = (props: CollapsibleItemProps)
147
147
{ ' ' }
148
148
Lessons
149
149
</ span >
150
- { props . duration && (
150
+ { ! ! props . duration && (
151
151
< span className = { styles [ 'summary-item' ] } >
152
152
< IconOutline . ClockIcon />
153
153
{ props . duration }
Original file line number Diff line number Diff line change @@ -20,10 +20,15 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
20
20
= useSessionStorage < boolean > ( storeKey , false )
21
21
22
22
function handleClick ( ) : void {
23
- props . onClose ( )
23
+ handleClose ( )
24
24
window . open ( getTCACertificateUrl ( props . certification . dashedName ) , '_blank' )
25
25
}
26
26
27
+ function handleClose ( ) : void {
28
+ setIsOpen ( false )
29
+ props . onClose ( )
30
+ }
31
+
27
32
useEffect ( ( ) => {
28
33
if ( ! storeKey || sessionStorage . getItem ( storeKey ) !== null ) {
29
34
return
@@ -34,7 +39,7 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
34
39
35
40
return (
36
41
< BaseModal
37
- onClose = { props . onClose }
42
+ onClose = { handleClose }
38
43
open = { isOpen }
39
44
size = 'sm'
40
45
classNames = { { modal : styles . completedModal , root : styles . modalRoot } }
You can’t perform that action at this time.
0 commit comments