Skip to content

Commit f9cf8db

Browse files
committed
feat(Buttons): support block level buttons
1 parent 6c13cc1 commit f9cf8db

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/Button.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import classNames from 'classnames';
33

44
const propTypes = {
55
active: PropTypes.bool,
6+
block: PropTypes.bool,
67
color: PropTypes.string,
78
disabled: PropTypes.bool,
89
El: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
@@ -32,6 +33,7 @@ class Button extends React.Component {
3233
render() {
3334
const {
3435
active,
36+
block,
3537
children,
3638
className,
3739
color,
@@ -45,6 +47,7 @@ class Button extends React.Component {
4547
'btn',
4648
'btn-' + color,
4749
size ? 'btn-' + size : false,
50+
block ? 'btn-block' : false,
4851
{ active }
4952
);
5053

test/Button.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ describe('Button', () => {
3838
expect(large.hasClass('btn-lg')).toBe(true);
3939
});
4040

41+
it('should render block level buttons', () => {
42+
const block = shallow(<Button block>Block Level Button</Button>);
43+
44+
expect(block.hasClass('btn-block')).toBe(true);
45+
});
46+
4147
describe('onClick', () => {
4248
it('is called when passed as property', () => {
4349
const onClick = jasmine.createSpy('onClick');

0 commit comments

Comments
 (0)