Skip to content

Commit 153b6f3

Browse files
author
Fabian Nickel
committed
highlight
1 parent 38b10b1 commit 153b6f3

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/components/MuiTreeView/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ const tree = [
1313
{
1414
value: 'Parent C',
1515
nodes: [
16+
<<<<<<< 38b10b1adb4f781cd5e42ff44669bec17f97d819
1617
{ value: 'Child D', id: 'example-id' },
18+
=======
19+
{ value: 'Child D', id: 'test' },
20+
>>>>>>> highlight
1721
{ value: 'Child E' },
1822
{ value: 'Child F' },
1923
],

src/components/MuiTreeView/index.jsx

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Component } from 'react';
2-
<<<<<<< 1d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
32
import {
43
arrayOf,
54
shape,
@@ -9,9 +8,6 @@ import {
98
oneOfType,
109
object,
1110
} from 'prop-types';
12-
=======
13-
import { arrayOf, shape, number, string, func, oneOfType, object } from 'prop-types';
14-
>>>>>>> add node jd
1511
import classNames from 'classnames';
1612
import { prop } from 'ramda';
1713
import memoize from 'fast-memoize';
@@ -27,12 +23,8 @@ const pickClassName = prop('className');
2723
const tree = {
2824
// The node value.
2925
value: string.isRequired,
30-
<<<<<<< 1d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
3126
// Optional node ID. Useful for when the node value is not unique.
3227
id: oneOfType([string, number]),
33-
=======
34-
id: oneOfType[string, number],
35-
>>>>>>> add node jd
3628
};
3729

3830
Object.assign(tree, {
@@ -72,7 +64,7 @@ const styles = theme => ({
7264
},
7365
expandIcon: {},
7466
highlightItem: {
75-
backgroundColor: 'rgb(220, 227, 239)',
67+
backgroundColor: 'rgb(138, 138, 138)',
7668
},
7769
});
7870

@@ -94,7 +86,7 @@ class MuiTreeView extends Component {
9486
/** Properties applied to the ListItem element. */
9587
listItemProps: object,
9688
/** Id of a leaf which will be highlighted by adding the class */
97-
highlightId: oneOfType[string, number],
89+
highlightId: oneOfType[(string, number)],
9890
};
9991

10092
static defaultProps = {
@@ -114,11 +106,7 @@ class MuiTreeView extends Component {
114106
}
115107
);
116108

117-
<<<<<<< 1d6ac39c2109b8271f6e20f4ad9e6d87ade3a5ef
118109
handleLeafClick = leaf => {
119-
=======
120-
handleLeafClick = (leaf) => {
121-
>>>>>>> add node jd
122110
if (this.props.onLeafClick) {
123111
this.props.onLeafClick(leaf);
124112
}
@@ -193,9 +181,7 @@ class MuiTreeView extends Component {
193181
{...expansionPanelDetailsProps}
194182
classes={{ root: classes.panelDetails }}
195183
className={classNames(pickClassName(expansionPanelDetailsProps))}>
196-
{node.nodes.map(l =>
197-
this.renderNode(l, node, depth + 1)
198-
)}
184+
{node.nodes.map(l => this.renderNode(l, node, depth + 1))}
199185
</ExpansionPanelDetails>
200186
</ExpansionPanel>
201187
);

0 commit comments

Comments
 (0)