1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import { injectIntl , intlShape } from '@edx/frontend-platform/i18n' ;
3
+ import { useIntl } from '@edx/frontend-platform/i18n' ;
4
4
import {
5
5
Tabs ,
6
6
Tab ,
@@ -14,33 +14,35 @@ const VideoInfoModalSidebar = ({
14
14
video,
15
15
activeTab,
16
16
setActiveTab,
17
- // injected
18
- intl,
19
- } ) => (
20
- < Tabs
21
- id = "controlled-info-sidebar-tab"
22
- activeKey = { activeTab }
23
- onSelect = { ( tab ) => setActiveTab ( tab ) }
24
- >
25
- < Tab eventKey = "fileInfo" title = { intl . formatMessage ( messages . infoTabTitle ) } >
26
- < InfoTab { ...{ video } } />
27
- </ Tab >
28
- < Tab
29
- eventKey = "fileTranscripts"
30
- title = { intl . formatMessage (
31
- messages . transcriptTabTitle ,
32
- { transcriptCount : video . transcripts . length } ,
33
- ) }
34
- notification = { TRANSCRIPT_FAILURE_STATUSES . includes ( video . transcriptionStatus ) && (
17
+ } ) => {
18
+ const intl = useIntl ( ) ;
19
+
20
+ return (
21
+ < Tabs
22
+ id = "controlled-info-sidebar-tab"
23
+ activeKey = { activeTab }
24
+ onSelect = { ( tab ) => setActiveTab ( tab ) }
25
+ >
26
+ < Tab eventKey = "fileInfo" title = { intl . formatMessage ( messages . infoTabTitle ) } >
27
+ < InfoTab { ...{ video } } />
28
+ </ Tab >
29
+ < Tab
30
+ eventKey = "fileTranscripts"
31
+ title = { intl . formatMessage (
32
+ messages . transcriptTabTitle ,
33
+ { transcriptCount : video . transcripts . length } ,
34
+ ) }
35
+ notification = { TRANSCRIPT_FAILURE_STATUSES . includes ( video . transcriptionStatus ) && (
35
36
< span >
36
37
< span className = "sr-only" > { intl . formatMessage ( messages . notificationScreenReaderText ) } </ span >
37
38
</ span >
38
- ) }
39
- >
40
- < TranscriptTab { ...{ video } } />
41
- </ Tab >
42
- </ Tabs >
43
- ) ;
39
+ ) }
40
+ >
41
+ < TranscriptTab { ...{ video } } />
42
+ </ Tab >
43
+ </ Tabs >
44
+ ) ;
45
+ } ;
44
46
45
47
VideoInfoModalSidebar . propTypes = {
46
48
video : PropTypes . shape ( {
@@ -54,12 +56,10 @@ VideoInfoModalSidebar.propTypes = {
54
56
} ) ,
55
57
activeTab : PropTypes . string . isRequired ,
56
58
setActiveTab : PropTypes . func . isRequired ,
57
- // injected
58
- intl : intlShape . isRequired ,
59
59
} ;
60
60
61
61
VideoInfoModalSidebar . defaultProps = {
62
62
video : null ,
63
63
} ;
64
64
65
- export default injectIntl ( VideoInfoModalSidebar ) ;
65
+ export default VideoInfoModalSidebar ;
0 commit comments