Skip to content

Commit

Permalink
refactor(button): set defaultProps disabled as undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
matheushdsbr committed Oct 2, 2023
1 parent 00e1edc commit cbbda49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/yoga/src/Button/web/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Button = forwardRef(
<StyledButton
ref={ref}
disabled={disabled}
aria-disabled={disabled || undefined}
aria-disabled={disabled}
aria-label={ariaLabel}
full={full}
inverted={inverted}
Expand Down Expand Up @@ -64,7 +64,7 @@ Button.propTypes = {
Button.defaultProps = {
ariaLabel: undefined,
children: 'Button',
disabled: false,
disabled: undefined,
full: false,
inverted: false,
onClick: () => {},
Expand Down
4 changes: 2 additions & 2 deletions packages/yoga/src/Button/web/Icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ButtonIcon = forwardRef(
ref={ref}
small={small}
disabled={disabled}
aria-disabled={disabled || undefined}
aria-disabled={disabled}
aria-label={ariaLabel}
>
<Icon
Expand All @@ -73,7 +73,7 @@ ButtonIcon.propTypes = {

ButtonIcon.defaultProps = {
small: false,
disabled: false,
disabled: undefined,
secondary: false,
inverted: false,
icon: undefined,
Expand Down
4 changes: 2 additions & 2 deletions packages/yoga/src/Button/web/Link.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Link = styled(Button)`
`;

const ButtonLink = ({ disabled, ...props }) => (
<Link {...props} disabled={disabled} aria-disabled={disabled || undefined} />
<Link {...props} disabled={disabled} aria-disabled={disabled} />
);

ButtonLink.propTypes = {
Expand All @@ -81,7 +81,7 @@ ButtonLink.propTypes = {
};

ButtonLink.defaultProps = {
disabled: false,
disabled: undefined,
secondary: false,
href: undefined,
icon: undefined,
Expand Down

0 comments on commit cbbda49

Please sign in to comment.