2018-12-06 00:34:48 +02:00
|
|
|
import Grid from 'react-css-grid'
|
2018-12-05 00:49:33 +02:00
|
|
|
import React from 'react';
|
2018-12-07 18:59:16 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2018-12-06 00:34:48 +02:00
|
|
|
import VideoItem from "./VideoItem";
|
2018-12-06 20:33:29 +02:00
|
|
|
import SectionHeading from "./SectionHeading";
|
2018-12-06 00:34:48 +02:00
|
|
|
|
|
|
|
class RandomTopic extends React.Component {
|
2018-12-06 20:33:29 +02:00
|
|
|
|
2018-12-06 00:34:48 +02:00
|
|
|
render() {
|
|
|
|
return (
|
2018-12-06 20:33:29 +02:00
|
|
|
<section>
|
2018-12-07 18:59:16 +02:00
|
|
|
<SectionHeading title={ this.props.topicName } />
|
2018-12-06 20:33:29 +02:00
|
|
|
<Grid
|
|
|
|
width={450}
|
|
|
|
gap={16}>
|
2018-12-07 18:59:16 +02:00
|
|
|
{ this.props.videos.map(video =>
|
|
|
|
<VideoItem id={ video.id } title={ video.title } />
|
|
|
|
)}
|
|
|
|
|
2018-12-06 20:33:29 +02:00
|
|
|
</Grid>
|
|
|
|
<a href="/topics">See All videos</a>
|
|
|
|
|
|
|
|
</section>
|
2018-12-06 00:34:48 +02:00
|
|
|
|
|
|
|
)
|
|
|
|
}
|
2018-12-05 00:49:33 +02:00
|
|
|
}
|
2018-12-06 00:34:48 +02:00
|
|
|
|
2018-12-07 18:59:16 +02:00
|
|
|
RandomTopic.propTypes = {
|
|
|
|
topicName: PropTypes.string,
|
|
|
|
videos: PropTypes.array,
|
|
|
|
loading: PropTypes.bool
|
|
|
|
};
|
|
|
|
|
2018-12-06 00:34:48 +02:00
|
|
|
export default (RandomTopic);
|