add count for current topic in random topic component
This commit is contained in:
parent
69c2181afa
commit
2d755be6b8
|
@ -40,7 +40,7 @@ export function getRandomTopicVideos(allTopics, numVideos=4) {
|
|||
return dispatch => {
|
||||
const randomTopic = getRandomTopic(allTopics);
|
||||
dispatch(loadingRandomTopicVideos());
|
||||
fetchVideosByTopic(randomTopic, 0, 4)
|
||||
fetchVideosByTopic(randomTopic.name, 0, 4)
|
||||
.then(videos => {
|
||||
dispatch(loadedRandomTopicVideos(randomTopic, videos));
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ class RandomTopic extends React.Component {
|
|||
See All Topics
|
||||
</Link>
|
||||
<Link to="/topics">
|
||||
See All videos of {this.props.topicName} ()
|
||||
See All videos of {this.props.topicName} ({this.props.topicCount})
|
||||
</Link>
|
||||
</Grid>
|
||||
</section>
|
||||
|
@ -33,7 +33,8 @@ class RandomTopic extends React.Component {
|
|||
RandomTopic.propTypes = {
|
||||
topicName: PropTypes.string,
|
||||
videos: PropTypes.array,
|
||||
loading: PropTypes.bool
|
||||
loading: PropTypes.bool,
|
||||
topicCount: PropTypes.number
|
||||
};
|
||||
|
||||
export default (RandomTopic);
|
|
@ -45,7 +45,7 @@ const mapStateToProps = state => ({
|
|||
allTopics: state.topics.allTopics,
|
||||
loadingAllTopics: state.topics.loadingAllTopics,
|
||||
randomTopic: state.topics.randomTopic,
|
||||
randomTopicCount: static.topics.randomTopicCount,
|
||||
randomTopicCount: state.topics.randomTopicCount,
|
||||
loadingRandomTopic: state.topics.loadingRandomTopic,
|
||||
randomTopicVideos: state.topics.randomTopicVideos
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user