Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
barbalex committed Jul 12, 2023
1 parent c423fce commit 17ed583
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
30 changes: 23 additions & 7 deletions src/components/Projekte/ProjektContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,15 @@ const ProjektContainer = () => {
),
}

// console.log('ProjektContainer', {
// isPrint,
// treeTabs,
// })
console.log('ProjektContainer', {
isPrint,
treeTabs,
})

if (isPrint) {
return <Outlet />
}

const overflow = showApberForAll || showApberForArt ? 'auto' : 'hidden'

return (
<Container>
<StyledSplitPane
Expand All @@ -124,7 +122,18 @@ const ProjektContainer = () => {
: `${100 / treeTabs.length}%`
}
maxSize={-10}
overflow={overflow}
overflowPane1={
treeTabs[0] === 'daten' && (showApberForAll || showApberForArt)
? 'auto'
: 'hidden'
}
overflowPane2={
treeTabs[1] === 'daten' &&
treeTabs.length === 2 &&
(showApberForAll || showApberForArt)
? 'auto'
: 'hidden'
}
>
{elObj[treeTabs[0]]}
{treeTabs.length === 1 && <></>}
Expand All @@ -134,6 +143,13 @@ const ProjektContainer = () => {
split="vertical"
size={`${100 / (treeTabs.length - 1)}%`}
maxSize={-10}
overflowPane1={
treeTabs[1] === 'daten' &&
treeTabs.length > 2 &&
(showApberForAll || showApberForArt)
? 'auto'
: 'hidden'
}
>
{elObj[treeTabs[1]]}
{treeTabs.length === 3 && elObj[treeTabs[2]]}
Expand Down
6 changes: 4 additions & 2 deletions src/components/shared/StyledSplitPane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ export default styled(SplitPane)`
border-color: transparent;
}
.Pane {
overflow: hidden;
overflow: ${(props) =>
props.overflowPane1 === 'auto' ? 'auto' : 'hidden'};
}
.Pane2 {
overflow: ${(props) => (props.overflow === 'auto' ? 'auto' : 'hidden')};
overflow: ${(props) =>
props.overflowPane2 === 'auto' ? 'auto' : 'hidden'};
}
`

0 comments on commit 17ed583

Please sign in to comment.