accounts-frontend/packages/app/components/auth/login/LoginBody.tsx

31 lines
814 B
TypeScript
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 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: 'Email 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>
);
}
}