Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename IconText prop spacing to gap #42

Merged
merged 2 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;