diff --git a/package.json b/package.json index faa1a45f76a0eba89b1860cab7519267c27c32d2..52450c13292dbd279653668bdf896809150cd0a4 100755 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "jest": "^21.0.1", "lint-staged": "^4.3.0", "mockjs": "^1.0.1-beta3", + "react-container-query": "^0.9.1", "react-test-renderer": "^16.0.0", "redbox-react": "^1.3.2", "roadhog": "^1.2.1", diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 6860d19fbc932cd237d2871a051499f7f19951f0..dde4c99634a4767f949463ca3d0fd043e10570fc 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -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,134 +234,140 @@ class BasicLayout extends React.PureComponent { openKeys: this.state.openKeys, }; - return ( - - - + +
+ + logo +

Ant Design Pro

+ +
+ -
- - logo -

Ant Design Pro

- -
- - {this.getNavMenuItems(this.menus)} - - - -
- + + +
+ +
+ { + console.log('input', value); // eslint-disable-line + }} + onPressEnter={(value) => { + console.log('enter', value); // eslint-disable-line + }} /> -
- { - console.log('input', value); // eslint-disable-line - }} - onPressEnter={(value) => { - console.log('enter', value); // eslint-disable-line - }} + { + console.log(item, tabProps); // eslint-disable-line + }} + onClear={this.handleNoticeClear} + onPopupVisibleChange={this.handleNoticeVisibleChange} + loading={fetchingNotices} + popupAlign={{ offset: [20, -16] }} + > + + - { - console.log(item, tabProps); // eslint-disable-line - }} - onClear={this.handleNoticeClear} - onPopupVisibleChange={this.handleNoticeVisibleChange} - loading={fetchingNotices} - popupAlign={{ offset: [20, -16] }} - > - - - - - {currentUser.name ? ( - - - - {currentUser.name} - - - ) : } -
-
- - - { - getRouteData('BasicLayout').map(item => - ( - - ) + + + {currentUser.name ? ( + + + + {currentUser.name} + + + ) : } + +
+ + + { + getRouteData('BasicLayout').map(item => + ( + ) - } - - - - Copyright 2017 蚂蚁金服体验技术部出品 - - } - /> - -
+ ) + } + + + + Copyright 2017 蚂蚁金服体验技术部出品 + + } + /> + + + ); + + return ( + + + {params =>
{layout}
} +
); }