File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import classNames from 'classnames';
33
44const 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
Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments