ETHReport/components/topicsList/index.js

27 lines
553 B
JavaScript
Raw Normal View History

import React from 'react';
2018-07-09 14:29:57 +00:00
import { PropTypes } from 'prop-types';
import Data from '../../data/archives/topics';
import './style.scss';
2018-07-09 14:29:57 +00:00
const TopicsList = props => (
<div className="topics-list">
<h4>Topics</h4>
<ul>
{
2018-07-09 14:29:57 +00:00
Data.map(topic => (
// eslint-disable-next-line
<li key={topic} onClick={props.setSearchTerm}>
<span>{ topic }</span>
</li>
))
}
</ul>
</div>
);
2018-07-09 14:29:57 +00:00
TopicsList.propTypes = {
setSearchTerm: PropTypes.func.isRequired,
};
export default TopicsList;