Skip to content

Commit

Permalink
fix(button): skeleton props object is now correctly spread on skeleto…
Browse files Browse the repository at this point in the history
…n shimmer

Previously, the skeleton props were typed but not applied to the shimmer. This change also renames
the prop - but t

fixes #322
  • Loading branch information
aVileBroker committed Sep 7, 2021
1 parent f8d17bf commit 1fcf324
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react';
import React, { ComponentProps, ReactNode } from 'react';
import UnstyledIcon from '@mdi/react';
import { mdiLoading } from '@mdi/js';
import styled, { StyledComponentBase } from 'styled-components';
Expand Down Expand Up @@ -41,9 +41,9 @@ export type ButtonProps = {
StyledLeftIconContainer?: StyledSubcomponentType;
StyledRightIconContainer?: StyledSubcomponentType;

skeletonProps?: SubcomponentPropsType;
skeletonShimmerProps?: ComponentProps<typeof Skeleton.Shimmer>;
/**
* @deprecated The ProgressBar loading skeleton is being replaced by the Skeleton component - use skeletonProps to customize the Skeleton wrapping the button.
* @deprecated The ProgressBar loading skeleton is being replaced by the Skeleton component - use skeletonShimmerProps to customize the Skeleton wrapping the button.
*/
ProgressBar?: JSX.Element | null;

Expand Down Expand Up @@ -163,8 +163,10 @@ const Button = ({
StyledContainer = ButtonContainer,
StyledLeftIconContainer = LeftIconContainer,
StyledRightIconContainer = RightIconContainer,

skeletonShimmerProps,
/**
* @deprecated The ProgressBar loading skeleton is being replaced by the Skeleton component - use skeletonProps to customize the Skeleton wrapping the button.
* @deprecated The ProgressBar loading skeleton is being replaced by the Skeleton component - use skeletonShimmerProps to customize the Skeleton wrapping the button.
*/
ProgressBar, // Deprecated

Expand Down Expand Up @@ -256,6 +258,7 @@ const Button = ({
<Skeleton.Shimmer
color={getFontColorFromVariant(variant, containerColor, colors.background, colors.grayDark)}
isLoading={isLoading}
{...skeletonShimmerProps}
/>
</StyledContainer>
);
Expand Down

0 comments on commit 1fcf324

Please sign in to comment.