diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ea4f4bcc..a9d5bc1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## master + +* Fix build error in `Video` component. [#186](https://github.com/mapbox/dr-ui/pull/186) + ## 0.21.1 * Add `environment` and `location` to the request in `Feedback`. [#184](https://github.com/mapbox/dr-ui/pull/184) diff --git a/src/components/video/__tests__/__snapshots__/video.test.js.snap b/src/components/video/__tests__/__snapshots__/video.test.js.snap index bcf8dd630..a73167261 100644 --- a/src/components/video/__tests__/__snapshots__/video.test.js.snap +++ b/src/components/video/__tests__/__snapshots__/video.test.js.snap @@ -7,7 +7,7 @@ exports[`video Basic renders as expected 1`] = ` className="block mx-auto" loop={true} muted={true} - src="https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true" + src="./assets/browser-example.mp4" title="A video!" type="video/mp4" width="100%" @@ -16,7 +16,7 @@ exports[`video Basic renders as expected 1`] = ` Your browser doesn't support HTML5 video. Here is a link to the video @@ -32,7 +32,7 @@ exports[`video Reduced motion renders as expected 1`] = ` className="block mx-auto" controls={true} muted={true} - src="https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true" + src="./assets/browser-example.mp4" title="A video!" type="video/mp4" width="100%" @@ -41,7 +41,7 @@ exports[`video Reduced motion renders as expected 1`] = ` Your browser doesn't support HTML5 video. Here is a link to the video diff --git a/src/components/video/__tests__/video-test-cases.js b/src/components/video/__tests__/video-test-cases.js index 98725f6a7..3bea66588 100644 --- a/src/components/video/__tests__/video-test-cases.js +++ b/src/components/video/__tests__/video-test-cases.js @@ -7,8 +7,7 @@ testCases.basic = { component: Video, description: 'Basic', props: { - src: - 'https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true', + src: './assets/browser-example.mp4', title: 'A video!' } }; @@ -17,8 +16,7 @@ noRenderCases.reducedMotion = { component: Video, description: 'Reduced motion', props: { - src: - 'https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true', + src: './assets/browser-example.mp4', title: 'A video!' } }; diff --git a/src/components/video/video.js b/src/components/video/video.js index 0d0099620..dee81a848 100644 --- a/src/components/video/video.js +++ b/src/components/video/video.js @@ -8,7 +8,7 @@ export default class Video extends React.Component { loop: true }; const reducedMotion = - window !== 'undefined' + typeof window !== 'undefined' ? window.matchMedia('(prefers-reduced-motion: reduce)').matches : false; if (reducedMotion) {