Skip to content

Commit

Permalink
feat: added video component
Browse files Browse the repository at this point in the history
  • Loading branch information
zstix committed May 21, 2020
1 parent ebe1d18 commit ed098aa
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/components/Video.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';

import styles from './Video.module.scss';

const Video = ({ youtubeId }) => (
<div className={styles.Video}>
<iframe
src={`//www.youtube.com/embed/${youtubeId}`}
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
frameBorder="0"
allowFullScreen
/>
</div>
);

Video.propTypes = {
// NOTE: we should expand this allow for other video sources in the future
youtubeId: PropTypes.string.isRequired,
};

export default Video;
9 changes: 9 additions & 0 deletions src/components/Video.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.Video {
max-width: 560px;
margin: 1rem 0;

iframe {
width: 100%;
height: 315px;
}
}

0 comments on commit ed098aa

Please sign in to comment.