diff --git a/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.module.scss b/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.module.scss index 6bc0e3c3e..a03c1e36a 100644 --- a/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.module.scss +++ b/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.module.scss @@ -286,4 +286,76 @@ @include ltemd { display: none; } +} + +.modalView { + .hero { + padding-top: $space-mx; + min-height: 380px; + + @include ltesm { + max-height: none; + } + + + .heroInner { + margin-bottom: 0; + flex-direction: row; + padding-right: $space-lg; + padding-bottom: $space-mx; + + @include ltesm { + flex-direction: column; + padding-right: 0; + } + + .heroLeft { + .member { + margin-bottom: $space-xxxxl; + + >svg, + >img { + max-width: 88px; + max-height: 88px; + } + } + + .certTitle { + font-size: 40px; + line-height: 40px; + } + } + } + } + + .wrap { + margin-bottom: 0; + } + + .contentOuter { + max-width: none; + + >div { + max-width: none !important; + } + + } + + .courses { + margin-bottom: 0; + } + + .colsWrap { + margin-top: 0; + } + + .colWrap { + &:last-child { + max-width: 25%; + padding-right: 0; + @include ltemd { + max-width: 100%; + } + } + } } \ No newline at end of file diff --git a/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.tsx b/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.tsx index e34ffde0b..6141315e1 100644 --- a/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.tsx +++ b/src-ts/tools/learn/learn-lib/hiring-manager-view/HiringManagerView.tsx @@ -5,6 +5,7 @@ import { ReactNode, SetStateAction, useCallback, + useLayoutEffect, useRef, useState, } from 'react' @@ -34,7 +35,7 @@ import { useTCAShareCertificateModal, } from '..' import { getTCACertificationPath, getUserTCACertificateSsr } from '../../learn.routes' -import { clearFCCCertificationTitle } from '../functions' +import { clearFCCCertificationTitle, hideSiblings } from '../functions' import { EnvironmentConfig } from '../../../../config' import { CertificateModal } from './certificate-modal' @@ -64,6 +65,7 @@ export interface HiringManagerViewProps { const HiringManagerView: FC = (props: HiringManagerViewProps) => { const certificateElRef: MutableRefObject = useRef() + const wrapElRef: MutableRefObject = useRef() const [certPreviewModalIsOpen, setCertPreviewModalIsOpen]: [boolean, Dispatch>] = useState(false) @@ -89,6 +91,8 @@ const HiringManagerView: FC = (props: HiringManagerViewP ) const shareModal: TCAShareCertificateModalData = useTCAShareCertificateModal(ssrCertUrl) + const renderShareActions: boolean = props.isOwner && !props.isModalView + const getCertificateCanvas: () => Promise = useCertificateCanvas(certificateElRef) @@ -198,29 +202,31 @@ const HiringManagerView: FC = (props: HiringManagerViewP
{renderTCACertificatePreview(certificateElRef)} -
- } - className={classNames(styles.certZoomBtn, styles.certActionBtn)} - onClick={handleShowCertPreviewModal} - /> - {props.isOwner && ( - <> - } - onClick={handlePrint} - /> - } - onClick={handleDownload} - /> - - )} -
+ {!props.isModalView && ( +
+ } + className={classNames(styles.certZoomBtn, styles.certActionBtn)} + onClick={handleShowCertPreviewModal} + /> + {renderShareActions && ( + <> + } + onClick={handlePrint} + /> + } + onClick={handleDownload} + /> + + )} +
+ )}
- {props.isOwner && ( + {renderShareActions && (
= (props: HiringManagerViewP ) } + useLayoutEffect(() => { + const el: HTMLElement = wrapElRef.current + if (!el || !props.isModalView) { + return + } + + hideSiblings(el.parentElement as HTMLElement) + hideSiblings(el.parentElement?.parentElement as HTMLElement) + + }) + return !!props.certification && !!props.userProfile ? ( -
+
{renderHero()} = (props: HiringManagerViewP innerClass={styles.innerContentWrap} >
- {props.isOwner && ( + {renderShareActions && (
{renderCoursesGridItems()} -
{shareModal.modal} diff --git a/src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationViewBase.tsx b/src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationViewBase.tsx index 668c4a98a..2173dc481 100644 --- a/src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationViewBase.tsx +++ b/src-ts/tools/learn/tca-certificate/user-certification-view/UserCertificationViewBase.tsx @@ -7,6 +7,7 @@ import { useRef, useState, } from 'react' +import { useSearchParams } from 'react-router-dom' import { getVerificationStatusAsync, @@ -32,12 +33,14 @@ interface UserCertificationViewBaseProps { } const UserCertificationViewBase: FC = (props: UserCertificationViewBaseProps) => { + const [queryParams]: [URLSearchParams, any] = useSearchParams() - // const routeParams: Params = useParams() const tcaCertificationPath: string = getTCACertificationPath(`${props.certification?.dashedName}`) const certificateElRef: MutableRefObject = useRef() const isOwnProfile: boolean = !!props.profile?.email + const isModalView: boolean = queryParams.get('view-style') === 'modal' + const [isMemberVerified, setIsMemberVerified]: [boolean, Dispatch>] = useState(false) @@ -82,6 +85,7 @@ const UserCertificationViewBase: FC = (props: Us userName={props.enrollment.userName} isOwner={isOwnProfile} validationUrl={validationUrl} + isModalView={isModalView} />
)}