File tree Expand file tree Collapse file tree 2 files changed +20
-17
lines changed
stories/src/on-before-capture Expand file tree Collapse file tree 2 files changed +20
-17
lines changed Original file line number Diff line number Diff line change @@ -38,21 +38,23 @@ function List(props) {
38
38
< / div>
39
39
)}
40
40
>
41
- < div ref= {provided .innerRef } {... provided .droppableProps }>
42
- {items .map (item) => (
43
- < Draggable draggableId= {item .id } index= {item .index }>
44
- {(provided , snapshot ) => (
45
- < div
46
- {... provided .draggableProps }
47
- {... provided .dragHandleProps }
48
- ref= {provided .innerRef }
49
- >
50
- Item id: {item .id }
51
- < / div>
52
- )}
53
- < / Draggable>
54
- )}
55
- < / div>
41
+ {provided => (
42
+ < div ref= {provided .innerRef } {... provided .droppableProps }>
43
+ {items .map (item) => (
44
+ < Draggable draggableId= {item .id } index= {item .index }>
45
+ {(provided , snapshot ) => (
46
+ < div
47
+ {... provided .draggableProps }
48
+ {... provided .dragHandleProps }
49
+ ref= {provided .innerRef }
50
+ >
51
+ Item id: {item .id }
52
+ < / div>
53
+ )}
54
+ < / Draggable>
55
+ )}
56
+ < / div>
57
+ )}
56
58
< / Droppable>
57
59
);
58
60
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ function getTasks(count: number): Task[] {
27
27
const Item = styled . div `
28
28
padding: ${ grid } px;
29
29
border: 1px solid ${ colors . N30 } ;
30
- background-color: ${ colors . N30 } ;
30
+ background-color: ${ props => ( props . isDragging ? colors . G100 : colors . N30 ) } ;
31
31
margin-top: ${ grid } px;
32
32
margin-left: ${ grid } px;
33
33
margin-right: ${ grid } px;
@@ -45,10 +45,11 @@ function renderTasks(
45
45
key = { task . id }
46
46
isDragDisabled = { ! options . isDragEnabled }
47
47
>
48
- { provided => (
48
+ { ( provided , snapshot ) => (
49
49
< Item
50
50
{ ...provided . draggableProps }
51
51
{ ...provided . dragHandleProps }
52
+ isDragging = { snapshot . isDragging }
52
53
ref = { provided . innerRef }
53
54
>
54
55
Task id: { task . id }
You can’t perform that action at this time.
0 commit comments