Skip to content

Commit

Permalink
Refactor Button component props
Browse files Browse the repository at this point in the history
  • Loading branch information
kambereBr committed Jan 1, 2024
1 parent be8baae commit 2ef4d6b
Showing 1 changed file with 6 additions and 2 deletions.
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 2ef4d6b

Please sign in to comment.