Skip to content

Commit

Permalink
feat(button): add conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
iLya Raylyan authored and iLya Raylyan committed Dec 8, 2020
1 parent 34b23ed commit 5f034f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/button/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const Button = React.forwardRef<HTMLAnchorElement | HTMLButtonElement, Bu
const buttonChildren = (
<React.Fragment>
{leftAddons && <span className={cn(styles.addons)}>{leftAddons}</span>}
{children && <span className={cn(styles.text)}>{children}</span>}
{children && <span className={cn(styles.text, {[styles.stretchText]: !(leftAddons || rightAddons)})}>{children}</span>}
{loading && <Loader className={cn(styles.loader)} />}
{rightAddons && <span className={cn(styles.addons)}>{rightAddons}</span>}
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion packages/button/src/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
opacity: 0;
}

.text {
.stretchText {
flex-grow: 1;
}

Expand Down

0 comments on commit 5f034f3

Please sign in to comment.