Skip to content

Commit

Permalink
📝 Fix site responsive interaction, close ant-design#13954
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Dec 27, 2018
1 parent 90091fe commit 5900b6a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
12 changes: 12 additions & 0 deletions site/theme/static/responsive.less
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
}
}

@media only screen and (max-width: 991.99px) {
.main-menu {
> div > .ant-affix {
position: static !important;
}
.main-menu-inner {
overflow: hidden;
max-height: none;
}
}
}

@media only screen and (max-width: 767.99px) {
#header {
text-align: center;
Expand Down
4 changes: 2 additions & 2 deletions site/theme/template/Content/MainContent.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Link } from 'bisheng/router';
import { Row, Col, Menu, Icon, Affix } from 'antd';
Expand Down Expand Up @@ -55,7 +55,7 @@ const getSideBarOpenKeys = nextProps => {
return shouldOpenKeys;
};

export default class MainContent extends React.PureComponent {
export default class MainContent extends Component {
static contextTypes = {
intl: PropTypes.object.isRequired,
isMobile: PropTypes.bool.isRequired,
Expand Down
18 changes: 8 additions & 10 deletions site/theme/template/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,14 @@ export default class Layout extends React.Component {
const { appLocale } = this.state;

return (
<React.StrictMode>
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<LocaleProvider locale={appLocale.locale === 'zh-CN' ? zhCN : null}>
<div className="page-wrapper">
<Header {...restProps} />
{children}
</div>
</LocaleProvider>
</IntlProvider>
</React.StrictMode>
<IntlProvider locale={appLocale.locale} messages={appLocale.messages}>
<LocaleProvider locale={appLocale.locale === 'zh-CN' ? zhCN : null}>
<div className="page-wrapper">
<Header {...restProps} />
{children}
</div>
</LocaleProvider>
</IntlProvider>
);
}
}

0 comments on commit 5900b6a

Please sign in to comment.