Fix labels on auth forms

This commit is contained in:
ErickSkrauch 2020-07-24 19:19:11 +03:00
parent 208817f69e
commit 108e5eb0e9
No known key found for this signature in database
GPG Key ID: 669339FCBB30EE0E
12 changed files with 47 additions and 40 deletions

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './AcceptRulesBody';
const messages = defineMessages({
title: 'User Agreement',
accept: 'Accept',
declineAndLogout: 'Decline and logout',
});
@ -14,7 +15,7 @@ export default factory({
footer: {
color: 'darkBlue',
autoFocus: true,
label: messages.accept,
children: <Message key="accept" defaultMessage="Accept" />,
},
links: {
label: messages.declineAndLogout,

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './ActivationBody';
const messages = defineMessages({
accountActivationTitle: 'Account activation',
confirmEmail: 'Confirm Email',
didNotReceivedEmail: 'Did not received Email?',
});
@ -13,7 +14,7 @@ export default factory({
body: Body,
footer: {
color: 'blue',
label: messages.confirmEmail,
children: <Message key="confirmEmail" defaultMessage="Confirm Email" />,
},
links: {
label: messages.didNotReceivedEmail,

View File

@ -1,10 +1,10 @@
import { defineMessages } from 'react-intl';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './ChooseAccountBody';
const messages = defineMessages({
chooseAccountTitle: 'Choose an account',
addAccount: 'Log into another account',
logoutAll: 'Log out from all accounts',
});
@ -12,7 +12,7 @@ export default factory({
title: messages.chooseAccountTitle,
body: Body,
footer: {
label: messages.addAccount,
children: <Message key="addAccount" defaultMessage="Log into another account" />,
},
links: [
{

View File

@ -1,9 +1,10 @@
import React, { ComponentProps, ComponentType } from 'react';
import { MessageDescriptor } from 'react-intl';
import { Button } from 'app/components/ui/form';
import RejectionLink from 'app/components/auth/RejectionLink';
import AuthTitle from 'app/components/auth/AuthTitle';
import { MessageDescriptor } from 'react-intl';
import { Color } from 'app/components/ui';
import BaseAuthBody from './BaseAuthBody';
export type Factory = () => {
@ -17,11 +18,7 @@ type RejectionLinkProps = ComponentProps<typeof RejectionLink>;
interface FactoryParams {
title: MessageDescriptor;
body: typeof BaseAuthBody;
footer: {
color?: Color;
label: string | MessageDescriptor;
autoFocus?: boolean;
};
footer: Omit<ComponentProps<typeof Button>, 'type'>;
links?: RejectionLinkProps | Array<RejectionLinkProps>;
}

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './ForgotPasswordBody';
const messages = defineMessages({
title: 'Forgot password',
sendMail: 'Send mail',
alreadyHaveCode: 'Already have a code',
});
@ -14,7 +15,7 @@ export default factory({
footer: {
color: 'lightViolet',
autoFocus: true,
label: messages.sendMail,
children: <Message key="sendMail" defaultMessage="Send mail" />,
},
links: {
label: messages.alreadyHaveCode,

View File

@ -1,11 +1,12 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './LoginBody';
const messages = defineMessages({
createNewAccount: 'Create new account',
loginTitle: 'Sign in',
next: 'Next',
});
export default factory({
@ -13,7 +14,7 @@ export default factory({
body: Body,
footer: {
color: 'green',
label: messages.next,
children: <Message key="next" defaultMessage="Next" />,
},
links: {
isAvailable: (context) => !context.user.isGuest,

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './MfaBody';
const messages = defineMessages({
enterTotp: 'Enter code',
signInButton: 'Sign in',
});
export default factory({
@ -12,6 +13,6 @@ export default factory({
body: Body,
footer: {
color: 'green',
label: messages.signInButton,
children: <Message key="signInButton" defaultMessage="Sign in" />,
},
});

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './PasswordBody';
const messages = defineMessages({
passwordTitle: 'Enter password',
signInButton: 'Sign in',
forgotPassword: 'Forgot password',
});
@ -13,7 +14,7 @@ export default factory({
body: Body,
footer: {
color: 'green',
label: messages.signInButton,
children: <Message key="signInButton" defaultMessage="Sign in" />,
},
links: {
label: messages.forgotPassword,

View File

@ -1,11 +1,12 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './PermissionsBody';
const messages = defineMessages({
permissionsTitle: 'Application permissions',
decline: 'Decline',
approve: 'Approve',
});
export default factory({
@ -14,7 +15,7 @@ export default factory({
footer: {
color: 'orange',
autoFocus: true,
label: messages.approve,
children: <Message key="approve" defaultMessage="Approve" />,
},
links: {
label: messages.decline,

View File

@ -1,11 +1,12 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './RecoverPasswordBody';
const messages = defineMessages({
title: 'Restore password',
contactSupport: 'Contact support',
change: 'Change password',
});
export default factory({
@ -13,7 +14,7 @@ export default factory({
body: Body,
footer: {
color: 'lightViolet',
label: messages.change,
children: <Message key="change" defaultMessage="Change password" />,
},
links: {
label: messages.contactSupport,

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './RegisterBody';
const messages = defineMessages({
registerTitle: 'Sign Up',
signUpButton: 'Register',
didNotReceivedEmail: 'Did not received Email?',
alreadyHaveCode: 'Already have a code',
});
@ -14,7 +15,7 @@ export default factory({
body: Body,
footer: {
color: 'blue',
label: messages.signUpButton,
children: <Message key="signUpButton" defaultMessage="Register" />,
},
links: [
{

View File

@ -1,10 +1,11 @@
import { defineMessages } from 'react-intl';
import React from 'react';
import { FormattedMessage as Message, defineMessages } from 'react-intl';
import factory from '../factory';
import Body from './ResendActivationBody';
const messages = defineMessages({
title: 'Did not received an Email',
sendNewEmail: 'Send new Email',
alreadyHaveCode: 'Already have a code',
});
@ -13,7 +14,7 @@ export default factory({
body: Body,
footer: {
color: 'blue',
label: messages.sendNewEmail,
children: <Message key="sendNewEmail" defaultMessage="Send new Email" />,
},
links: {
label: messages.alreadyHaveCode,