From 7c4ef47da5e97e0df1854e7fba9b335f049f115a Mon Sep 17 00:00:00 2001 From: Ahtesham Quraish Date: Fri, 8 Aug 2025 01:47:43 +0500 Subject: [PATCH] refactor: replace one injectIntl with useIntl, fix JSX return (#2354) Co-authored-by: Ahtesham Quraish --- .../videos-page/VideosPage.jsx | 3 +- .../info-sidebar/VideoInfoModalSidebar.jsx | 56 +++++++++---------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/files-and-videos/videos-page/VideosPage.jsx b/src/files-and-videos/videos-page/VideosPage.jsx index ab05e27da..18ed07982 100644 --- a/src/files-and-videos/videos-page/VideosPage.jsx +++ b/src/files-and-videos/videos-page/VideosPage.jsx @@ -169,8 +169,9 @@ const VideosPage = ({ handleAddThumbnail, videoImageSettings, }); + const infoModalSidebar = (video, activeTab, setActiveTab) => ( - VideoInfoModalSidebar({ video, activeTab, setActiveTab }) + ); const maxFileSize = videoUploadMaxFileSize * 1073741824; const transcriptColumn = { diff --git a/src/files-and-videos/videos-page/info-sidebar/VideoInfoModalSidebar.jsx b/src/files-and-videos/videos-page/info-sidebar/VideoInfoModalSidebar.jsx index 053587db0..d582cb628 100644 --- a/src/files-and-videos/videos-page/info-sidebar/VideoInfoModalSidebar.jsx +++ b/src/files-and-videos/videos-page/info-sidebar/VideoInfoModalSidebar.jsx @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; +import { useIntl } from '@edx/frontend-platform/i18n'; import { Tabs, Tab, @@ -14,33 +14,35 @@ const VideoInfoModalSidebar = ({ video, activeTab, setActiveTab, - // injected - intl, -}) => ( - setActiveTab(tab)} - > - - - - { + const intl = useIntl(); + + return ( + setActiveTab(tab)} + > + + + + {intl.formatMessage(messages.notificationScreenReaderText)} - )} - > - - - -); + )} + > + + + + ); +}; VideoInfoModalSidebar.propTypes = { video: PropTypes.shape({ @@ -54,12 +56,10 @@ VideoInfoModalSidebar.propTypes = { }), activeTab: PropTypes.string.isRequired, setActiveTab: PropTypes.func.isRequired, - // injected - intl: intlShape.isRequired, }; VideoInfoModalSidebar.defaultProps = { video: null, }; -export default injectIntl(VideoInfoModalSidebar); +export default VideoInfoModalSidebar;