From 762d69fb35b69a5831ed34027ce1ef22ad3f0aff Mon Sep 17 00:00:00 2001 From: Alexandru Munteanu <alexandru.munteanu@thinslices.com> Date: Tue, 23 Jan 2018 08:29:18 -0500 Subject: [PATCH] Update SortableList.md --- .../components/SortableList/SortableList.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/components-faraday/src/components/SortableList/SortableList.md b/packages/components-faraday/src/components/SortableList/SortableList.md index 5d2b16cf9..e6da217d3 100644 --- a/packages/components-faraday/src/components/SortableList/SortableList.md +++ b/packages/components-faraday/src/components/SortableList/SortableList.md @@ -24,13 +24,11 @@ const items = [ const Item = ({ isOver, isDragging, ...rest }) => <div>`${rest.firstName} ${rest.lastName}`</div> -const DragHandle - <SortableList items={items} listItem={Item} moveItem={(dragIndex, hoverIndex) => change items} -/> + /> ``` ### With custom drag handle @@ -38,16 +36,16 @@ const DragHandle const DragHandle = () => <div>Drag me!</div> const ItemWithDragHandle = ({ dragHandle, ...rest }) => <div> - {dragHandle} - <span>Rest of the content.</span> -</div> + {dragHandle} + <span>Rest of the content.</span> + </div> <SortableList ... listItem={ItemWithDragHandle} dragHandle={DragHandle} ... -/> + /> ``` ### How to move items around @@ -56,14 +54,14 @@ To move items of the parent container whenever `moveItem` function is called we ```js const Container = ({ moveItem, items }) => <div> - ... - <SortableList - items={items} - listItem={Item} - moveItem={moveItem} - /> - ... -</div> + ... + <SortableList + items={items} + listItem={Item} + moveItem={moveItem} + /> + ... + </div> ``` Enhanced using recompose ```js -- GitLab