File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/examples/basicExample Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import '../shared/favicon/favicon-32x32.png';
8
8
import '../shared/favicon/favicon.ico' ;
9
9
import '../shared/favicon/safari-pinned-tab.svg' ;
10
10
11
+ const maxDepth = 5 ;
12
+
11
13
class App extends Component {
12
14
constructor ( props ) {
13
15
super ( props ) ;
@@ -99,7 +101,7 @@ class App extends Component {
99
101
{
100
102
expanded : true ,
101
103
title : 'Limit nesting with `maxDepth`' ,
102
- subtitle : 'It\ 's set to 5 for this example' ,
104
+ subtitle : `It 's set to ${ maxDepth } for this example` ,
103
105
children : [
104
106
{
105
107
expanded : true ,
@@ -111,7 +113,10 @@ class App extends Component {
111
113
children : [
112
114
{ title : renderDepthTitle } ,
113
115
{
114
- title : 'This cannot be dragged deeper' ,
116
+ title : ( { path } ) => ( path . length >= maxDepth ?
117
+ 'This cannot be dragged deeper' :
118
+ 'This can be dragged deeper'
119
+ ) ,
115
120
} ,
116
121
] ,
117
122
} ,
@@ -264,7 +269,7 @@ class App extends Component {
264
269
< SortableTree
265
270
treeData = { treeData }
266
271
onChange = { this . updateTreeData }
267
- maxDepth = { 5 }
272
+ maxDepth = { maxDepth }
268
273
searchQuery = { searchString }
269
274
searchFocusOffset = { searchFocusIndex }
270
275
searchFinishCallback = { matches =>
You can’t perform that action at this time.
0 commit comments