2020-06-11 07:24:19 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
const TreeStructureWrapper = styled.div`
|
|
|
|
|
li {
|
|
|
|
|
list-style: none;
|
|
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
.tree,
|
|
|
|
|
.tree ul {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
margin-left: 9px;
|
|
|
|
|
padding: 0;
|
|
|
|
|
list-style: none;
|
2020-12-24 04:32:25 +00:00
|
|
|
color: ${(props) => props.theme.colors.paneText};
|
2020-06-19 07:30:11 +00:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree ul {
|
|
|
|
|
margin-left: 9px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree:before,
|
|
|
|
|
.tree ul:before {
|
|
|
|
|
content: "";
|
|
|
|
|
display: block;
|
|
|
|
|
width: 0;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
border-left: 2px solid;
|
|
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
.tree li {
|
|
|
|
|
margin: 0;
|
2020-08-05 07:33:44 +00:00
|
|
|
padding-left: 6px;
|
2020-06-19 07:30:11 +00:00
|
|
|
line-height: 18px;
|
2020-08-05 07:33:44 +00:00
|
|
|
padding-top: 8px;
|
2020-06-19 07:30:11 +00:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree li:before {
|
|
|
|
|
content: "";
|
|
|
|
|
display: block;
|
|
|
|
|
width: 9px;
|
|
|
|
|
height: 0;
|
|
|
|
|
border-top: 2px solid;
|
|
|
|
|
margin-top: 36px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 18px;
|
|
|
|
|
left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tree li:last-child:before {
|
2020-12-24 04:32:25 +00:00
|
|
|
background: ${(props) => props.theme.colors.paneBG};
|
2020-06-19 07:30:11 +00:00
|
|
|
height: auto;
|
|
|
|
|
top: 18px;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
}
|
2020-06-11 07:24:19 +00:00
|
|
|
`;
|
|
|
|
|
|
2020-06-19 07:30:11 +00:00
|
|
|
type TreeStructureProps = {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
};
|
|
|
|
|
|
2020-06-11 07:24:19 +00:00
|
|
|
const TreeStructure = (props: TreeStructureProps) => {
|
2020-06-19 07:30:11 +00:00
|
|
|
return <TreeStructureWrapper>{props.children}</TreeStructureWrapper>;
|
2020-06-11 07:24:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TreeStructure;
|