Skip to content

Commit d1a365a

Browse files
committed
changes after second review
1 parent 62dfb80 commit d1a365a

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

packages/core/src/hooks/use_leaves_manager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const useLeavesManager = ({ structure, parents, currentDepth }) => {
1010
const [searchTerm, setSearchTerm] = useState("");
1111
const [leaves, setLeaves] = useState([]);
1212

13-
const onInputChange = event => setSearchTerm(event?.target?.value || "");
13+
const onInputChange = event => setSearchTerm(event.target.value || "");
1414

1515
useEffect(() => {
1616
const leaves = structure

packages/core/src/items/itemsStyle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export default ({ itemsHeight }) => ({
2-
maxHeight: itemsHeight,
1+
export default ({ height }) => ({
2+
maxHeight: height,
33
overflowY: "auto"
44
});

packages/core/src/no_results/noResultsStyle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
export const css = ({ itemsHeight }) => ({
1+
export const css = ({ height }) => ({
22
display: "flex",
33
flexDirection: "column",
44
alignItems: "center",
55
justifyContent: "center",
6-
height: itemsHeight
6+
height: height
77
});
88

99
export const icon = () => ({

packages/core/src/tree.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const Tree = props => {
8686
onInputChange={onInputChange}
8787
inputIconRenderer={inputIconRenderer}
8888
/>
89-
<Items getStyles={getStyles} itemsHeight={itemsHeight}>
89+
<Items getStyles={getStyles} height={itemsHeight}>
9090
{leaves &&
9191
leaves.length > 0 &&
9292
leaves.map(item => (
@@ -101,7 +101,7 @@ const Tree = props => {
101101
</Items>
102102
{leaves && leaves.length === 0 && (
103103
<NoResults
104-
itemsHeight={itemsHeight}
104+
height={itemsHeight}
105105
text={noResultsText}
106106
getStyles={getStyles}
107107
noResultsIconRenderer={noResultsIconRenderer}

packages/material_ui_tree/src/header/header.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import { makeStyles } from "@material-ui/core/styles";
99
const useStyles = makeStyles(() => ({
1010
root: {
1111
padding: "8px 16px"
12+
},
13+
button: {
14+
marginLeft: -8
1215
}
1316
}));
1417

@@ -18,7 +21,7 @@ const MaterialUIHeader = ({ headerRef, parents = [], onClick, title = "" }) => {
1821
<div ref={headerRef}>
1922
<CardActions className={classes.root}>
2023
{parents.length > 0 && (
21-
<IconButton size={"small"}>
24+
<IconButton className={classes.button} size={"small"}>
2225
<ChevronLeft onClick={onClick} />
2326
</IconButton>
2427
)}

packages/material_ui_tree/src/items/items.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const useStyles = makeStyles({
88
root: {
99
overflowY: "auto",
1010
overflowX: "hidden",
11-
maxHeight: props => props.itemsHeight - ITEMS_PADDING
11+
maxHeight: props => props.height - ITEMS_PADDING
1212
}
1313
});
1414

15-
const MaterialUIItemsRenderer = ({ children, itemsHeight }) => {
16-
const classes = useStyles({ itemsHeight });
15+
const MaterialUIItemsRenderer = ({ children, height }) => {
16+
const classes = useStyles({ height });
1717
return (
1818
<List className={classes.root} component="nav">
1919
{children}

packages/material_ui_tree/src/no_results/no_results.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ const useStyles = makeStyles({
1111
flexDirection: "column",
1212
alignItems: "center",
1313
justifyContent: "center",
14-
height: props => props.itemsHeight - ITEMS_PADDING
14+
height: props => props.height - ITEMS_PADDING
1515
}
1616
});
1717

18-
const MaterialUINoResults = ({ text, itemsHeight }) => {
18+
const MaterialUINoResults = ({ text, height }) => {
1919
const classes = useStyles({
20-
itemsHeight
20+
height
2121
});
2222
return (
2323
<div className={classes.root}>

0 commit comments

Comments
 (0)