Skip to content

Commit

Permalink
add optional style prop to Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Sep 10, 2024
1 parent a277e5c commit 42de768
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/editor/components/components/Button/Button.component.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { bool, element, func, node, number, string } from 'prop-types';
import { bool, element, func, node, number, object, string } from 'prop-types';

import classNames from 'classnames';
import styles from './Button.module.scss';
Expand All @@ -19,6 +19,7 @@ const variants = {
* @category Components
* @param {{
* className?: string;
* style?: object;
* onClick?: () => void;
* onPointerDown?: () => void;
* onPointerUp?: () => void;
Expand All @@ -34,6 +35,7 @@ const variants = {
*/
const Button = ({
className,
style,
onClick,
onPointerDown,
onPointerUp,
Expand All @@ -48,6 +50,7 @@ const Button = ({
}) => (
<button
className={classNames(styles.buttonWrapper, variants[variant], className)}
style={style}
onClick={onClick}
onPointerDown={onPointerDown}
onPointerUp={onPointerUp}
Expand All @@ -65,6 +68,7 @@ const Button = ({

Button.propTypes = {
className: string,
style: object,
onClick: func,
onPointerDown: func,
onPointerUp: func,
Expand Down

0 comments on commit 42de768

Please sign in to comment.