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'
22import Modal , { ModalProps } from 'react-responsive-modal'
33import classNames from 'classnames'
44
@@ -37,6 +37,13 @@ const BaseModal: FC<BaseModalProps> = (props: BaseModalProps) => {
3737 )
3838 }
3939
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+
4047 return (
4148 < Modal
4249 { ...props }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ const CertificationDetailsModal: FC<CertificationDetailsModalProps> = (props: Ce
2323 return (
2424 < BaseModal
2525 onClose = { props . onClose }
26+ blockScroll = { false }
2627 open = { isOpen }
2728 size = 'body'
2829 title = { `${ props . certification . title } Details` }
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
8484 < CompletionTimeRange range = { props . certification . completionTimeRange } />
8585 < Tooltip
8686 content = { renderTooltipContents ( < IconSolid . ClockIcon /> , [
87- 'Assuming 4 hour' ,
87+ 'Assuming 1 to 4 hour' ,
8888 'learning per day' ,
8989 ] ) }
9090 place = 'bottom'
@@ -115,7 +115,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
115115 ) }
116116 </ ul >
117117
118- < div className = { classNames ( 'body-main -medium' , styles [ 'section-header' ] ) } >
118+ < div className = { classNames ( 'body-small -medium' , styles [ 'section-header' ] ) } >
119119 Skills Covered
120120 </ div >
121121 < 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) => {
3030 < h2 className = 'details' >
3131 You have successfully enrolled!
3232 </ 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+ />
3438 </ >
3539
3640 </ BaseModal >
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ const CollapsibleItem: FC<CollapsibleItemProps> = (props: CollapsibleItemProps)
147147 { ' ' }
148148 Lessons
149149 </ span >
150- { props . duration && (
150+ { ! ! props . duration && (
151151 < span className = { styles [ 'summary-item' ] } >
152152 < IconOutline . ClockIcon />
153153 { props . duration }
Original file line number Diff line number Diff line change @@ -20,10 +20,15 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
2020 = useSessionStorage < boolean > ( storeKey , false )
2121
2222 function handleClick ( ) : void {
23- props . onClose ( )
23+ handleClose ( )
2424 window . open ( getTCACertificateUrl ( props . certification . dashedName ) , '_blank' )
2525 }
2626
27+ function handleClose ( ) : void {
28+ setIsOpen ( false )
29+ props . onClose ( )
30+ }
31+
2732 useEffect ( ( ) => {
2833 if ( ! storeKey || sessionStorage . getItem ( storeKey ) !== null ) {
2934 return
@@ -34,7 +39,7 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
3439
3540 return (
3641 < BaseModal
37- onClose = { props . onClose }
42+ onClose = { handleClose }
3843 open = { isOpen }
3944 size = 'sm'
4045 classNames = { { modal : styles . completedModal , root : styles . modalRoot } }
You can’t perform that action at this time.
0 commit comments