@@ -20,73 +20,22 @@ import TreeToTreeExample from './tree-to-tree';
20
20
import RowDirectionExample from './rtl-support' ;
21
21
import './generic.css' ;
22
22
23
- import { handleClick , SANDBOX_URL } from './sandbox-utils' ;
24
-
25
- const wrapWithSource = ( node , src ) => (
26
- < div >
27
- { node }
28
-
29
- < br />
30
- < form id = "codesandbox-form" action = { SANDBOX_URL } method = "POST" >
31
- < input id = "codesandbox-parameters" type = "hidden" name = "parameters" />
32
- </ form >
33
- < button className = "sandboxButton" onClick = { handleClick ( src ) } >
34
- PLAY WITH THIS CODE →
35
- </ button >
36
- < a
37
- href = { `https://github.com/frontend-collective/react-sortable-tree/blob/master/stories/${ src } ` }
38
- target = "_top"
39
- rel = "noopener noreferrer"
40
- className = "sourceLink"
41
- >
42
- VIEW SOURCE →
43
- </ a >
44
- </ div >
45
- ) ;
46
-
47
23
storiesOf ( 'Basics' , module )
48
- . add ( 'Minimal implementation' , ( ) =>
49
- wrapWithSource ( < BarebonesExample /> , 'barebones.js' )
50
- )
51
- . add ( 'treeData import/export' , ( ) =>
52
- wrapWithSource ( < TreeDataIOExample /> , 'tree-data-io.js' )
53
- )
54
- . add ( 'Add and remove nodes programmatically' , ( ) =>
55
- wrapWithSource ( < AddRemoveExample /> , 'add-remove.js' )
56
- )
57
- . add ( 'Modify nodes' , ( ) =>
58
- wrapWithSource ( < ModifyNodesExample /> , 'modify-nodes.js' )
59
- )
60
- . add ( 'Prevent drop' , ( ) => wrapWithSource ( < CanDropExample /> , 'can-drop.js' ) )
61
- . add ( 'Search' , ( ) => wrapWithSource ( < SearchExample /> , 'search.js' ) )
62
- . add ( 'Themes' , ( ) => wrapWithSource ( < ThemesExample /> , 'themes.js' ) )
63
- . add ( 'Callbacks' , ( ) => wrapWithSource ( < CallbacksExample /> , 'callbacks.js' ) )
64
- . add ( 'Row direction support' , ( ) =>
65
- wrapWithSource ( < RowDirectionExample /> , 'rtl-support.js' )
66
- ) ;
24
+ . add ( 'Minimal implementation' , ( ) => < BarebonesExample /> )
25
+ . add ( 'treeData import/export' , ( ) => < TreeDataIOExample /> )
26
+ . add ( 'Add and remove nodes programmatically' , ( ) => < AddRemoveExample /> )
27
+ . add ( 'Modify nodes' , ( ) => < ModifyNodesExample /> )
28
+ . add ( 'Prevent drop' , ( ) => < CanDropExample /> )
29
+ . add ( 'Search' , ( ) => < SearchExample /> )
30
+ . add ( 'Themes' , ( ) => < ThemesExample /> )
31
+ . add ( 'Callbacks' , ( ) => < CallbacksExample /> )
32
+ . add ( 'Row direction support' , ( ) => < RowDirectionExample /> ) ;
67
33
68
34
storiesOf ( 'Advanced' , module )
69
- . add ( 'Drag from external source' , ( ) =>
70
- wrapWithSource ( < ExternalNodeExample /> , 'external-node.js' )
71
- )
72
- . add ( 'Touch support (Experimental)' , ( ) =>
73
- wrapWithSource ( < TouchSupportExample /> , 'touch-support.js' )
74
- )
75
- . add ( 'Tree-to-tree dragging' , ( ) =>
76
- wrapWithSource ( < TreeToTreeExample /> , 'tree-to-tree.js' )
77
- )
78
- . add ( 'Playing with generateNodeProps' , ( ) =>
79
- wrapWithSource ( < GenerateNodePropsExample /> , 'generate-node-props.js' )
80
- )
81
- . add ( 'Drag out to remove' , ( ) =>
82
- wrapWithSource ( < DragOutToRemoveExample /> , 'drag-out-to-remove.js' )
83
- )
84
- . add ( 'onlyExpandSearchedNodes' , ( ) =>
85
- wrapWithSource (
86
- < OnlyExpandSearchedNodesExample /> ,
87
- 'only-expand-searched-node.js'
88
- )
89
- )
90
- . add ( 'Prevent some nodes from having children' , ( ) =>
91
- wrapWithSource ( < ChildlessNodes /> , 'childless-nodes.js' )
92
- ) ;
35
+ . add ( 'Drag from external source' , ( ) => < ExternalNodeExample /> )
36
+ . add ( 'Touch support (Experimental)' , ( ) => < TouchSupportExample /> )
37
+ . add ( 'Tree-to-tree dragging' , ( ) => < TreeToTreeExample /> , 'tree-to-tree.js' )
38
+ . add ( 'Playing with generateNodeProps' , ( ) => < GenerateNodePropsExample /> )
39
+ . add ( 'Drag out to remove' , ( ) => < DragOutToRemoveExample /> )
40
+ . add ( 'onlyExpandSearchedNodes' , ( ) => < OnlyExpandSearchedNodesExample /> )
41
+ . add ( 'Prevent some nodes from having children' , ( ) => < ChildlessNodes /> ) ;
0 commit comments