Skip to content

Instantly share code, notes, and snippets.

Created October 11, 2017 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/d975f37d524f50e087ce262c76ff7129 to your computer and use it in GitHub Desktop.
Save anonymous/d975f37d524f50e087ce262c76ff7129 to your computer and use it in GitHub Desktop.
skills.js
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