fix: improve login form styles

This commit is contained in:
chenos 2021-04-08 12:10:38 +08:00
parent 58e2ac3f5c
commit 5319000bd6
5 changed files with 48 additions and 46 deletions

View File

@ -84,7 +84,7 @@ export function Login(props: any) {
placeholder: '密码', placeholder: '密码',
}, },
'x-props': { 'x-props': {
help: <Link to={'/lostpassword'}></Link>, help: <Link style={{float: 'right', marginBottom: 12}} to={'/lostpassword'}></Link>,
}, },
}, },
...(props.fields || {}), ...(props.fields || {}),
@ -92,15 +92,14 @@ export function Login(props: any) {
}} }}
> >
<FormButtonGroup> <FormButtonGroup>
<Submit size={'large'}></Submit> <Submit block size={'large'}></Submit>
<Button <div style={{
size={'large'} marginTop: 12,
onClick={() => { display: 'flex',
history.push('/register'); justifyContent: 'space-between',
}} }}>
> <Link to={'/register'}></Link>
</div>
</Button>
</FormButtonGroup> </FormButtonGroup>
</SchemaForm> </SchemaForm>
</div> </div>

View File

@ -66,15 +66,14 @@ export function LostPassword(props: any) {
}} }}
> >
<FormButtonGroup> <FormButtonGroup>
<Submit size={'large'}></Submit> <Submit block size={'large'}></Submit>
<Button <div style={{
size={'large'} marginTop: 12,
onClick={() => { display: 'flex',
history.push('/login'); justifyContent: 'space-between',
}} }}>
> <Link to={'/login'}>使</Link>
使 </div>
</Button>
</FormButtonGroup> </FormButtonGroup>
</SchemaForm> </SchemaForm>
</div> </div>

View File

@ -98,14 +98,14 @@ export function Register(props: any) {
placeholder: '邮箱', placeholder: '邮箱',
}, },
}, },
nickname: { // nickname: {
type: 'string', // type: 'string',
title: '', // title: '',
'x-component-props': { // 'x-component-props': {
size: 'large', // size: 'large',
placeholder: '昵称', // placeholder: '昵称',
}, // },
}, // },
password: { password: {
type: 'password', type: 'password',
title: '', title: '',
@ -135,15 +135,14 @@ export function Register(props: any) {
}} }}
> >
<FormButtonGroup align={'start'}> <FormButtonGroup align={'start'}>
<Submit size={'large'}></Submit> <Submit block size={'large'}></Submit>
<Button <div style={{
size={'large'} marginTop: 12,
onClick={() => { display: 'flex',
history.push('/login'); justifyContent: 'space-between',
}} }}>
> <Link to={'/login'}>使</Link>
使 </div>
</Button>
</FormButtonGroup> </FormButtonGroup>
</SchemaForm> </SchemaForm>
</div> </div>

View File

@ -16,7 +16,7 @@ import {
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { Redirect, history, request, useModel, useHistory } from 'umi'; import { Redirect, history, request, useModel, useHistory } from 'umi';
import api from '@/api-client'; import api from '@/api-client';
import { useRequest } from 'umi'; import { useRequest, Link } from 'umi';
const { onFieldValueChange$ } = FormEffectHooks; const { onFieldValueChange$ } = FormEffectHooks;
@ -149,15 +149,14 @@ export function ResetPassword(props: any) {
}} }}
> >
<FormButtonGroup align={'start'}> <FormButtonGroup align={'start'}>
<Submit size={'large'}></Submit> <Submit block size={'large'}></Submit>
<Button <div style={{
size={'large'} marginTop: 12,
onClick={() => { display: 'flex',
history.push('/login'); justifyContent: 'space-between',
}} }}>
> <Link to={'/login'}>使</Link>
使 </div>
</Button>
</FormButtonGroup> </FormButtonGroup>
</SchemaForm> </SchemaForm>
</div> </div>

View File

@ -92,6 +92,12 @@ body.collapsed {
.users-form { .users-form {
.button-group { .button-group {
justify-content: flex-start; justify-content: flex-start;
.ant-row {
width: 100%;
}
.ant-col.inline {
width: 100%;
}
} }
} }