From bf58dd15c64b089a6cbbc018f6baeb4effe4cbe0 Mon Sep 17 00:00:00 2001 From: Tuan Cao Date: Thu, 24 Mar 2022 15:19:01 +0700 Subject: [PATCH] A little bit more styling and default expanded Side bar --- components/FolderTree.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/FolderTree.js b/components/FolderTree.js index 5fa2e35..0c0c10e 100644 --- a/components/FolderTree.js +++ b/components/FolderTree.js @@ -15,11 +15,13 @@ export default function FolderTree(props) { ); const router = useRouter() + // const childrenNodeIds = props.tree.children.map(aNode => {return aNode.id}) + const expandedNodes = [props.tree.id] return ( } - defaultExpanded={['root']} + defaultExpanded={expandedNodes} defaultExpandIcon={} onNodeSelect = {(event, nodIds) => { const currentNode = props.flattenNodes.find(aNode => {return aNode.id === nodIds})