Skip to content

Commit

Permalink
feat(icon): deprecate fixedWidth prop
Browse files Browse the repository at this point in the history
  • Loading branch information
theetrain committed Sep 19, 2017
1 parent 62bc5cc commit 25ce29d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/old-components/Icon/Icon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const Icon = ({ glyph, variant, fixedWidth, size, className, children, ...rest }
deprecate('Icon', '\'disabled\' variant is deprecated.')
}

if (fixedWidth) {
deprecate('Icon', '\'fixedWidth\' prop is deprecated.')
}

const classes = `${styles.icon} ${styles[`icon-core-${glyph}`]}`
+ ` ${variant ? styles[`icon--${variant}`] : ''}`
+ `${fixedWidth ? ` ${styles['icon--fw']}` : ''}`
Expand Down
8 changes: 8 additions & 0 deletions src/old-components/Icon/__tests__/Icon.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,13 @@ describe('<Icon />', () => {
expect(icon).toHaveClassName('icon--disabled')
expect(deprecate).toHaveBeenCalled()
})

it('deprecates fixedWidth prop', () => {
jest.clearAllMocks()
const icon = doShallow({ fixedWidth: true })

expect(icon).toHaveClassName('icon--fw')
expect(deprecate).toHaveBeenCalled()
})
})
})

0 comments on commit 25ce29d

Please sign in to comment.