Skip to content

Commit 4617a5b

Browse files
committed
chore: abandon sandbox temporarily
1 parent 43ca92e commit 4617a5b

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

website/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import ReactDOM from 'react-dom';
33

44
import './index.css';
55
import '../style.css';
6+
import './sandbox/styles.css';
7+
import SandboxApp from './sandbox/App';
68

79
class App extends React.Component {
810
render() {
@@ -33,11 +35,14 @@ class App extends React.Component {
3335
<div className="description">
3436
Drag-and-drop sortable component for nested data and hierarchies
3537
</div>
38+
<SandboxApp />
39+
{/*
3640
<iframe
3741
title="sandbox"
3842
src="https://codesandbox.io/embed/github/frontend-collective/react-sortable-tree/tree/master/website/sandbox?odemirror=1&view=preview"
3943
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
4044
/>
45+
*/}
4146
</div>
4247
);
4348
}

website/sandbox/App.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,25 @@ export default class App extends React.Component {
2929
searchFoundCount: null,
3030
treeData,
3131
};
32+
33+
this.handleTreeOnChange = this.handleTreeOnChange.bind(this);
34+
this.handleSearchOnChange = this.handleSearchOnChange.bind(this);
35+
this.selectPrevMatch = this.selectPrevMatch.bind(this);
36+
this.selectNextMatch = this.selectNextMatch.bind(this);
37+
this.toggleNodeExpansion = this.toggleNodeExpansion.bind(this);
3238
}
3339

34-
handleTreeOnChange = treeData => {
40+
handleTreeOnChange(treeData) {
3541
this.setState({ treeData });
36-
};
42+
}
3743

38-
handleSearchOnChange = e => {
44+
handleSearchOnChange(e) {
3945
this.setState({
4046
searchString: e.target.value,
4147
});
42-
};
48+
}
4349

44-
selectPrevMatch = () => {
50+
selectPrevMatch() {
4551
const { searchFocusIndex, searchFoundCount } = this.state;
4652

4753
this.setState({
@@ -50,9 +56,9 @@ export default class App extends React.Component {
5056
? (searchFoundCount + searchFocusIndex - 1) % searchFoundCount
5157
: searchFoundCount - 1,
5258
});
53-
};
59+
}
5460

55-
selectNextMatch = () => {
61+
selectNextMatch() {
5662
const { searchFocusIndex, searchFoundCount } = this.state;
5763

5864
this.setState({
@@ -61,16 +67,16 @@ export default class App extends React.Component {
6167
? (searchFocusIndex + 1) % searchFoundCount
6268
: 0,
6369
});
64-
};
70+
}
6571

66-
toggleNodeExpansion = expanded => {
72+
toggleNodeExpansion(expanded) {
6773
this.setState(prevState => ({
6874
treeData: toggleExpandedForAll({
6975
treeData: prevState.treeData,
7076
expanded,
7177
}),
7278
}));
73-
};
79+
}
7480

7581
render() {
7682
const {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
"react": "^16",
66
"react-dom": "^16",
77
"react-sortable-tree": "^2"
8+
},
9+
"devDependencies": {
10+
"@babel/core": "^7.8.4"
811
}
912
}

0 commit comments

Comments
 (0)