diff --git a/src/components/auth/AuthTitle.jsx b/src/components/auth/AuthTitle.jsx
new file mode 100644
index 0000000..109b2a1
--- /dev/null
+++ b/src/components/auth/AuthTitle.jsx
@@ -0,0 +1,12 @@
+import React from 'react';
+
+import Helmet from 'react-helmet';
+import { FormattedMessage as Message } from 'react-intl';
+
+export default function AuthTitle({title}) {
+ return (
+
+ {(msg) => {msg}}
+
+ );
+}
diff --git a/src/components/auth/activation/Activation.intl.json b/src/components/auth/activation/Activation.intl.json
new file mode 100644
index 0000000..ee8713f
--- /dev/null
+++ b/src/components/auth/activation/Activation.intl.json
@@ -0,0 +1,7 @@
+{
+ "accountActivationTitle": "Account activation",
+ "activationMailWasSent": "Please check {email} for the message with the last registration step",
+ "confirmEmail": "Confirm E-mail",
+ "didNotReceivedEmail": "Did not received E-mail?",
+ "enterTheCode": "Enter the code from E-mail here"
+}
diff --git a/src/components/auth/activation/Activation.jsx b/src/components/auth/activation/Activation.jsx
index 5a56fe0..13f359b 100644
--- a/src/components/auth/activation/Activation.jsx
+++ b/src/components/auth/activation/Activation.jsx
@@ -1,61 +1,18 @@
import React from 'react';
import { FormattedMessage as Message } from 'react-intl';
-import Helmet from 'react-helmet';
-import buttons from 'components/ui/buttons.scss';
-import { Input } from 'components/ui/form';
+import { Button } from 'components/ui/form';
+import AuthTitle from 'components/auth/AuthTitle';
-import BaseAuthBody from 'components/auth/BaseAuthBody';
-import styles from './activation.scss';
-import messages from './Activation.messages';
-
-class Body extends BaseAuthBody {
- static displayName = 'ActivationBody';
- static panelId = 'activation';
-
- autoFocusField = 'key';
-
- render() {
- return (
-
diff --git a/src/components/auth/forgotPassword/ForgotPassword.messages.js b/src/components/auth/forgotPassword/ForgotPassword.messages.js
deleted file mode 100644
index f53d0ed..0000000
--- a/src/components/auth/forgotPassword/ForgotPassword.messages.js
+++ /dev/null
@@ -1,24 +0,0 @@
-import { defineMessages } from 'react-intl';
-
-export default defineMessages({
- forgotPasswordTitle: {
- id: 'forgotPasswordTitle',
- defaultMessage: 'Forgot password'
- },
- contactSupport: {
- id: 'contactSupport',
- defaultMessage: 'Contact support'
- },
- sendMail: {
- id: 'sendMail',
- defaultMessage: 'Send mail'
- },
- forgotPasswordMessage: {
- id: 'forgotPasswordMessage',
- defaultMessage: 'Specify the registration E-mail address for your account and we will send an email with instructions for further password recovery.'
- },
- accountEmail: {
- id: 'accountEmail',
- defaultMessage: 'Enter account E-mail'
- }
-});
diff --git a/src/components/auth/forgotPassword/ForgotPasswordBody.jsx b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx
new file mode 100644
index 0000000..6de8d10
--- /dev/null
+++ b/src/components/auth/forgotPassword/ForgotPasswordBody.jsx
@@ -0,0 +1,40 @@
+import React from 'react';
+
+import { FormattedMessage as Message } from 'react-intl';
+
+import { Input } from 'components/ui/form';
+import BaseAuthBody from 'components/auth/BaseAuthBody';
+
+import styles from './forgotPassword.scss';
+import messages from './ForgotPassword.intl.json';
+
+export default class ForgotPasswordBody extends BaseAuthBody {
+ static displayName = 'ForgotPasswordBody';
+ static panelId = 'forgotPassword';
+ static hasGoBack = true;
+
+ autoFocusField = 'email';
+
+ // Если юзер вводил своё мыло во время попытки авторизации, то почему бы его сюда автоматически не подставить?
+ render() {
+ const {user} = this.context;
+
+ return (
+
+ {this.renderErrors()}
+
+
+
+
+
+
+
+ );
+ }
+}
diff --git a/src/components/auth/login/Login.intl.json b/src/components/auth/login/Login.intl.json
new file mode 100644
index 0000000..40675bf
--- /dev/null
+++ b/src/components/auth/login/Login.intl.json
@@ -0,0 +1,5 @@
+{
+ "loginTitle": "Sign in",
+ "emailOrUsername": "E-mail or username",
+ "next": "Next"
+}
diff --git a/src/components/auth/login/Login.jsx b/src/components/auth/login/Login.jsx
index cbd0b69..27cb29e 100644
--- a/src/components/auth/login/Login.jsx
+++ b/src/components/auth/login/Login.jsx
@@ -1,52 +1,17 @@
import React from 'react';
-import { FormattedMessage as Message } from 'react-intl';
-import Helmet from 'react-helmet';
-import { Link } from 'react-router';
+import { Button } from 'components/ui/form';
+import AuthTitle from 'components/auth/AuthTitle';
-import buttons from 'components/ui/buttons.scss';
-import { Input } from 'components/ui/form';
-
-import BaseAuthBody from 'components/auth/BaseAuthBody';
-import passwordMessages from 'components/auth/password/Password.intl.json';
-import messages from './Login.messages';
-
-class Body extends BaseAuthBody {
- static displayName = 'LoginBody';
- static panelId = 'login';
-
- autoFocusField = 'login';
-
- render() {
- return (
-
- {this.renderErrors()}
-
-
-
- );
- }
-}
+import Body from './LoginBody';
+import messages from './Login.intl.json';
export default function Login() {
return {
- Title: () => ( // TODO: separate component for PageTitle
-
- {(msg) => {msg}}
-
- ),
+ Title: () => ,
Body,
- Footer: () => (
-
- ),
- Links: () => (
-
- )
+ Footer: () => ,
+ Links: () => null
};
}
+
diff --git a/src/components/auth/login/Login.messages.js b/src/components/auth/login/Login.messages.js
deleted file mode 100644
index b379bac..0000000
--- a/src/components/auth/login/Login.messages.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import { defineMessages } from 'react-intl';
-
-export default defineMessages({
- loginTitle: {
- id: 'loginTitle',
- defaultMessage: 'Sign in'
- },
-
- emailOrUsername: {
- id: 'emailOrUsername',
- defaultMessage: 'E-mail or username'
- },
-
- next: {
- id: 'next',
- defaultMessage: 'Next'
- }
-});
diff --git a/src/components/auth/login/LoginBody.jsx b/src/components/auth/login/LoginBody.jsx
new file mode 100644
index 0000000..a5de8a9
--- /dev/null
+++ b/src/components/auth/login/LoginBody.jsx
@@ -0,0 +1,27 @@
+import React from 'react';
+
+import { Input } from 'components/ui/form';
+import BaseAuthBody from 'components/auth/BaseAuthBody';
+
+import messages from './Login.intl.json';
+
+export default class LoginBody extends BaseAuthBody {
+ static displayName = 'LoginBody';
+ static panelId = 'login';
+
+ autoFocusField = 'login';
+
+ render() {
+ return (
+
+ {this.renderErrors()}
+
+
+
+ );
+ }
+}
diff --git a/src/components/auth/password/Password.jsx b/src/components/auth/password/Password.jsx
index 67183c7..8cc46c8 100644
--- a/src/components/auth/password/Password.jsx
+++ b/src/components/auth/password/Password.jsx
@@ -1,71 +1,19 @@
import React from 'react';
import { FormattedMessage as Message } from 'react-intl';
-import Helmet from 'react-helmet';
import { Link } from 'react-router';
-import buttons from 'components/ui/buttons.scss';
-import icons from 'components/ui/icons.scss';
-import { Input, Checkbox } from 'components/ui/form';
+import { Button } from 'components/ui/form';
+import AuthTitle from 'components/auth/AuthTitle';
-import BaseAuthBody from 'components/auth/BaseAuthBody';
-import styles from './password.scss';
+import Body from './PasswordBody';
import messages from './Password.intl.json';
-class Body extends BaseAuthBody {
- static displayName = 'PasswordBody';
- static panelId = 'password';
- static hasGoBack = true;
-
- autoFocusField = 'password';
-
- render() {
- const {user} = this.context;
-
- return (
-
- {this.renderErrors()}
-
-
-
- {user.avatar
- ?
- :
- }
-
-
- {user.email || user.username}
-
-
-
-
-
}
- />
-
- );
- }
-}
-
export default function Password() {
return {
- Title: () => ( // TODO: separate component for PageTitle
-
- {(msg) => {msg}}
-
- ),
+ Title: () => ,
Body,
- Footer: () => (
-
- ),
+ Footer: () => ,
Links: () => (
diff --git a/src/components/auth/password/PasswordBody.jsx b/src/components/auth/password/PasswordBody.jsx
new file mode 100644
index 0000000..c3c3b57
--- /dev/null
+++ b/src/components/auth/password/PasswordBody.jsx
@@ -0,0 +1,51 @@
+import React from 'react';
+
+import { FormattedMessage as Message } from 'react-intl';
+
+import icons from 'components/ui/icons.scss';
+import { Input, Checkbox } from 'components/ui/form';
+import BaseAuthBody from 'components/auth/BaseAuthBody';
+
+import styles from './password.scss';
+import messages from './Password.intl.json';
+
+export default class PasswordBody extends BaseAuthBody {
+ static displayName = 'PasswordBody';
+ static panelId = 'password';
+ static hasGoBack = true;
+
+ autoFocusField = 'password';
+
+ render() {
+ const {user} = this.context;
+
+ return (
+
+ {this.renderErrors()}
+
+
+
+ {user.avatar
+ ?
+ :
+ }
+
+
+ {user.email || user.username}
+
+
+
+
+
+
+ );
+ }
+}
diff --git a/src/components/auth/permissions/Permissions.intl.json b/src/components/auth/permissions/Permissions.intl.json
new file mode 100644
index 0000000..06e1a84
--- /dev/null
+++ b/src/components/auth/permissions/Permissions.intl.json
@@ -0,0 +1,10 @@
+{
+ "permissionsTitle": "Application permissions",
+ "youAuthorizedAs": "You authorized as:",
+ "theAppNeedsAccess1": "This application needs access",
+ "theAppNeedsAccess2": "to your data",
+ "decline": "Decline",
+ "approve": "Approve",
+ "scope_minecraft_server_session": "Authorization data for minecraft server",
+ "scope_offline_access": "Access to your profile data, when you offline"
+}
diff --git a/src/components/auth/permissions/Permissions.jsx b/src/components/auth/permissions/Permissions.jsx
index 0f594d5..2b049ec 100644
--- a/src/components/auth/permissions/Permissions.jsx
+++ b/src/components/auth/permissions/Permissions.jsx
@@ -1,73 +1,18 @@
import React, { PropTypes } from 'react';
import { FormattedMessage as Message } from 'react-intl';
-import Helmet from 'react-helmet';
-import buttons from 'components/ui/buttons.scss';
-import icons from 'components/ui/icons.scss';
-import { PanelBodyHeader } from 'components/ui/Panel';
+import { Button } from 'components/ui/form';
+import AuthTitle from 'components/auth/AuthTitle';
-import BaseAuthBody from 'components/auth/BaseAuthBody';
-import styles from './permissions.scss';
-import messages from './Permissions.messages';
-
-class Body extends BaseAuthBody {
- static displayName = 'PermissionsBody';
- static panelId = 'permissions';
-
- render() {
- const {user} = this.context;
- const scopes = this.context.auth.scopes;
-
- return (
-
- {this.renderErrors()}
-
-
-
-
- {user.avatar
- ?
- :
- }
-
-
-
-
-
- {user.email}
-
-
-
-
-
-
-
-
-
- {scopes.map((scope, key) => (
- - {}
- ))}
-
-
-
- );
- }
-}
+import messages from './Permissions.intl.json';
+import Body from './PermissionsBody';
export default function Permissions() {
const componentsMap = {
- Title: () => ( // TODO: separate component for PageTitle
-
- {(msg) => {msg}}
-
- ),
+ Title: () => ,
Body,
- Footer: () => (
-
- ),
+ Footer: () => ,
Links: (props, context) => (