26 | {(provided, snapshot) => (
27 |
31 | {this.props.data.map((item, index) => (
32 |
33 | ))}
34 | {provided.placeholder}
35 |
36 | )}
37 |
38 | );
39 | }
40 | }
41 |
42 | export default Column;
43 |
--------------------------------------------------------------------------------
/stories/demo/Item.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Draggable } from 'react-beautiful-dnd';
3 |
4 | import NaturalDragAnimation from '../../src';
5 |
6 | const grid = 8;
7 |
8 | const getItemStyle = (isDragging, draggableStyle) => ({
9 | // some basic styles to make the items look a bit nicer
10 | userSelect: 'none',
11 | padding: grid * 2,
12 | margin: `0 0 ${grid}px 0`,
13 |
14 | // change background colour if dragging
15 | background: isDragging ? 'lightgreen' : 'grey',
16 |
17 | // styles we need to apply on draggables
18 | ...draggableStyle,
19 | });
20 |
21 | class Item extends Component {
22 | render() {
23 | const { item, index, ...props } = this.props;
24 |
25 | return (
26 |