frontend/src/components/RandomTopic.js

60 lines
1.9 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";
class RandomTopic extends React.Component {
render() {
return (
<section>
<h2 className="section-heading">from the Archive Topics - من مواضيع الارشيف</h2>
<RandomItemTitle title={this.props.topicName}
count={this.props.topicCount}
src={'/topic/' + this.props.topicName}
/>
<Grid
width={450}
>
{/* View all topics button*/}
<button className="view-all-topics" onClick="">
<span className="english-text">All Topics - </span>
<span className="arabic-text"> جميع المواضيع </span>
</button>
{/* Shuffle button */}
<button className="shuffle-button" onClick="">
<span className="english-text">Shuffle Topics - </span>
<span className="arabic-text"> موضوع عشوائي </span>
<i className="fa fa-random"></i>
</button>
</Grid>
<Grid className="random-topics"
width={220}
gap={12}>
2018-12-07 19:35:40 +02:00
{this.props.videos.map(video =>
<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>*/}
2018-12-11 12:42:56 +02:00
{/*</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);