diff --git a/src/components/EditGrid/EditGrid.stories.js b/src/components/EditGrid/EditGrid.stories.js index 23d4ab21b..a01bc2ace 100644 --- a/src/components/EditGrid/EditGrid.stories.js +++ b/src/components/EditGrid/EditGrid.stories.js @@ -1,5 +1,6 @@ +import {Button} from '@utrecht/component-library-react'; + import Body from 'components/Body'; -import Button from 'components/Button'; import {EditGrid, EditGridButtonGroup, EditGridItem} from '.'; @@ -17,7 +18,7 @@ export default { heading="Item 1" buttons={ - + } > @@ -27,7 +28,7 @@ export default { heading="Item 2" buttons={ - + } > diff --git a/src/components/EditGrid/EditGridButtonGroup.js b/src/components/EditGrid/EditGridButtonGroup.js index b7337a44b..2e4210c10 100644 --- a/src/components/EditGrid/EditGridButtonGroup.js +++ b/src/components/EditGrid/EditGridButtonGroup.js @@ -2,17 +2,12 @@ import {ButtonGroup} from '@utrecht/component-library-react'; import PropTypes from 'prop-types'; import React from 'react'; -const EditGridButtonGroup = ({children}) => { - const role = children && React.Children.count(children) > 1 ? 'group' : undefined; - return ( - - {children} - - ); -}; +const EditGridButtonGroup = ({children}) => ( + {children} +); EditGridButtonGroup.propTypes = { - children: PropTypes.arrayOf(PropTypes.node.isRequired), + children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired, }; export default EditGridButtonGroup; diff --git a/src/components/EditGrid/EditGridItem.stories.js b/src/components/EditGrid/EditGridItem.stories.js index 6a79f2a3b..8cf95f0a1 100644 --- a/src/components/EditGrid/EditGridItem.stories.js +++ b/src/components/EditGrid/EditGridItem.stories.js @@ -1,5 +1,6 @@ +import {Button} from '@utrecht/component-library-react'; + import Body from 'components/Body'; -import Button from 'components/Button'; import {EditGridButtonGroup, EditGridItem as EditGridItemComponent} from '.'; @@ -15,8 +16,10 @@ export default { children: Item body, typically form fields, buttons: ( - - + + ), },