Commit d81f5b62 authored by Andreas Cederström's avatar Andreas Cederström Committed by ddcat1115

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
parent 03e3a2dd
...@@ -89,7 +89,7 @@ class Login extends Component { ...@@ -89,7 +89,7 @@ class Login extends Component {
} }
}); });
return ( return (
<div className={classNames(className, styles.main)}> <div className={classNames(className, styles.login)}>
<Form onSubmit={this.handleSubmit}> <Form onSubmit={this.handleSubmit}>
{ {
tabs.length ? ( tabs.length ? (
......
@import "~antd/lib/style/themes/default.less"; @import "~antd/lib/style/themes/default.less";
.main { .login {
width: 368px;
margin: 0 auto;
.tabs { .tabs {
padding: 0 2px; padding: 0 2px;
......
...@@ -4,6 +4,10 @@ body, ...@@ -4,6 +4,10 @@ body,
height: 100%; height: 100%;
} }
:global(.ant-layout) {
min-height: 100%;
}
canvas { canvas {
display: block; display: block;
} }
......
...@@ -177,55 +177,53 @@ class BasicLayout extends React.PureComponent { ...@@ -177,55 +177,53 @@ class BasicLayout extends React.PureComponent {
onNoticeVisibleChange={this.handleNoticeVisibleChange} onNoticeVisibleChange={this.handleNoticeVisibleChange}
/> />
<Content style={{ margin: '24px 24px 0', height: '100%' }}> <Content style={{ margin: '24px 24px 0', height: '100%' }}>
<div style={{ minHeight: 'calc(100vh - 260px)' }}> <Switch>
<Switch> {
{ redirectData.map(item =>
redirectData.map(item => <Redirect key={item.from} exact from={item.from} to={item.to} />
<Redirect key={item.from} exact from={item.from} to={item.to} /> )
) }
} {
{ getRoutes(match.path, routerData).map(item =>
getRoutes(match.path, routerData).map(item => (
( <AuthorizedRoute
<AuthorizedRoute key={item.key}
key={item.key} path={item.path}
path={item.path} component={item.component}
component={item.component} exact={item.exact}
exact={item.exact} authority={item.authority}
authority={item.authority} redirectPath="/exception/403"
redirectPath="/exception/403" />
/>
)
) )
} )
<Redirect exact from="/" to={bashRedirect} />
<Route render={NotFound} />
</Switch>
</div>
<GlobalFooter
links={[{
key: 'Pro 首页',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
}, {
key: 'github',
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
}, {
key: 'Ant Design',
title: 'Ant Design',
href: 'http://ant.design',
blankTarget: true,
}]}
copyright={
<div>
Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
</div>
} }
/> <Redirect exact from="/" to={bashRedirect} />
<Route render={NotFound} />
</Switch>
</Content> </Content>
<GlobalFooter
links={[{
key: 'Pro 首页',
title: 'Pro 首页',
href: 'http://pro.ant.design',
blankTarget: true,
}, {
key: 'github',
title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true,
}, {
key: 'Ant Design',
title: 'Ant Design',
href: 'http://ant.design',
blankTarget: true,
}]}
copyright={
<div>
Copyright <Icon type="copyright" /> 2018 蚂蚁金服体验技术部出品
</div>
}
/>
</Layout> </Layout>
</Layout> </Layout>
); );
......
...@@ -38,29 +38,31 @@ class UserLayout extends React.PureComponent { ...@@ -38,29 +38,31 @@ class UserLayout extends React.PureComponent {
return ( return (
<DocumentTitle title={this.getPageTitle()}> <DocumentTitle title={this.getPageTitle()}>
<div className={styles.container}> <div className={styles.container}>
<div className={styles.top}> <div className={styles.content}>
<div className={styles.header}> <div className={styles.top}>
<Link to="/"> <div className={styles.header}>
<img alt="logo" className={styles.logo} src={logo} /> <Link to="/">
<span className={styles.title}>Ant Design</span> <img alt="logo" className={styles.logo} src={logo} />
</Link> <span className={styles.title}>Ant Design</span>
</Link>
</div>
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
</div> </div>
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div> <Switch>
{getRoutes(match.path, routerData).map(item =>
(
<Route
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
/>
)
)}
<Redirect exact from="/user" to="/user/login" />
</Switch>
</div> </div>
<Switch> <GlobalFooter links={links} copyright={copyright} />
{getRoutes(match.path, routerData).map(item =>
(
<Route
key={item.key}
path={item.path}
component={item.component}
exact={item.exact}
/>
)
)}
<Redirect exact from="/user" to="/user/login" />
</Switch>
<GlobalFooter className={styles.footer} links={links} copyright={copyright} />
</div> </div>
</DocumentTitle> </DocumentTitle>
); );
......
@import "~antd/lib/style/themes/default.less"; @import "~antd/lib/style/themes/default.less";
.container { .container {
background: #f0f2f5; display: flex;
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); flex-direction: column;
width: 100%;
min-height: 100%; min-height: 100%;
background-repeat: no-repeat; }
background-position: center;
background-size: 100%; .content {
padding: 110px 0 144px 0; padding: 32px 0;
position: relative; 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 { .top {
...@@ -45,9 +57,3 @@ ...@@ -45,9 +57,3 @@
margin-top: 12px; margin-top: 12px;
margin-bottom: 40px; margin-bottom: 40px;
} }
.footer {
position: absolute;
width: 100%;
bottom: 0;
}
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