Skip to content
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
2 changes: 1 addition & 1 deletion src-ts/lib/modals/base-modal/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default as BaseModal } from './BaseModal'
export { default as BaseModal, type BaseModalProps } from './BaseModal'
1 change: 1 addition & 0 deletions src-ts/lib/styles/variables/_palette.scss
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ $tc-grad16: linear-gradient(265.38deg, $turq-100 1.99%, $teal-100 98.19%);
$tc-grad17: linear-gradient(265.38deg, #363D8C 1.99%, #723390 98.19%);
$tc-grad18: linear-gradient(84.92deg, #363D8C 2.08%, #723390 97.43%);
$tc-grad19: linear-gradient(83.58deg, #7B21A7 2.28%, #1974AD 97.67%);
$tc-grad20: linear-gradient(30deg, #05456D 2.12%, #0A7AC0 97.43%);


/* OPACITY */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

.enrolledModal {
color: $tc-white;
background: url(./bg.png) center no-repeat;
background: url(./bg.jpg) center no-repeat, $tc-grad20;

@include ltemd {
background: url(./bg-mobile.png) 0 0 no-repeat;
background: url(./bg-mobile.jpg) 0 0 no-repeat, $tc-grad20;
background-size: cover;
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ import {
} from '../../../../lib'
import {
enrollTCACertificationAsync,
TCACertificationCheckCompleted,
TCACertificationProgress,
TCACertificationProgressProviderData,
TCACertificationProviderData,
useGetTCACertification,
useGetTCACertificationProgress,
useTCACertificationCheckCompleted,
useTcaCertificationModal,
} from '../../learn-lib'
import { perks } from '../certification-details-modal/certif-details-content/data'
Expand Down Expand Up @@ -66,8 +69,17 @@ const EnrollmentPage: FC<{}> = () => {

const ready: boolean = profileReady && certificationReady && progressReady && !!profile

const firstResourceProgress: TCACertificationProgress['resourceProgresses'][0] | undefined
= progress?.resourceProgresses?.[0]

const { certification: tcaCertificationName }: TCACertificationCheckCompleted = useTCACertificationCheckCompleted(
firstResourceProgress?.resourceProgressType ?? '',
firstResourceProgress?.resourceProgressId ?? '',
{ enabled: !!firstResourceProgress?.resourceProgressType },
)

const tcaCertificationCompletedModal: ReactNode = useTcaCertificationModal(
progress ? certification.dashedName : undefined,
tcaCertificationName,
navToCertificationDetails,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ export interface TCACertificationProgress extends LearnModelBase {
completedAt: null | Date
certificationProgress: number
resourceProgresses: [{
status: UserCertificationProgressStatus,
resourceProgressId: string
resourceProgressType: 'FccCertificationProgress'
fccCertificationProgress: TCAFccCertificationProgress
status: UserCertificationProgressStatus,
}]
userHandle: string
userId: number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import '../../../../lib/styles/includes';

.completedModal {
.completedModal.completedModal {
color: $tc-white;
background: url(./bg.png) center no-repeat;
background: url(./bg.jpg) center no-repeat, $tc-grad20;

@include ltemd {
background: url(./bg-mobile.png) 0 0 no-repeat;
background: url(./bg-mobile.jpg) 0 0 no-repeat, $tc-grad20;
background-size: cover;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Dispatch, FC, SetStateAction, useEffect } from 'react'

import { BaseModal, Button, useLocalStorage } from '../../../../lib'
import { BaseModal, BaseModalProps, Button, useSessionStorage } from '../../../../lib'
import { TCACertification } from '../data-providers'
import { getTCACertificateUrl } from '../../learn.routes'

import styles from './TCACertificationCompletedModal.module.scss'

interface TCACertificationCompletedModalProps {
interface TCACertificationCompletedModalProps extends BaseModalProps {
certification: TCACertification
isOpen: boolean
}
Expand All @@ -17,19 +17,15 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>
const storeKey: string = props.certification?.dashedName && `tca-cert-completed[${props.certification.dashedName}]`

const [isOpen, setIsOpen]: [boolean, Dispatch<SetStateAction<boolean>>]
= useLocalStorage<boolean>(storeKey, false)
= useSessionStorage<boolean>(storeKey, false)

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

function handleClose(): void {
setIsOpen(false)
}

useEffect(() => {
if (!storeKey || localStorage.getItem(storeKey) !== null) {
if (!storeKey || sessionStorage.getItem(storeKey) !== null) {
return
}

Expand All @@ -38,7 +34,7 @@ const TCACertificationCompletedModal: FC<TCACertificationCompletedModalProps>

return (
<BaseModal
onClose={handleClose}
onClose={props.onClose}
open={isOpen}
size='sm'
classNames={{ modal: styles.completedModal, root: styles.modalRoot }}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.