diff --git a/components/src/components/atoms/Button/Button.tsx b/components/src/components/atoms/Button/Button.tsx index 88875421..b3c172d3 100644 --- a/components/src/components/atoms/Button/Button.tsx +++ b/components/src/components/atoms/Button/Button.tsx @@ -307,25 +307,21 @@ export const Button = React.forwardRef( {children} ) - const spinnerColor = disabled ? 'greyPrimary' : 'backgroundPrimary' let childContent: ReactNodeNoStrings if (shape === 'circle' || shape === 'square') { - childContent = loading ? : labelContent + childContent = loading ? : labelContent } else { const hasPrefix = !!prefix const hasNoPrefixNoSuffix = !hasPrefix && !suffix const hasSuffixNoPrefix = !hasPrefix && !!suffix let prefixOrLoading = prefix - if (loading && hasPrefix) - prefixOrLoading = - else if (loading && hasNoPrefixNoSuffix) - prefixOrLoading = + if (loading && hasPrefix) prefixOrLoading = + else if (loading && hasNoPrefixNoSuffix) prefixOrLoading = let suffixOrLoading = suffix - if (loading && hasSuffixNoPrefix) - suffixOrLoading = + if (loading && hasSuffixNoPrefix) suffixOrLoading = childContent = ( <> diff --git a/components/src/components/atoms/Spinner/Spinner.tsx b/components/src/components/atoms/Spinner/Spinner.tsx index 02dca4aa..aebb4017 100644 --- a/components/src/components/atoms/Spinner/Spinner.tsx +++ b/components/src/components/atoms/Spinner/Spinner.tsx @@ -21,12 +21,14 @@ const rotate = keyframes` } ` -const Container = styled.div<{ $size: Size; $color: Colors }>( +const Container = styled.div<{ $size: Size; $color?: Colors }>( ({ theme, $color, $size }) => css` animation: ${rotate} 1.1s linear infinite; - color: ${theme.colors[$color]}; - stroke: ${theme.colors[$color]}; + ${$color && + css` + color: ${theme.colors[$color]}; + `} ${() => { switch ($size) { @@ -55,6 +57,7 @@ const Container = styled.div<{ $size: Size; $color: Colors }>( svg { display: block; + stroke: currentColor; height: 100%; width: 100%; }