refactor: DRY out DesktopLayout
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
3ea251383f
commit
2e7a2424c1
@ -17,6 +17,12 @@ const propTypes = {
|
||||
testOutput: PropTypes.element
|
||||
};
|
||||
|
||||
const reflexProps = {
|
||||
propagateDimensions: true,
|
||||
renderOnResize: true,
|
||||
renderOnResizeRate: 20
|
||||
};
|
||||
|
||||
class DesktopLayout extends Component {
|
||||
render() {
|
||||
const {
|
||||
@ -37,23 +43,11 @@ class DesktopLayout extends Component {
|
||||
<ReflexElement flex={1} {...resizeProps}>
|
||||
{challengeFile && (
|
||||
<ReflexContainer key={challengeFile.key} orientation='horizontal'>
|
||||
<ReflexElement
|
||||
flex={1}
|
||||
propagateDimensions={true}
|
||||
renderOnResize={true}
|
||||
renderOnResizeRate={20}
|
||||
{...resizeProps}
|
||||
>
|
||||
<ReflexElement flex={1} {...reflexProps} {...resizeProps}>
|
||||
{editor}
|
||||
</ReflexElement>
|
||||
<ReflexSplitter propagate={true} {...resizeProps} />
|
||||
<ReflexElement
|
||||
flex={0.25}
|
||||
propagateDimensions={true}
|
||||
renderOnResize={true}
|
||||
renderOnResizeRate={20}
|
||||
{...resizeProps}
|
||||
>
|
||||
<ReflexElement flex={0.25} {...reflexProps} {...resizeProps}>
|
||||
{testOutput}
|
||||
</ReflexElement>
|
||||
</ReflexContainer>
|
||||
|
Reference in New Issue
Block a user