Skip to content

Commit 404acac

Browse files
committed
Refactor Button component loading state conditions
1 parent a6339c0 commit 404acac

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/Button/Button.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ const StyledButton = styled(BaseButton)<{
122122
}
123123
124124
${({ $loading, $fillWidth, $styleType, theme }) => {
125-
if (!$loading) return "";
125+
if (!$loading) {
126+
return "";
127+
}
126128
127129
const shimmerGradient = theme.click.button.basic.color[$styleType].background.loading;
128130
const bgSize = $fillWidth ? "200% 100%" : "200px 100%";
@@ -161,7 +163,9 @@ const StyledButton = styled(BaseButton)<{
161163
}
162164
163165
${({ $loading, $styleType, theme }) => {
164-
if ($loading) return "";
166+
if ($loading) {
167+
return "";
168+
}
165169
166170
const bgDisabled = theme.click.button.basic.color[$styleType].background.disabled;
167171
const textDisabled = theme.click.button.basic.color[$styleType].text.disabled;
@@ -184,7 +188,9 @@ const StyledButton = styled(BaseButton)<{
184188
185189
/* Loading state styling */
186190
${({ $loading }) => {
187-
if (!$loading) return "";
191+
if (!$loading) {
192+
return "";
193+
}
188194
189195
return css`
190196
cursor: not-allowed;

0 commit comments

Comments
 (0)