Skip to content

Commit

Permalink
ProblemTabEditor : put the problem chooser above the editor
Browse files Browse the repository at this point in the history
No dedicated statement panel.
  • Loading branch information
minhducsun2002 committed Mar 24, 2019
1 parent 48b0ea2 commit 13466d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
7 changes: 1 addition & 6 deletions src/app/problemList/problemTab/problemTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,11 @@ class ProblemTab extends React.PureComponent {
indicatorColor="primary"
textColor="primary"
scrollable
scrollButtons="auto"
>
scrollButtons="auto">
{this.props.problems.map((x,index) => (
<Tab label={x} key={index}/>
))}
</Tabs>
<TabContainer>
{this.props.problems[this.props.value]
? this.props.problems[this.props.value].statement : ''}
</TabContainer>
</AppBar>
</div>
)
Expand Down
26 changes: 10 additions & 16 deletions src/app/problemList/problemTabEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,16 @@ class ProblemTabEditor extends React.Component {
}
render() {
return (
<div style={{ marginTop: 10 }}>
<Grid container spacing={8} alignItems="stretch" style={{ width: '100%' }}>
<Grid item style={{ width: '50%' }}>
<ProblemTab
problems={this.props.problems}
handleTabChange={this.handleTabChange}
value={this.state.currentTab} />
</Grid>
<Grid item style={{ width: '50%' }}>
<CodeBox
submitFileName={this.props.problems[this.state.currentTab] || ''}
ext={this.props.ext}
displayLang={this.props.ext.map(string => parseEXT(string))}
/>
</Grid>
</Grid>
<div>
<ProblemTab
problems={this.props.problems}
handleTabChange={this.handleTabChange}
value={this.state.currentTab} />
<CodeBox
submitFileName={this.props.problems[this.state.currentTab] || ''}
ext={this.props.ext}
displayLang={this.props.ext.map(string => parseEXT(string))}
/>
</div>
)
}
Expand Down

0 comments on commit 13466d0

Please sign in to comment.