From ef4d8e94d4c5d926b5e29ff2fb2a0c2aa70e8734 Mon Sep 17 00:00:00 2001 From: David Clark Date: Tue, 28 Aug 2018 20:54:45 -0700 Subject: [PATCH 1/2] Rename IconText prop spacing to gap --- .../__tests__/__snapshots__/icon-text.test.js.snap | 2 +- .../icon-text/__tests__/icon-text-test-cases.js | 4 ++-- src/components/icon-text/icon-text.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/icon-text/__tests__/__snapshots__/icon-text.test.js.snap b/src/components/icon-text/__tests__/__snapshots__/icon-text.test.js.snap index 3e205eab..8d752063 100644 --- a/src/components/icon-text/__tests__/__snapshots__/icon-text.test.js.snap +++ b/src/components/icon-text/__tests__/__snapshots__/icon-text.test.js.snap @@ -76,7 +76,7 @@ exports[`icons on both sides, including a non-string one renders as expected 1`] `; -exports[`large spacing renders as expected 1`] = ` +exports[`large gap renders as expected 1`] = ` diff --git a/src/components/icon-text/__tests__/icon-text-test-cases.js b/src/components/icon-text/__tests__/icon-text-test-cases.js index 66443e5d..0c6e9d7b 100644 --- a/src/components/icon-text/__tests__/icon-text-test-cases.js +++ b/src/components/icon-text/__tests__/icon-text-test-cases.js @@ -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' } }; diff --git a/src/components/icon-text/icon-text.js b/src/components/icon-text/icon-text.js index 4768b462..2d370aa2 100644 --- a/src/components/icon-text/icon-text.js +++ b/src/components/icon-text/icon-text.js @@ -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 : ( @@ -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 @@ -65,7 +65,7 @@ IconText.propTypes = { }; IconText.defaultProps = { - spacing: 'small' + gap: 'small' }; export default IconText; From 86c372fc59f25b6c7d5bb68cccb8227d4d4c8796 Mon Sep 17 00:00:00 2001 From: David Clark Date: Thu, 30 Aug 2018 09:32:57 -0700 Subject: [PATCH 2/2] Fix test --- .../button/__tests__/__snapshots__/button.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/button/__tests__/__snapshots__/button.test.js.snap b/src/components/button/__tests__/__snapshots__/button.test.js.snap index 9c6485c6..241e6867 100644 --- a/src/components/button/__tests__/__snapshots__/button.test.js.snap +++ b/src/components/button/__tests__/__snapshots__/button.test.js.snap @@ -83,8 +83,8 @@ exports[`Link with outline and icon text, extra padding renders as expected 1`] onClick={[MockFunction]} > Go do things