yapi-next/vendors/client/containers/Login/LoginWrap.js
2023-06-25 19:08:56 +08:00

44 lines
1.2 KiB
JavaScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React, { PureComponent as Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Tabs } from 'antd';
import LoginForm from './Login';
import RegForm from './Reg';
import './Login.scss';
const TabPane = Tabs.TabPane;
@connect(state => ({
loginWrapActiveKey: state.user.loginWrapActiveKey,
canRegister: state.user.canRegister
}))
export default class LoginWrap extends Component {
constructor(props) {
super(props);
}
static propTypes = {
form: PropTypes.object,
loginWrapActiveKey: PropTypes.string,
canRegister: PropTypes.bool
};
render() {
const { loginWrapActiveKey, canRegister } = this.props;
{/** show only login when register is disabled */}
return (
<Tabs
defaultActiveKey={loginWrapActiveKey}
className="login-form"
tabBarStyle={{ border: 'none' }}
>
<TabPane tab="登录" key="1">
<LoginForm />
</TabPane>
<TabPane tab={"注册"} key="2">
{canRegister ? <RegForm /> : <div style={{minHeight: 200}}>管理员已禁止注册请联系管理员</div>}
</TabPane>
</Tabs>
);
}
}