diff --git a/src/components/MediaOverlay/Media/Media.js b/src/components/MediaOverlay/Media/Media.js index 875d46d..ea3d58b 100644 --- a/src/components/MediaOverlay/Media/Media.js +++ b/src/components/MediaOverlay/Media/Media.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types'; -import React, { Fragment } from 'react'; +import React, { useContext } from 'react'; import MediaOverlayContext from '../MediaOverlay.context'; import DefaultAudio from './DefaultAudio/DefaultAudio'; import DefaultImage from './DefaultImage/DefaultImage'; @@ -7,40 +7,40 @@ import DefaultInteractive from './DefaultInteractive/DefaultInteractive'; import DefaultVideo from './DefaultVideo/DefaultVideo'; import './Media.module.scss'; -const Media = () => ( - - {({ - overlayState: { assembly }, - overlayProps: { - videoPlayerId, - generatePrerollUrl, - audioComponent: Audio = DefaultAudio, - imageComponent: Image = DefaultImage, - interactiveComponent: Interactive = DefaultInteractive, - videoComponent: Video = DefaultVideo, - }, - hideSidebarAndControls, - overlayRef, - showSidebarAndControls, - }) => ( - <> - {assembly.audio && -); +const Media = () => { + const { + overlayState: { assembly }, + overlayProps: { + videoPlayerId, + generatePrerollUrl, + audioComponent: Audio = DefaultAudio, + imageComponent: Image = DefaultImage, + interactiveComponent: Interactive = DefaultInteractive, + videoComponent: Video = DefaultVideo, + }, + hideSidebarAndControls, + overlayRef, + showSidebarAndControls, + } = useContext(MediaOverlayContext); + + return ( + <> + {assembly.audio &&