From d81f5b62672bb5d838493be4808f343fb7b9f5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Cederstr=C3=B6m?= Date: Wed, 17 Jan 2018 17:11:39 +0100 Subject: [PATCH] move background on login page to correct position on large screens (#665) * move background on login page to correct position on large screens * promote antd layout and content - tweak mobile styles * simplify width in login and register page --- src/components/Login/index.js | 2 +- src/components/Login/index.less | 4 +- src/index.less | 4 ++ src/layouts/BasicLayout.js | 90 ++++++++++++++++----------------- src/layouts/UserLayout.js | 44 ++++++++-------- src/layouts/UserLayout.less | 34 ++++++++----- 6 files changed, 93 insertions(+), 85 deletions(-) diff --git a/src/components/Login/index.js b/src/components/Login/index.js index 0f304c5b..5e3a8a86 100644 --- a/src/components/Login/index.js +++ b/src/components/Login/index.js @@ -89,7 +89,7 @@ class Login extends Component { } }); return ( -
+
{ tabs.length ? ( diff --git a/src/components/Login/index.less b/src/components/Login/index.less index 4f1f2268..331ed5a6 100644 --- a/src/components/Login/index.less +++ b/src/components/Login/index.less @@ -1,8 +1,6 @@ @import "~antd/lib/style/themes/default.less"; -.main { - width: 368px; - margin: 0 auto; +.login { .tabs { padding: 0 2px; diff --git a/src/index.less b/src/index.less index 98651b12..5cfe914a 100644 --- a/src/index.less +++ b/src/index.less @@ -4,6 +4,10 @@ body, height: 100%; } +:global(.ant-layout) { + min-height: 100%; +} + canvas { display: block; } diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js index 59b254cf..58484803 100644 --- a/src/layouts/BasicLayout.js +++ b/src/layouts/BasicLayout.js @@ -177,55 +177,53 @@ class BasicLayout extends React.PureComponent { onNoticeVisibleChange={this.handleNoticeVisibleChange} /> -
- - { - redirectData.map(item => - - ) - } - { - getRoutes(match.path, routerData).map(item => - ( - - ) + + { + redirectData.map(item => + + ) + } + { + getRoutes(match.path, routerData).map(item => + ( + ) - } - - - -
- , - href: 'https://github.com/ant-design/ant-design-pro', - blankTarget: true, - }, { - key: 'Ant Design', - title: 'Ant Design', - href: 'http://ant.design', - blankTarget: true, - }]} - copyright={ -
- Copyright 2018 蚂蚁金服体验技术部出品 -
+ ) } - /> + + +
+ , + href: 'https://github.com/ant-design/ant-design-pro', + blankTarget: true, + }, { + key: 'Ant Design', + title: 'Ant Design', + href: 'http://ant.design', + blankTarget: true, + }]} + copyright={ +
+ Copyright 2018 蚂蚁金服体验技术部出品 +
+ } + /> ); diff --git a/src/layouts/UserLayout.js b/src/layouts/UserLayout.js index 01228a51..946fc953 100644 --- a/src/layouts/UserLayout.js +++ b/src/layouts/UserLayout.js @@ -38,29 +38,31 @@ class UserLayout extends React.PureComponent { return (
-
-
- - logo - Ant Design - +
+
+
+ + logo + Ant Design + +
+
Ant Design 是西湖区最具影响力的 Web 设计规范
-
Ant Design 是西湖区最具影响力的 Web 设计规范
+ + {getRoutes(match.path, routerData).map(item => + ( + + ) + )} + +
- - {getRoutes(match.path, routerData).map(item => - ( - - ) - )} - - - +
); diff --git a/src/layouts/UserLayout.less b/src/layouts/UserLayout.less index 983c2bce..c93cf779 100644 --- a/src/layouts/UserLayout.less +++ b/src/layouts/UserLayout.less @@ -1,15 +1,27 @@ @import "~antd/lib/style/themes/default.less"; .container { - background: #f0f2f5; - background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); - width: 100%; + display: flex; + flex-direction: column; min-height: 100%; - background-repeat: no-repeat; - background-position: center; - background-size: 100%; - padding: 110px 0 144px 0; - position: relative; +} + +.content { + padding: 32px 0; + flex: 1; +} + +@media (min-width: @screen-md-min) { + .container { + background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); + background-repeat: no-repeat; + background-position: center 110px; + background-size: 100%; + } + + .content { + padding: 112px 0 24px 0; + } } .top { @@ -45,9 +57,3 @@ margin-top: 12px; margin-bottom: 40px; } - -.footer { - position: absolute; - width: 100%; - bottom: 0; -} -- GitLab