Fix layout default sizes

This commit is contained in:
Thomas Nordquist
2019-06-18 14:48:52 +02:00
parent 9ed8a3b91e
commit d7bb4bb55f

View File

@@ -18,7 +18,7 @@ interface Props {
function ContentView(props: Props) { function ContentView(props: Props) {
const [height, setHeight] = React.useState<string | number>('100%') const [height, setHeight] = React.useState<string | number>('100%')
const [sidebarWidth, setSidebarWidth] = React.useState<string | number>(500) const [sidebarWidth, setSidebarWidth] = React.useState<string | number>('40%')
const [detectedHeight, setDetectedHeight] = React.useState(0) const [detectedHeight, setDetectedHeight] = React.useState(0)
const [detectedSidebarWidth, setDetectedSidebarWidth] = React.useState(0) const [detectedSidebarWidth, setDetectedSidebarWidth] = React.useState(0)
const detectSize = React.useCallback((width, newHeight) => { const detectSize = React.useCallback((width, newHeight) => {
@@ -65,7 +65,6 @@ function ContentView(props: Props) {
size={sidebarWidth} size={sidebarWidth}
onChange={setSidebarWidth} onChange={setSidebarWidth}
onDragFinished={closeSidebarCompletelyIfItSitsOnTheEdge} onDragFinished={closeSidebarCompletelyIfItSitsOnTheEdge}
defaultSize={500}
allowResize={true} allowResize={true}
style={{ height: '100%' }} style={{ height: '100%' }}
pane1Style={{ overflowX: 'hidden' }} pane1Style={{ overflowX: 'hidden' }}
@@ -77,7 +76,6 @@ function ContentView(props: Props) {
split="horizontal" split="horizontal"
minSize={0} minSize={0}
size={height} size={height}
defaultSize={'100%'}
allowResize={true} allowResize={true}
style={{ height: 'calc(100vh - 64px)' }} style={{ height: 'calc(100vh - 64px)' }}
pane1Style={{ maxHeight: '100%' }} pane1Style={{ maxHeight: '100%' }}