mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-19 17:52:45 +02:00
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):  Before (if there were multiple videos):  After (single video):  After (if there are multiple videos): 
30 lines
878 B
JavaScript
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;
|