Skip to content

Commit 2b831ee

Browse files
committed
Improve example page
1 parent 2dbe62b commit 2b831ee

File tree

1 file changed

+32
-7
lines changed
  • src/examples/basicExample

1 file changed

+32
-7
lines changed

src/examples/basicExample/app.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,23 @@ class App extends Component {
2828
},
2929
{
3030
id: 'b12315',
31-
title: 'Frank',
31+
title: (
32+
<div>
33+
<div
34+
style={{
35+
backgroundColor: 'gray',
36+
display: 'inline-block',
37+
borderRadius: 10,
38+
color: '#FFF',
39+
padding: '0 5px',
40+
}}
41+
>
42+
Custom
43+
</div>
44+
45+
Element
46+
</div>
47+
),
3248
},
3349
{
3450
id: 'b12316',
@@ -122,14 +138,24 @@ class App extends Component {
122138
updateTreeData={this.updateTreeData}
123139
maxDepth={5}
124140
generateNodeProps={({
125-
node: _node,
126-
path: _path,
141+
node,
142+
path,
143+
treeIndex,
127144
lowerSiblingCounts: _lowerSiblingCounts,
128-
listIndex: _listIndex,
129145
}) => ({
130146
buttons: [
131-
<button></button>,
132-
<button></button>,
147+
<button
148+
style={{
149+
verticalAlign: 'middle',
150+
}}
151+
onClick={() => alert( // eslint-disable-line no-alert
152+
`title: ${node.title} \n` +
153+
`path: ${path.join(', ')} \n` +
154+
`treeIndex: ${treeIndex}`
155+
)}
156+
>
157+
158+
</button>,
133159
],
134160
})}
135161
/>
@@ -138,7 +164,6 @@ class App extends Component {
138164
<h3>Features</h3>
139165
<ul>
140166
<li>Works right out of the box, but is highly customizable</li>
141-
<li>No external CSS</li>
142167
</ul>
143168

144169
<a href={githubUrl}>Documentation on Github</a>

0 commit comments

Comments
 (0)