Skip to content

Commit

Permalink
docs: add video content component (to be moved)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Jan 26, 2022
1 parent c373db4 commit 1a399fc
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions website/docs/how-to/VideoThing.jsx
@@ -0,0 +1,42 @@
import React from 'react';
import Admonition from '@theme/Admonition';

const Component = ({ videoUrls, children }) => {
return (
<article className="unleash-video-wrapper">
<div className="unleash-video-container">
<Admonition type="tip" title="Video content">
{children}
Hey! Did you know that the content in this guide is also
available in video format? If that's more your speed, feel
free to check out one of these related videos 🍿📽
</Admonition>

<div className="videos">
{videoUrls ? (
videoUrls.map((url) => (
<div className="video-wrapper">
<iframe
key={url}
width="100%"
height="auto"
src={url}
title="YouTube video player"
frameBorder="0"
allowFullScreen
></iframe>
</div>
))
) : (
<Admonition type="danger">
You need to provide YouTube video URLs for this
component to work properly.
</Admonition>
)}
</div>
</div>
</article>
);
};

export default Component;

0 comments on commit 1a399fc

Please sign in to comment.