css: align MainContent

This commit is contained in:
Benjy Cui 2016-03-07 14:22:30 +08:00
parent ba9ec11079
commit b022d79bd0
2 changed files with 33 additions and 16 deletions

View File

@ -11,9 +11,11 @@
.main-container {
padding: 0 40px 120px;
margin-left: -1px;
background: #fff;
min-height: 500px;
overflow: hidden;
border-left: 1px solid #e9e9e9;
}
.sidebar {

View File

@ -113,22 +113,37 @@ export default class MainContent extends React.Component {
const { prev, next } = this.getFooterNav(menuItems, activeMenuItem);
return (
<Row className="main-wrapper">
<Col span="4">
<Menu className="sidebar" mode="inline"
defaultOpenKeys={Object.keys(this.props.menuItems)}
selectedKeys={[activeMenuItem]}>
{ menuItems }
</Menu>
</Col>
<Col span="20" className="main-container">
{ this.props.children }
<section className="prev-next-nav">
{ !!prev ? React.cloneElement(prev.props.children, { className: 'prev-page' }) : null }
{ !!next ? React.cloneElement(next.props.children, { className: 'next-page' }) : null }
</section>
</Col>
</Row>
<div className="main-wrapper">
<Row>
<Col span="4">
<Menu className="sidebar" mode="inline"
defaultOpenKeys={Object.keys(this.props.menuItems)}
selectedKeys={[activeMenuItem]}>
{ menuItems }
</Menu>
</Col>
<Col span="20" className="main-container">
{ this.props.children }
</Col>
</Row>
<Row>
<Col span="20" offset="4">
<section className="prev-next-nav">
{
!!prev ?
React.cloneElement(prev.props.children, { className: 'prev-page' }) :
null
}
{
!!next ?
React.cloneElement(next.props.children, { className: 'next-page' }) :
null
}
</section>
</Col>
</Row>
</div>
);
}
}