diff --git a/client/components/AddRemoveButton.jsx b/client/components/AddRemoveButton.jsx new file mode 100644 index 00000000..f0ec1272 --- /dev/null +++ b/client/components/AddRemoveButton.jsx @@ -0,0 +1,24 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import InlineSVG from 'react-inlinesvg'; + +const addIcon = require('../images/plus.svg'); +const removeIcon = require('../images/minus.svg'); + +const AddRemoveButton = ({ type, onClick }) => { + const alt = type === 'add' ? 'add to collection' : 'remove from collection'; + const icon = type === 'add' ? addIcon : removeIcon; + + return ( + + ); +}; + +AddRemoveButton.propTypes = { + type: PropTypes.oneOf(['add', 'remove']).isRequired, + onClick: PropTypes.func.isRequired, +}; + +export default AddRemoveButton; diff --git a/client/components/Nav.jsx b/client/components/Nav.jsx index 5f9f2ecd..3886ccc8 100644 --- a/client/components/Nav.jsx +++ b/client/components/Nav.jsx @@ -326,6 +326,19 @@ class Nav extends React.PureComponent { Open } + {__process.env.UI_COLLECTIONS_ENABLED && + this.props.user.authenticated && + this.props.project.id && +