Created
October 11, 2017 08:11
-
-
Save anonymous/d975f37d524f50e087ce262c76ff7129 to your computer and use it in GitHub Desktop.
skills.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import PropTypes from 'prop-types' | |
import Button from './Button' | |
import Container from './Container' | |
import addCircle from '../../public/icons/add-circle-grey.svg' | |
import './Skills.css' | |
const Skills = ({ skills, isOwner }) => { | |
const buttons = skills.map(skill => ( | |
<Button className="skills-button" thinner color="white"> | |
{skill} | |
</Button> | |
)) | |
const renderOwner = () => { | |
if (isOwner) { | |
return ( | |
<Button className="skills-button--add" thinner faded> | |
<img src={addCircle} alt="add icon" /> | |
Add new | |
</Button> | |
) | |
} | |
return '' | |
} | |
return ( | |
<Container title="skills & interest"> | |
<div className="skills"> | |
{buttons} {renderOwner()} | |
</div> | |
</Container> | |
) | |
} | |
Skills.defaultProps = { | |
skills: [], | |
isOwner: false | |
} | |
Skills.propTypes = { | |
skills: PropTypes.array, | |
isOwner: PropTypes.bool | |
} | |
export default Skills |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment