diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx index cf2004a0e..0f26d0e49 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/EditBlock.jsx @@ -32,10 +32,13 @@ class EditBlock extends SubblockEdit { if (__SERVER__) { return
; } - return ( - + {(!this.props.data?.url || this.props.data?.url.length === 0) && (
{this.props.intl.formatMessage(messages.noVideoUrl)}
)} diff --git a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx index 49d34e8e9..e2ec64443 100644 --- a/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx +++ b/src/components/ItaliaTheme/Blocks/VideoGallery/Block/ViewBlock.jsx @@ -32,7 +32,12 @@ const messages = defineMessages({ * @class ViewBlock * @extends Component */ -const ViewBlock = ({ data, index, isEditMode = false }) => { +const ViewBlock = ({ + data, + showVideoCaption = false, + index, + isEditMode = false, +}) => { const intl = useIntl(); let placeholder = data.preview_image ? isInternalURL(data.preview_image) @@ -89,52 +94,67 @@ const ViewBlock = ({ data, index, isEditMode = false }) => { {data.url.match('youtu') ? ( <> {data.url.match('list') ? ( - + <> + + {showVideoCaption &&

{data.title}

} + ) : ( - + <> + + {showVideoCaption &&

{data.title}

} + )} ) : ( <> {data.url.match('vimeo') ? ( - + <> + + {showVideoCaption &&

{data.title}

} + ) : ( <> {data.url.match('.mp4') ? ( // eslint-disable-next-line jsx-a11y/media-has-caption -