frontend/src/components/RandomTopic.js

43 lines
1.2 KiB
JavaScript
Raw Normal View History

import Grid from 'react-css-grid'
2018-12-05 00:49:33 +02:00
import React from 'react';
import PropTypes from 'prop-types';
import VideoItem from "./VideoItem";
import RandomItemTitle from "./SectionHeading";
import { Link } from 'react-router-dom';
class RandomTopic extends React.Component {
render() {
return (
<section>
<h2 className="section-heading">from the Archive Topics - من مواضيع الارشيف</h2>
<RandomItemTitle title={
this.props.topicName + ' (' +this.props.topicCount + ')'}/>
<Grid className="random-topics"
width={220}
gap={12}>
2018-12-07 19:35:40 +02:00
{this.props.videos.map(video =>
2018-12-08 20:32:45 +02:00
<VideoItem id={video.id} key={video.id} title={video.title }/>
)}
2018-12-11 12:42:56 +02:00
{/*<Link to="/topics">*/}
{/*<span className="view-all-parents">See All Topics</span>*/}
{/*</Link>*/}
{/*<Link to="/topics">*/}
{/*<span className="view-all-items"> See All videos of {this.props.topicName} ({this.props.topicCount})</span>*/}
{/*</Link>*/}
</Grid>
</section>
)
}
2018-12-05 00:49:33 +02:00
}
RandomTopic.propTypes = {
topicName: PropTypes.string,
videos: PropTypes.array,
loading: PropTypes.bool,
topicCount: PropTypes.number
};
export default (RandomTopic);