Skip to content

Commit a3a6f64

Browse files
committed
chore: remove wrapWithSource
1 parent 30749c7 commit a3a6f64

File tree

2 files changed

+16
-157
lines changed

2 files changed

+16
-157
lines changed

stories/index.js

+16-67
Original file line numberDiff line numberDiff line change
@@ -20,73 +20,22 @@ import TreeToTreeExample from './tree-to-tree';
2020
import RowDirectionExample from './rtl-support';
2121
import './generic.css';
2222

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-
4723
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 />);
6733

6834
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 />);

stories/sandbox-utils.js

-90
This file was deleted.

0 commit comments

Comments
 (0)