Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Fix Video build (#186)
Browse files Browse the repository at this point in the history
* use getWindow, check window in componentDidMount

* Revert "use getWindow, check window in componentDidMount"

This reverts commit e9345c5.

* fix per @katydecorah's comment

* use local video file in test

* update changelog
  • Loading branch information
Colleen McGinnis authored Sep 16, 2019
1 parent 57b724c commit 9fd8b3f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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%"
Expand All @@ -16,7 +16,7 @@ exports[`video Basic renders as expected 1`] = `
Your browser doesn't support HTML5 video. Here is a
<a
href="https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true"
href="./assets/browser-example.mp4"
>
link to the video
</a>
Expand All @@ -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%"
Expand All @@ -41,7 +41,7 @@ exports[`video Reduced motion renders as expected 1`] = `
Your browser doesn't support HTML5 video. Here is a
<a
href="https://github.com/mapbox/android-docs/blob/publisher-production/src/video/example-bathymetry-activity.mp4?raw=true"
href="./assets/browser-example.mp4"
>
link to the video
</a>
Expand Down
6 changes: 2 additions & 4 deletions src/components/video/__tests__/video-test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!'
}
};
Expand All @@ -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!'
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/video/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9fd8b3f

Please sign in to comment.