From bc9d4bcf6f4940aa818252c21616946471dba1cf Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Tue, 24 Oct 2023 17:46:55 +0200 Subject: [PATCH] :ok_hand: [#454] PR feedback round 1 --- src/components/EditGrid/EditGrid.stories.js | 7 ++++--- src/components/EditGrid/EditGridButtonGroup.js | 13 ++++--------- src/components/EditGrid/EditGridItem.stories.js | 9 ++++++--- 3 files changed, 14 insertions(+), 15 deletions(-) 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: ( - - + + ), },