From 6afd6bd152a2516764658a47b8505fefbb98571b Mon Sep 17 00:00:00 2001 From: Ken Wheeler Date: Tue, 22 Aug 2017 09:11:42 -0400 Subject: [PATCH] fixing absurd layout --- app/components/Box.js | 3 +- app/components/Container.js | 5 +- app/components/DoubleBox.js | 6 +- app/components/Row.js | 1 + app/containers/Body.js | 192 +++++------------------------------- 5 files changed, 37 insertions(+), 170 deletions(-) diff --git a/app/components/Box.js b/app/components/Box.js index 2c921d9..7a0dca4 100644 --- a/app/components/Box.js +++ b/app/components/Box.js @@ -5,7 +5,8 @@ const zoomInAnimation = keyframes`${zoomIn}`; export default styled.div` background: #2a2e3b; - flex: 1 1 0; + flex: ${({ size }) => (size === 'small' ? '1 1 100%' : '1 1 0')}; + height: ${({ size }) => (size === 'small' ? '350px' : '')}; margin: 6px; padding: 30px; animation: 500ms ${zoomInAnimation}; diff --git a/app/components/Container.js b/app/components/Container.js index 235ce96..0ddec45 100644 --- a/app/components/Container.js +++ b/app/components/Container.js @@ -1,10 +1,11 @@ import styled from 'styled-components'; export default styled.div` - background: #1D212D; + background: #1d212d; display: flex; - flex-direction: column; + flex-direction: ${({ size }) => (size === 'small' ? 'row' : 'column')}; flex: 1; padding: 40px; flex-wrap: wrap; + overflow: scroll; `; diff --git a/app/components/DoubleBox.js b/app/components/DoubleBox.js index e6bc399..fa233da 100644 --- a/app/components/DoubleBox.js +++ b/app/components/DoubleBox.js @@ -6,7 +6,11 @@ const zoomInAnimation = keyframes`${zoomIn}`; export default styled.div` background: #2a2e3b; display: flex; - flex: 2 1 132px; + flex: ${({ size }) => + size === 'large' + ? '2 1 132px' + : size === 'small' ? '1 1 100%' : '1 1 60px'}; + height: ${({ size }) => (size === 'small' ? '350px' : '')}; margin: 6px; word-wrap: break-word; overflow: auto; diff --git a/app/components/Row.js b/app/components/Row.js index 7802691..1786206 100644 --- a/app/components/Row.js +++ b/app/components/Row.js @@ -4,4 +4,5 @@ export default styled.div` display: flex; flex: 1; justify-content: space-around; + flex-direction: ${({ size }) => (size === 'small' ? 'column' : 'row')}; `; diff --git a/app/containers/Body.js b/app/containers/Body.js index 1352044..2d69e65 100644 --- a/app/containers/Body.js +++ b/app/containers/Body.js @@ -92,10 +92,8 @@ class Body extends React.PureComponent { shell.openExternal('http://www.formidable.com'); }; render() { - if (this.props.vizActive) { - console.log(this.state); - return ( - + return this.props.vizActive + ? - ); - } - switch (this.state.breakpoint) { - case 'large': - return ( - - - - - - - - - - - - Modules - - - - Assets - - - - Problems - - - - - Artisanally hand-crafted at{' '} - - Formidable - - - - - ); - case 'medium': - return ( - - - - - - - - - - - - Modules - - - - Assets - - - - Problems - - - - - Artisanally hand-crafted at{' '} - - Formidable - - - - - ); - default: - return ( - - + : + + - - + + - + + + Modules - + Assets - + Problems - + + Artisanally hand-crafted at{' '} + - Artisanally hand-crafted at{' '} - - Formidable - - - - - ); - } + Formidable + + + + ; } } export default Body;