Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix(Button): Rename internal loading prop to isLoading to remove… (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylealwyn authored Feb 5, 2020
1 parent 3954f8e commit 303879e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Button/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const StyledButton = createComponent({
theme,
block,
disabled,
loading,
isLoading,
borderRadius = theme.radius,
colorFocus = theme.colors.colorFocus,
}) => {
Expand Down Expand Up @@ -121,7 +121,7 @@ const StyledButton = createComponent({
}
}
${loading && loadingCss(sizeStyles.height, variantStyles.color)};
${isLoading && loadingCss(sizeStyles.height, variantStyles.color)};
${variantStyles}
${sizeStyles};
${space};
Expand All @@ -133,13 +133,14 @@ const renderIcon = (icon, props) => <Icon name={icon} {...props} />;

/** Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more. We include several predefined button styles, each serving its own semantic purpose, with a few extras thrown in for more control. */
const Button = React.forwardRef(
({ children, leftIcon, leftIconProps, rightIcon, rightIconProps, colorFocus, ...rest }, ref) => (
({ children, leftIcon, leftIconProps, rightIcon, rightIconProps, colorFocus, loading, ...rest }, ref) => (
<StyledButton
ref={ref}
hasText={!!children}
leftIcon={leftIcon}
rightIcon={rightIcon}
colorFocus={colorFocus}
isLoading={loading}
{...rest}>
{leftIcon && renderIcon(leftIcon, leftIconProps)}
{children}
Expand Down

0 comments on commit 303879e

Please sign in to comment.