diff -r 000000000000 -r 5f4fcbc80b37 clientjs/packages/dashboard-components/src/ui/Sidebar.jsx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clientjs/packages/dashboard-components/src/ui/Sidebar.jsx Fri Sep 14 17:57:34 2018 +0200 @@ -0,0 +1,96 @@ +import React from 'react'; +import { FormattedMessage } from 'react-intl'; +import PropTypes from 'prop-types'; + +import Tag from './Tag'; + +import './Sidebar.scss'; + +const TopicsList = ({ topics, metacategories }) => ( +
+

+ +

+ +

+ +

+ +
+ { + (topics || []).map(topic => ( +
+
+
+ )) + } +
+
+); + +TopicsList.propTypes = { + metacategories: PropTypes.arrayOf(PropTypes.object), + topics: PropTypes.arrayOf(PropTypes.string), +}; + +TopicsList.defaultProps = { + metacategories: [], + topics: [], +}; + +const MetacategoriesList = ({ topics, metacategories }) => ( +
+

+ +

+ { + (metacategories || []).map((metacategory) => { + const descId = `data.metacategories.${metacategory.id}.desc`; + return ( +
+
+
+
+ ); + }) + } +
+); + +MetacategoriesList.propTypes = { + metacategories: PropTypes.arrayOf(PropTypes.object), + topics: PropTypes.arrayOf(PropTypes.string), +}; + +MetacategoriesList.defaultProps = { + metacategories: [], + topics: [], +}; + +const Sidebar = ({ metacategories, topics }) => ( +
+ + +
+); + +Sidebar.propTypes = { + metacategories: PropTypes.arrayOf(PropTypes.object), + topics: PropTypes.arrayOf(PropTypes.string), +}; + +Sidebar.defaultProps = { + metacategories: [], + topics: [], +}; + +export default Sidebar;