Skip to content

Commit

Permalink
Merge pull request #6 from kambereBr/refactor-btn-component
Browse files Browse the repository at this point in the history
Refactor Button component
  • Loading branch information
kambereBr authored Jan 1, 2024
2 parents be8baae + 84e4d47 commit c20f619
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ npx eslint .

Use at the end '--fix' to help you out with any error.

## 👥 Authors <a name="authors"></a>
## 👥 Author <a name="authors"></a>

👤 **Bruno Kambere**

- GitHub: [@kambereBr](https://github.com/kambereBr)
- Twitter: [@kambereBr](https://twitter.com/kambereBr)
- LinkedIn: [bruno kambere](https://www.linkedin.com/in/bruno-kambere-399447138/)
- LinkedIn: [bruno kambere](https://www.linkedin.com/in/bruno-kambere/)

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down
8 changes: 6 additions & 2 deletions src/components/Button.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import React from 'react';
import PropTypes from 'prop-types';

const Button = ({ content, btnClassName = 'gray-button', clickEvent }) => (
const Button = ({ content, btnClassName, clickEvent }) => (
<button type="button" className={btnClassName} onClick={clickEvent}>{content}</button>
);

Button.propTypes = {
content: PropTypes.string.isRequired,
btnClassName: PropTypes.string.isRequired,
btnClassName: PropTypes.string,
clickEvent: PropTypes.func.isRequired,
};

Button.defaultProps = {
btnClassName: 'gray-button',
};

export default Button;

0 comments on commit c20f619

Please sign in to comment.