1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00
unleash.unleash/website/src/components/VideoContent.jsx
Thomas Heartman fa4d6b211a
docs: make videos bigger (#4980)
This PR changes the `VideoContent` component to:
- remove the extra text; keeps only videos
- makes videos take up the full article width
- multiple videos stack vertically (this may or may not be the best way
to handle it, but we don't have any instances of using multiple videos
as of right now, so we shouldn't touch this until we do).

By chance, it also removes a lot of trailing whitespace in files. I
suggest checking out the diff with whitespace hidden.

Before (single video):

![image](https://github.com/Unleash/unleash/assets/17786332/e47e8827-93e9-4dbc-bdfb-cdb1665fae98)


Before (if there were multiple videos): 

![image](https://github.com/Unleash/unleash/assets/17786332/f41ab11f-649f-4369-96fe-70a5d66ced40)


After (single video):

![image](https://github.com/Unleash/unleash/assets/17786332/0df9d3fd-3935-4567-93d0-470682fe4bb3)


After (if there are multiple videos): 

![image](https://github.com/Unleash/unleash/assets/17786332/98b4a590-c03c-40a1-880f-93ad05090c5e)
2023-10-10 11:42:25 +02:00

30 lines
878 B
JavaScript

import React from 'react';
import Admonition from '@theme/Admonition';
const Component = ({ videoUrls }) => {
return (
<article className='unleash-video-container'>
{videoUrls ? (
videoUrls.map((url) => (
<iframe
key={url}
width='100%'
height='auto'
src={url}
title='YouTube video player'
frameBorder='0'
allowFullScreen
></iframe>
))
) : (
<Admonition type='danger'>
You need to provide YouTube video URLs for this component to
work properly.
</Admonition>
)}
</article>
);
};
export default Component;