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 && }
- {assembly.image && }
- {assembly.interactive && }
- {assembly.video && (
-
- )}
- >
- )}
-
-);
+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 && }
+ {assembly.image && }
+ {assembly.interactive && }
+ {assembly.video && (
+
+ )}
+ >
+ );
+};
Media.propTypes = {
assemblyId: PropTypes.number,
diff --git a/src/components/MediaOverlay/MediaViewer/MediaViewer.js b/src/components/MediaOverlay/MediaViewer/MediaViewer.js
index 3bf7e77..c1c8a67 100644
--- a/src/components/MediaOverlay/MediaViewer/MediaViewer.js
+++ b/src/components/MediaOverlay/MediaViewer/MediaViewer.js
@@ -23,9 +23,9 @@ const MediaViewer = () => {
onSwipeRight={navigatePreviousMedia}
className={classNames(styles.MediaViewer, { controlsHidden })}
>
- {hasError ? {localeLabels.ERROR} : }
+ {hasError ? localeLabels.ERROR : }
{assemblies.length > 1 && !controlsHidden && (
-
+ <>
{mediaIndex > 0 && (
{
)}
-
+ >
)}
);