Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Youtube dynamic VideoGrid
import React from 'react';
import './VideoGrid.scss';
import {VideoGridHeader} from "./VideoGridHeader/VideoGridHeader";
import {Divider} from "semantic-ui-react";
import {VideoPreview} from '../VideoPreview/VideoPreview';
export function VideoGrid(props) {
if (!props.videos || !props.videos.length) {
return <div/>;
}
const gridItems = props.videos.map(video => {
return (<VideoPreview video={video}
key={video.id}/>);
});
const divider = props.hideDivider ? null : <Divider/>;
return (
<React.Fragment>
<VideoGridHeader title={props.title}/>
<div className='video-grid'>
{gridItems}
</div>
{divider}
</React.Fragment>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.