@@ -9,7 +9,7 @@ import DataBrowserHeader from 'components/DataBrowserHeader/DataBrowserHeader.
9
9
import DragHandle from 'components/DragHandle/DragHandle.react' ;
10
10
import HTML5Backend from 'react-dnd-html5-backend' ;
11
11
import React from 'react' ;
12
- import { DragDropContext } from 'react-dnd' ;
12
+ import { DndProvider } from 'react-dnd'
13
13
14
14
export const component = DragHandle ;
15
15
@@ -64,7 +64,6 @@ let handleStyle = {
64
64
cursor : 'ew-resize'
65
65
} ;
66
66
67
- @DragDropContext ( HTML5Backend )
68
67
class HeadersDemo extends React . Component {
69
68
constructor ( ) {
70
69
super ( ) ;
@@ -90,32 +89,34 @@ class HeadersDemo extends React.Component {
90
89
91
90
render ( ) {
92
91
return (
93
- < div style = { { height : 30 , background : '#66637A' , whiteSpace : 'nowrap' } } >
94
- < div style = { { display : 'inline-block' , width : this . state . widths [ 0 ] } } >
95
- < DataBrowserHeader name = 'objectId' type = 'Special' />
92
+ < DndProvider backend = { HTML5Backend } >
93
+ < div style = { { height : 30 , background : '#66637A' , whiteSpace : 'nowrap' } } >
94
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 0 ] } } >
95
+ < DataBrowserHeader name = 'objectId' type = 'Special' />
96
+ </ div >
97
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 0 ) } />
98
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 1 ] } } >
99
+ < DataBrowserHeader name = 'createdAt' type = 'Date' style = { lightBg } />
100
+ </ div >
101
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 1 ) } />
102
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 2 ] } } >
103
+ < DataBrowserHeader name = 'updatedAt' type = 'Date' />
104
+ </ div >
105
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 2 ) } />
106
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 3 ] } } >
107
+ < DataBrowserHeader name = 'name' type = 'String' style = { lightBg } />
108
+ </ div >
109
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 3 ) } />
110
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 4 ] } } >
111
+ < DataBrowserHeader name = 'owner' type = 'Pointer<_User>' />
112
+ </ div >
113
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 4 ) } />
114
+ < div style = { { display : 'inline-block' , width : this . state . widths [ 5 ] } } >
115
+ < DataBrowserHeader name = 'really_long_column_name_that_overflows' type = 'String' style = { lightBg } />
116
+ </ div >
117
+ < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 5 ) } />
96
118
</ div >
97
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 0 ) } />
98
- < div style = { { display : 'inline-block' , width : this . state . widths [ 1 ] } } >
99
- < DataBrowserHeader name = 'createdAt' type = 'Date' style = { lightBg } />
100
- </ div >
101
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 1 ) } />
102
- < div style = { { display : 'inline-block' , width : this . state . widths [ 2 ] } } >
103
- < DataBrowserHeader name = 'updatedAt' type = 'Date' />
104
- </ div >
105
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 2 ) } />
106
- < div style = { { display : 'inline-block' , width : this . state . widths [ 3 ] } } >
107
- < DataBrowserHeader name = 'name' type = 'String' style = { lightBg } />
108
- </ div >
109
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 3 ) } />
110
- < div style = { { display : 'inline-block' , width : this . state . widths [ 4 ] } } >
111
- < DataBrowserHeader name = 'owner' type = 'Pointer<_User>' />
112
- </ div >
113
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 4 ) } />
114
- < div style = { { display : 'inline-block' , width : this . state . widths [ 5 ] } } >
115
- < DataBrowserHeader name = 'really_long_column_name_that_overflows' type = 'String' style = { lightBg } />
116
- </ div >
117
- < DragHandle style = { handleStyle } onDrag = { this . handleDrag . bind ( this , 5 ) } />
118
- </ div >
119
+ </ DndProvider >
119
120
) ;
120
121
}
121
122
}
0 commit comments