Skip to content

Commit ea7d3fe

Browse files
authored
fix: avoid isLoading prop on button element (#530)
1 parent 17a86fe commit ea7d3fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/experimental/Button/Button.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ const ButtonStyled = styled(BaseButton)<{ $emphasis: Emphasis }>`
116116
${emphasisStyles};
117117
`;
118118

119-
const ChildrenContainer = styled.span<{ isLoading: boolean }>`
119+
const ChildrenContainer = styled.span<{ $isLoading: boolean }>`
120120
display: inline-flex;
121121
align-items: center;
122122
justify-content: center;
123123
gap: ${get('space.2')};
124124
padding: ${get('space.4')} ${get('space.6')};
125125

126-
opacity: ${({ isLoading }) => (isLoading ? 0 : 1)};
127-
visibility: ${({ isLoading }) => (isLoading ? 'hidden' : 'visible')};
126+
opacity: ${({ $isLoading }) => ($isLoading ? 0 : 1)};
127+
visibility: ${({ $isLoading }) => ($isLoading ? 'hidden' : 'visible')};
128128
transition: opacity ease 200ms;
129129
`;
130130

@@ -148,7 +148,7 @@ const spinnerColor: Record<Emphasis, string> = {
148148
function Button({ children, emphasis = 'primary', isLoading = false, ...restProps }: ButtonProps): ReactElement {
149149
const renderContent = (props: ButtonRenderProps & { defaultChildren: ReactNode }) => (
150150
<>
151-
<ChildrenContainer isLoading={isLoading}>
151+
<ChildrenContainer $isLoading={isLoading}>
152152
{typeof children === 'function' ? children(props) : children}
153153
</ChildrenContainer>
154154
{isLoading && (

0 commit comments

Comments
 (0)