Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
refactor: Remove button subline prop
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removes the underutilised subline prop
from the Button component to reduce layout complexity and allow
for nicer alignment of icons with multi-line button text.
  • Loading branch information
diondiondion committed Sep 2, 2019
1 parent a6c32a9 commit 79d3b98
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,33 +198,23 @@ const HoverShade = styled.span`
`;

const Content = styled.span`
display: block;
transform: translateZ(0);
position: relative;
display: flex;
align-items: center;
`;

const ButtonText = styled.span`
padding: 0 ${p => p.theme.globals.spacing.xxs};
vertical-align: middle;
`;

const Subtitle = styled.span`
display: block;
padding: ${p => p.theme.globals.spacing.xxxs} ${p =>
p.theme.globals.spacing.xxs};
${ellipsis}
opacity: ${p => p.theme.textDimStrength};
font-size: ${p => p.theme.globals.typeScale.s};
`;

function ButtonWithRef(props, ref) {
const {
as,
children,
color = 'default',
icon,
iconRight,
subline,
title,
...otherProps
} = props;
Expand All @@ -246,7 +236,6 @@ function ButtonWithRef(props, ref) {
{!iconRight && iconEl}
{children && <ButtonText>{children}</ButtonText>}
{iconRight && iconEl}
{subline && <Subtitle>{subline}</Subtitle>}
</Content>
</Wrapper>
);
Expand All @@ -257,7 +246,6 @@ const Button = forwardRef(ButtonWithRef);
Button.propTypes = {
icon: PropTypes.string,
iconRight: PropTypes.bool,
subline: PropTypes.string,

round: PropTypes.bool,
square: PropTypes.bool,
Expand All @@ -270,7 +258,7 @@ Button.propTypes = {
'shaded',
]),
size: PropTypes.oneOf(['small', 'medium', 'large']),
align: PropTypes.string,
align: PropTypes.oneOf(['left', 'right', 'center']),
};

export default Button;

0 comments on commit 79d3b98

Please sign in to comment.