diff --git a/src/ActionBar/ActionBar.js b/src/ActionBar/ActionBar.js index 99544201a..d3148f86b 100644 --- a/src/ActionBar/ActionBar.js +++ b/src/ActionBar/ActionBar.js @@ -11,7 +11,7 @@ export const ActionBar = ({ mobile, width, children, className, ...props }) => { return ( {mobile ? ( - + {children} ) : ( @@ -27,6 +27,10 @@ ActionBar.propTypes = { width: PropTypes.string }; +ActionBar.defaultProps = { + width: '319px' +}; + ActionBar.propDescriptions = { mobile: 'Set to **true** for mobile view of the Action Bar.', width: 'The width of the Action Bar in mobile view.' @@ -65,18 +69,20 @@ export const ActionBarHeader = ({ className, description, descriptionProps, titl {title} - {description} + {description && + {description} + } ); }; ActionBarHeader.propTypes = { + title: PropTypes.string.isRequired, className: PropTypes.string, description: PropTypes.string, descriptionProps: PropTypes.object, - title: PropTypes.string, titleProps: PropTypes.object }; diff --git a/src/ActionBar/ActionBar.test.js b/src/ActionBar/ActionBar.test.js index 14eccbdd4..60f2060b2 100644 --- a/src/ActionBar/ActionBar.test.js +++ b/src/ActionBar/ActionBar.test.js @@ -114,7 +114,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component', () => { - const element = mount(); + const element = mount( + + ); expect( element.getDOMNode().attributes['data-sample'].value @@ -122,7 +127,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component\'s h1 element', () => { - const element = mount(); + const element = mount( + + ); expect( element.find('h1').getDOMNode().attributes['data-sample'].value @@ -130,7 +140,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component\'s p element', () => { - const element = mount(); + const element = mount( + + ); expect( element.find('p').getDOMNode().attributes['data-sample'].value diff --git a/src/ActionBar/__snapshots__/ActionBar.test.js.snap b/src/ActionBar/__snapshots__/ActionBar.test.js.snap index b562e2439..33da7a377 100644 --- a/src/ActionBar/__snapshots__/ActionBar.test.js.snap +++ b/src/ActionBar/__snapshots__/ActionBar.test.js.snap @@ -23,7 +23,6 @@ exports[` create basic Action Bar 1`] = ` className="fd-action-bar__description" > Action Bar Description -
{description}