fix: layout calc

This commit is contained in:
Bogdan Lyashenko
2019-08-01 19:11:11 +02:00
parent 564c81362e
commit dfebfa20a2
3 changed files with 4 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
.TreeDiagramsContainer {
overflow: auto;
width: 100%;
margin-top: 10px;
margin-top: 20px;
}
.MainLoader {

View File

@@ -24,6 +24,7 @@ const TreeDiagramsContainer = ({ namespacesList, activeNamespace }) => {
);
}
// TODO: use ref for TreeDiagram container (on mount set it to store)
return (
<div className={'TreeDiagramsContainer'}>
{namespacesList.map(namespace => (

View File

@@ -69,6 +69,8 @@ export const getTreeLayout = (
}, 0);
}
// TODO: calc properly, not 5000
// impossible to do in one loop
const LARGE_WIDTH_CC = 5000;
const widthSpace =
node.data.type !== DIR_NODE_TYPE && node.data.type !== FILE_NODE_TYPE