Skip to content

Commit

Permalink
Fix ButtonLink (#263)
Browse files Browse the repository at this point in the history
* fix styles of ButtonLink

* refactor button styles
  • Loading branch information
devgioele authored Aug 9, 2023
1 parent 2bb0965 commit c1eba0e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
<button
className={classNames(
button.button.base,
!props.disabled
? button.modeVariantTone[mode][variant][tone]
: button.modeVariantTone[mode][variant].disabled,
props.disabled
? button.modeVariantTone[mode][variant].disabled
: button.modeVariantTone[mode][variant][tone],
button.button.variantSize.base,
button.button.variantSize[variant][size],
className,
Expand Down
4 changes: 1 addition & 3 deletions src/components/button/ButtonIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const ButtonIcon = forwardRef<HTMLButtonElement, ButtonIconProps>(
!props.disabled
? button.modeVariantTone[mode][variant][tone]
: button.modeVariantTone[mode][variant].disabled,
button.buttonIcon.variantSize[
variant === ButtonVariant.Ghost ? variant : 'base'
][size],
button.buttonIcon.variantSize[variant][size],
className,
)}
aria-label={label}
Expand Down
4 changes: 1 addition & 3 deletions src/components/button/ButtonIconLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export const ButtonIconLink = forwardRef<
!disabled
? button.modeVariantTone[mode][variant][tone]
: button.modeVariantTone[mode][variant].disabled,
button.buttonIcon.variantSize[
variant === ButtonVariant.Ghost ? variant : 'base'
][size],
button.buttonIcon.variantSize[variant][size],
className,
)

Expand Down
5 changes: 2 additions & 3 deletions src/components/button/ButtonLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ export const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(
disabled
? button.modeVariantTone[mode][variant].disabled
: button.modeVariantTone[mode][variant][tone],
button.button.variantSize[
variant === ButtonVariant.Ghost ? variant : 'base'
][size],
button.button.variantSize.base,
button.button.variantSize[variant][size],
className,
)

Expand Down
7 changes: 6 additions & 1 deletion src/components/button/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
},
},
variantSize: {
base: {
[ButtonVariant.Solid]: {
[Size.Sm]: 'p-1.5',
[Size.Md]: 'p-2',
[Size.Lg]: 'p-3',
Expand All @@ -70,6 +70,11 @@ export default {
[Size.Md]: 'p-2-1px border',
[Size.Lg]: 'p-3-1px border',
},
[ButtonVariant.Transparent]: {
[Size.Sm]: 'p-1.5',
[Size.Md]: 'p-2',
[Size.Lg]: 'p-3',
},
},
},
modeVariantTone: {
Expand Down

0 comments on commit c1eba0e

Please sign in to comment.