fix(list-widget): use the sortable handle (#1655)

This commit is contained in:
David Francoeur 2018-08-27 11:14:03 -04:00 committed by Shawn Erquhart
parent cad676dbf3
commit e215f6889c

View File

@ -33,14 +33,16 @@ const DragIconContainer = styled(TopBarButtonSpan)`
cursor: move;
`;
const ListItemTopBar = ({ className, collapsed, onCollapseToggle, onRemove, dragHandleHOC }) => {
const DragHandle = dragHandleHOC(() => (
const DragHandle = ({ dragHandleHOC }) => {
const Handle = dragHandleHOC(() => (
<DragIconContainer>
<Icon type="drag-handle" size="small" />
</DragIconContainer>
));
return <Handle />;
};
return (
const ListItemTopBar = ({ className, collapsed, onCollapseToggle, onRemove, dragHandleHOC }) => (
<TopBar className={className}>
{onCollapseToggle ? (
<TopBarButton onClick={onCollapseToggle}>
@ -54,8 +56,7 @@ const ListItemTopBar = ({ className, collapsed, onCollapseToggle, onRemove, drag
</TopBarButton>
) : null}
</TopBar>
);
};
);
const StyledListItemTopBar = styled(ListItemTopBar)`
display: flex;