fix: move ActionRow outside the ReflexContainer (#43532)

* fix: move ActionRow outside the ReflexContainer

It does not need to be resizable.

* fix: make DesktopLayout aware of ActionRow

The ReflexContainer seems to need to be inside a display: flex component
to correctly compute the sizes of it's children.

* refactor: remove unused props
This commit is contained in:
Oliver Eyton-Williams
2021-09-27 12:16:29 +02:00
committed by GitHub
parent 2b6bef08ae
commit 0f32cabef9
3 changed files with 60 additions and 64 deletions

View File

@ -1,4 +1,6 @@
#learn-app-wrapper .desktop-layout { #learn-app-wrapper .desktop-layout {
display: flex;
flex-direction: column;
height: calc( height: calc(
100vh - var(--header-height, 0px) - var(--flash-message-height, 0px) 100vh - var(--header-height, 0px) - var(--flash-message-height, 0px)
); );

View File

@ -37,9 +37,7 @@ const propTypes = {
}; };
const reflexProps = { const reflexProps = {
propagateDimensions: true, propagateDimensions: true
renderOnResize: true,
renderOnResizeRate: 20
}; };
class DesktopLayout extends Component { class DesktopLayout extends Component {
@ -88,7 +86,7 @@ class DesktopLayout extends Component {
layoutState; layoutState;
return ( return (
<ReflexContainer className='desktop-layout' orientation='horizontal'> <div className='desktop-layout'>
{projectBasedChallenge && ( {projectBasedChallenge && (
<ActionRow <ActionRow
block={block} block={block}
@ -97,7 +95,6 @@ class DesktopLayout extends Component {
superBlock={superBlock} superBlock={superBlock}
/> />
)} )}
<ReflexElement flex={8} {...reflexProps} {...resizeProps}>
<ReflexContainer orientation='vertical'> <ReflexContainer orientation='vertical'>
{!projectBasedChallenge && ( {!projectBasedChallenge && (
<ReflexElement <ReflexElement
@ -117,9 +114,9 @@ class DesktopLayout extends Component {
name='editorPane' name='editorPane'
{...resizeProps} {...resizeProps}
> >
{challengeFile && {challengeFile && showUpcomingChanges && !hasEditableBoundries && (
showUpcomingChanges && <EditorTabs />
!hasEditableBoundries && <EditorTabs />} )}
{challengeFile && ( {challengeFile && (
<ReflexContainer <ReflexContainer
key={challengeFile.fileKey} key={challengeFile.fileKey}
@ -162,8 +159,7 @@ class DesktopLayout extends Component {
</ReflexElement> </ReflexElement>
)} )}
</ReflexContainer> </ReflexContainer>
</ReflexElement> </div>
</ReflexContainer>
); );
} }
} }

View File

@ -98,9 +98,7 @@ class MultifileEditor extends Component {
// editors.map(props => <EditorWrapper ...props>).join(<ReflexSplitter>) // editors.map(props => <EditorWrapper ...props>).join(<ReflexSplitter>)
// ...probably! As long as we can put keys in the right places. // ...probably! As long as we can put keys in the right places.
const reflexProps = { const reflexProps = {
propagateDimensions: true, propagateDimensions: true
renderOnResize: true,
renderOnResizeRate: 20
}; };
let splitterJSXRight, splitterHTMLRight, splitterCSSRight; let splitterJSXRight, splitterHTMLRight, splitterCSSRight;