Skip to content

Commit

Permalink
Rename IconText prop spacing to gap (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtheclark authored Aug 30, 2018
1 parent a5d8159 commit 80efa5b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ exports[`Link with outline and icon text, extra padding renders as expected 1`]
onClick={[MockFunction]}
>
<IconText
gap="small"
iconBefore="bug"
spacing="small"
>
Go do things
</IconText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exports[`icons on both sides, including a non-string one renders as expected 1`]
</span>
`;

exports[`large spacing renders as expected 1`] = `
exports[`large gap renders as expected 1`] = `
<span
className="flex-parent flex-parent--center-cross"
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/icon-text/__tests__/icon-text-test-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ testCases.iconAfter = {
};

testCases.largeSpacing = {
description: 'large spacing',
description: 'large gap',
component: IconText,
props: {
children: 'Done',
iconBefore: 'check',
spacing: 'large'
gap: 'large'
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/components/icon-text/icon-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IconText extends React.Component {

render() {
const { props } = this;
const spacer = props.spacing === 'small' ? '3' : '6';
const spacer = props.gap === 'small' ? '3' : '6';

const before = !props.iconBefore ? null : (
<span className={`flex-child mr${spacer}`}>
Expand Down Expand Up @@ -49,9 +49,9 @@ IconText.propTypes = {
*/
children: PropTypes.node.isRequired,
/**
* The spacing size: `"small"` or `"large"`.
* The size of the gap between the text and the icon: `"small"` or `"large"`.
*/
spacing: PropTypes.oneOf(['small', 'large']),
gap: PropTypes.oneOf(['small', 'large']),
/**
* An icon to place before the text. If the value is a string, it should name an
* Assembly icon. If you bring your own SVG or want finer-grained control over
Expand All @@ -65,7 +65,7 @@ IconText.propTypes = {
};

IconText.defaultProps = {
spacing: 'small'
gap: 'small'
};

export default IconText;

0 comments on commit 80efa5b

Please sign in to comment.