@@ -9,7 +9,7 @@ import DataBrowserHeader from 'components/DataBrowserHeader/DataBrowserHeader.
99import DragHandle from 'components/DragHandle/DragHandle.react' ;
1010import HTML5Backend from 'react-dnd-html5-backend' ;
1111import React from 'react' ;
12- import { DragDropContext } from 'react-dnd' ;
12+ import { DndProvider } from 'react-dnd'
1313
1414export const component = DragHandle ;
1515
@@ -64,7 +64,6 @@ let handleStyle = {
6464 cursor : 'ew-resize'
6565} ;
6666
67- @DragDropContext ( HTML5Backend )
6867class HeadersDemo extends React . Component {
6968 constructor ( ) {
7069 super ( ) ;
@@ -90,32 +89,34 @@ class HeadersDemo extends React.Component {
9089
9190 render ( ) {
9291 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 ) } />
96118 </ 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 >
119120 ) ;
120121 }
121122}
0 commit comments