mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-07-01 04:33:23 +05:30
31 lines
814 B
TypeScript
31 lines
814 B
TypeScript
import React from 'react';
|
||
import { defineMessages } from 'react-intl';
|
||
|
||
import { Input } from 'app/components/ui/form';
|
||
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
|
||
import { User } from 'app/components/user/reducer';
|
||
|
||
const messages = defineMessages({
|
||
emailOrUsername: 'E‑mail or username',
|
||
});
|
||
|
||
export default class LoginBody extends BaseAuthBody {
|
||
static displayName = 'LoginBody';
|
||
static panelId = 'login';
|
||
static hasGoBack = (state: { user: User }) => {
|
||
return !state.user.isGuest;
|
||
};
|
||
|
||
autoFocusField = 'login';
|
||
|
||
render() {
|
||
return (
|
||
<div>
|
||
{this.renderErrors()}
|
||
|
||
<Input {...this.bindField('login')} icon="envelope" required placeholder={messages.emailOrUsername} />
|
||
</div>
|
||
);
|
||
}
|
||
}
|