Small cleaning

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-03-10 10:21:14 +03:00
1 parent 31fd3a351e
commit edfae3212d
1 file changed
+5 -7
@@ -23,15 +23,13 @@ interface Props {
data: NavigationTree[]
}
const scrollToItem = (id: string) => {
const element = document.getElementById(id);
function scrollToItem(id: string) {
document.getElementById(id)?.scrollIntoView();
}
element?.scrollIntoView();
};
const getSelectedNode = (data: NavigationTree[]) => {
function getSelectedNode(data: NavigationTree[]) {
return deepDash.findDeep(data, (value, key) => key === "selected" && value === true)?.parent;
};
}
export function RecursiveTreeView({ data }: Props) {
const [expanded, setExpanded] = React.useState<string[]>([]);