Commit 55b6eef9 authored by afc163's avatar afc163

Add screen reponsive className

parent 76f9865b
......@@ -6,6 +6,8 @@ import { connect } from 'dva';
import { Link, routerRedux, Route, Redirect, Switch } from 'dva/router';
import moment from 'moment';
import groupBy from 'lodash/groupBy';
import { ContainerQuery } from 'react-container-query';
import classNames from 'classnames';
import styles from './BasicLayout.less';
import HeaderSearch from '../components/HeaderSearch';
import NoticeIcon from '../components/NoticeIcon';
......@@ -16,6 +18,27 @@ import { getRouteData } from '../utils/utils';
const { Header, Sider, Content } = Layout;
const { SubMenu } = Menu;
const query = {
'screen-xs': {
maxWidth: 575,
},
'screen-sm': {
minWidth: 576,
maxWidth: 767,
},
'screen-md': {
minWidth: 768,
maxWidth: 991,
},
'screen-lg': {
minWidth: 992,
maxWidth: 1199,
},
'screen-xl': {
minWidth: 1200,
},
};
class BasicLayout extends React.PureComponent {
static childContextTypes = {
location: PropTypes.object,
......@@ -211,8 +234,7 @@ class BasicLayout extends React.PureComponent {
openKeys: this.state.openKeys,
};
return (
<DocumentTitle title={this.getPageTitle()}>
const layout = (
<Layout>
<Sider
trigger={null}
......@@ -339,6 +361,13 @@ class BasicLayout extends React.PureComponent {
</Content>
</Layout>
</Layout>
);
return (
<DocumentTitle title={this.getPageTitle()}>
<ContainerQuery query={query}>
{params => <div className={classNames(params)}>{layout}</div>}
</ContainerQuery>
</DocumentTitle>
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment