Skip to content

Commit

Permalink
fix: fix menu layout bug on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
yezihaohao committed Sep 6, 2020
1 parent e89c0fc commit 378e02f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HeaderCustom from './components/HeaderCustom';
import { ThemePicker, Copyright } from './components/widget';
import { checkLogin } from './utils';
import { fetchMenu } from './service';
import classNames from 'classnames';

const { Content, Footer } = Layout;

Expand Down Expand Up @@ -116,7 +117,9 @@ const App = (props: AppProps) => {
<SiderCustom collapsed={collapsed} />
)}
<ThemePicker />
<Layout className="app_layout">
<Layout
className={classNames('app_layout', { 'app_layout-mobile': responsive.isMobile })}
>
<HeaderCustom toggle={toggle} collapsed={collapsed} user={auth || {}} />
<Content className="app_layout_content">
<Routes auth={auth} />
Expand Down
13 changes: 12 additions & 1 deletion src/style/antd/layout.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
.ant-layout-content {
min-height: auto;
}
}

.ant-layout {
&.ant-layout-has-sider {
&.app_layout-mobile {
flex-direction: column;
.ant-layout-content {
margin: 0;
}
}
}
}

0 comments on commit 378e02f

Please sign in to comment.