77} from 'react-beautiful-dnd'
88
99import { Props } from '../../../common'
10- import { StyledListArea , StyledListItem } from './style'
10+ import { StyledDraggableList , StyledListArea , StyledListItem } from './style'
1111
1212interface IDraggableListProps < T > {
1313 /** Droppable area id - this allows us to have more than one per page */
@@ -16,11 +16,13 @@ interface IDraggableListProps<T> {
1616 setItems : React . Dispatch < React . SetStateAction < T [ ] > >
1717 /** An array of ReactElements that should represent the array of items */
1818 children : React . ReactElement [ ]
19+ /** The margins around the component */
20+ margins ?: Props . IMargins
1921 /** The data-component-context */
2022 componentContext ?: string
2123}
2224
23- const DraggableList = < T extends { } > ( { droppableId, setItems, children, componentContext } : IDraggableListProps < T > ) => {
25+ const DraggableList = < T extends { } > ( { droppableId, setItems, children, margins , componentContext } : IDraggableListProps < T > ) => {
2426 const onDragEnd = ( result : DropResult ) => {
2527 if ( ! result . destination ) {
2628 return
@@ -36,7 +38,8 @@ const DraggableList = <T extends {}> ({ droppableId, setItems, children, compone
3638 }
3739
3840 return (
39- < span
41+ < StyledDraggableList
42+ margins = { margins }
4043 data-component-type = { Props . ComponentType . DraggableList }
4144 data-component-context = { componentContext }
4245 >
@@ -83,7 +86,7 @@ const DraggableList = <T extends {}> ({ droppableId, setItems, children, compone
8386 ) }
8487 </ Droppable >
8588 </ DragDropContext >
86- </ span >
89+ </ StyledDraggableList >
8790 )
8891}
8992
0 commit comments