1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Small cleaning

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-03-10 10:21:14 +03:00
parent 31fd3a351e
commit edfae3212d

View File

@ -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[]>([]);