ETHReport/components/topicsList/index.js

27 lines
600 B
JavaScript
Raw Normal View History

import React from 'react';
import AnchorLink from 'react-anchor-link-smooth-scroll';
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 => (
<li key={topic}>
<AnchorLink href="#browse" onClick={props.setSearchTerm}>{ topic }</AnchorLink>
2018-07-09 14:29:57 +00:00
</li>
))
}
</ul>
</div>
);
2018-07-09 14:29:57 +00:00
TopicsList.propTypes = {
setSearchTerm: PropTypes.func.isRequired,
};
export default TopicsList;