Skip to content

Miscellaneous qa fixes -> dev #535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src-ts/lib/modals/base-modal/BaseModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, ReactNode } from 'react'
import { FC, ReactNode, useEffect } from 'react'
import Modal, { ModalProps } from 'react-responsive-modal'
import classNames from 'classnames'

Expand Down Expand Up @@ -37,6 +37,13 @@ const BaseModal: FC<BaseModalProps> = (props: BaseModalProps) => {
)
}

useEffect(() => {
if (props.blockScroll === false) {
document.documentElement.style.overflow = props.open ? 'hidden' : ''
document.body.style.overflow = props.open ? 'hidden' : ''
}
}, [props.blockScroll, props.open])

return (
<Modal
{...props}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const CertificationDetailsModal: FC<CertificationDetailsModalProps> = (props: Ce
return (
<BaseModal
onClose={props.onClose}
blockScroll={false}
open={isOpen}
size='body'
title={`${props.certification.title} Details`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
<CompletionTimeRange range={props.certification.completionTimeRange} />
<Tooltip
content={renderTooltipContents(<IconSolid.ClockIcon />, [
'Assuming 4 hour',
'Assuming 1 to 4 hour',
'learning per day',
])}
place='bottom'
Expand Down Expand Up @@ -115,7 +115,7 @@ const CertificationDetailsSidebar: FC<CertificationDetailsSidebarProps> = (props
)}
</ul>

<div className={classNames('body-main-medium', styles['section-header'])}>
<div className={classNames('body-small-medium', styles['section-header'])}>
Skills Covered
</div>
<ul className={styles['certification-skills-list']}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ const EnrolledModal: FC<EnrolledModalProps> = (props: EnrolledModalProps) => {
<h2 className='details'>
You have successfully enrolled!
</h2>
<Button buttonStyle='outline' label='Close' onClick={props.onClose} />
<Button
buttonStyle='outline'
label='Go to the certification details'
onClick={props.onClose}
/>
</>

</BaseModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const CollapsibleItem: FC<CollapsibleItemProps> = (props: CollapsibleItemProps)
{' '}
Lessons
</span>
{props.duration && (
{!!props.duration && (
<span className={styles['summary-item']}>
<IconOutline.ClockIcon />
{props.duration}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
= useSessionStorage<boolean>(storeKey, false)

function handleClick(): void {
props.onClose()
handleClose()
window.open(getTCACertificateUrl(props.certification.dashedName), '_blank')
}

function handleClose(): void {
setIsOpen(false)
props.onClose()
}

useEffect(() => {
if (!storeKey || sessionStorage.getItem(storeKey) !== null) {
return
Expand All @@ -34,7 +39,7 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>

return (
<BaseModal
onClose={props.onClose}
onClose={handleClose}
open={isOpen}
size='sm'
classNames={{ modal: styles.completedModal, root: styles.modalRoot }}
Expand Down