jsl grid display

This commit is contained in:
Jan Prochazka
2020-04-10 09:50:20 +02:00
parent 949985769c
commit 3bc6f60f75
12 changed files with 152 additions and 61 deletions

View File

@@ -22,7 +22,10 @@ const TabNameWrapper = styled.span`
margin-left: 5px;
`;
const TabContainer = styled.div``;
const TabContainer = styled.div`
position: relative;
flex-grow: 1;
`;
const TabsContainer = styled.div`
display: flex;
@@ -31,6 +34,11 @@ const TabsContainer = styled.div`
background-color: ${theme.tabsPanel.background};
`;
const MainContainer = styled.div`
display: flex;
flex-direction: column;
`;
export function TabPage({ label = undefined, children }) {
return children;
}
@@ -39,7 +47,7 @@ export function TabControl({ children }) {
const [value, setValue] = React.useState(0);
const childrenArray = (_.isArray(children) ? _.flatten(children) : [children]).filter((x) => x);
return (
<div>
<MainContainer>
<TabsContainer>
{childrenArray
.filter((x) => x.props)
@@ -51,6 +59,6 @@ export function TabControl({ children }) {
))}
</TabsContainer>
{<TabContainer key={value}>{childrenArray[value] && childrenArray[value].props.children}</TabContainer>}
</div>
</MainContainer>
);
}