Skip to content

Commit

Permalink
add size option to circle component
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshK2 committed Sep 1, 2019
1 parent bb91772 commit 1a75823
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/components/Circle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ import './style.css'

export default class Circle extends Component {
render() {
return <div className="lds-circle" style={{ background: this.props.color }}></div>
const { color, size } = this.props;
return <div className="lds-circle" style={{ background: color, width: size, height: size }}></div>
}
}

Circle.propTypes = {
/** hex color */
color: PropTypes.string,
/** size in pixel */
size: PropTypes.number,
}

Circle.defaultProps = {
color: '#7f58af',
size: 64,
}
2 changes: 0 additions & 2 deletions src/components/Circle/style.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.lds-circle {
display: inline-block;
width: 64px;
height: 64px;
margin: 8px;
border-radius: 50%;
animation: lds-circle 2.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
Expand Down

0 comments on commit 1a75823

Please sign in to comment.