1- import React , { useEffect } from 'react' ;
1+ import { useEffect } from 'react' ;
22import { useDispatch , useSelector } from 'react-redux' ;
33import { sendTrackEvent } from '@edx/frontend-platform/analytics' ;
44import { getAuthenticatedUser } from '@edx/frontend-platform/auth' ;
5- import {
6- FormattedDate , FormattedMessage , injectIntl , intlShape ,
7- } from '@edx/frontend-platform/i18n' ;
5+ import { FormattedDate , FormattedMessage , useIntl } from '@edx/frontend-platform/i18n' ;
86
97import { Button , Card } from '@openedx/paragon' ;
108import { getConfig } from '@edx/frontend-platform' ;
@@ -13,8 +11,10 @@ import { COURSE_EXIT_MODES, getCourseExitMode } from '../../../courseware/course
1311import { DashboardLink , IdVerificationSupportLink , ProfileLink } from '../../../shared/links' ;
1412import { requestCert } from '../../data/thunks' ;
1513import messages from './messages' ;
14+ import ProgressCertificateStatusSlot from '../../../plugin-slots/ProgressCertificateStatusSlot' ;
1615
17- const CertificateStatus = ( { intl } ) => {
16+ const CertificateStatus = ( ) => {
17+ const intl = useIntl ( ) ;
1818 const {
1919 courseId,
2020 } = useSelector ( state => state . courseHome ) ;
@@ -215,7 +215,6 @@ const CertificateStatus = ({ intl }) => {
215215 } ) ;
216216 // eslint-disable-next-line react-hooks/exhaustive-deps
217217 } , [ ] ) ;
218-
219218 if ( ! certCase ) {
220219 return null ;
221220 }
@@ -243,32 +242,32 @@ const CertificateStatus = ({ intl }) => {
243242 return (
244243 < section data-testid = "certificate-status-component" className = "text-dark-700 mb-4" >
245244 < Card className = "bg-light-200 raised-card" >
246- < Card . Header title = { header } />
247- < Card . Section className = "small text-gray-700" >
248- { body }
249- </ Card . Section >
250- < Card . Footer >
251- { buttonText && ( buttonLocation || buttonAction ) && (
252- < Button
253- variant = "outline-brand"
254- onClick = { ( ) => {
255- logCertificateStatusButtonClicked ( certStatus ) ;
256- if ( buttonAction ) { buttonAction ( ) ; }
257- } }
258- href = { buttonLocation }
259- block
260- >
261- { buttonText }
262- </ Button >
263- ) }
264- </ Card . Footer >
245+ < ProgressCertificateStatusSlot courseId = { courseId } >
246+ < div id = { `${ certCase } _certificate_status` } >
247+ < Card . Header title = { header } />
248+ < Card . Section className = "small text-gray-700" >
249+ { body }
250+ </ Card . Section >
251+ < Card . Footer >
252+ { buttonText && ( buttonLocation || buttonAction ) && (
253+ < Button
254+ variant = "outline-brand"
255+ onClick = { ( ) => {
256+ logCertificateStatusButtonClicked ( certStatus ) ;
257+ if ( buttonAction ) { buttonAction ( ) ; }
258+ } }
259+ href = { buttonLocation }
260+ block
261+ >
262+ { buttonText }
263+ </ Button >
264+ ) }
265+ </ Card . Footer >
266+ </ div >
267+ </ ProgressCertificateStatusSlot >
265268 </ Card >
266269 </ section >
267270 ) ;
268271} ;
269272
270- CertificateStatus . propTypes = {
271- intl : intlShape . isRequired ,
272- } ;
273-
274- export default injectIntl ( CertificateStatus ) ;
273+ export default CertificateStatus ;
0 commit comments