Окончательно раскидал стили и переводы по модулям

This commit is contained in:
SleepWalker 2016-01-19 08:17:21 +02:00
parent 13b3a913a8
commit bdbe4a46b6
17 changed files with 314 additions and 257 deletions

View File

@ -7,16 +7,19 @@ import buttons from 'components/ui/buttons.scss';
import { Panel, PanelBody, PanelFooter } from 'components/ui/Panel'; import { Panel, PanelBody, PanelFooter } from 'components/ui/Panel';
import { Input } from 'components/ui/Form'; import { Input } from 'components/ui/Form';
import styles from './signIn.scss'; import styles from './activation.scss';
import messages from './SignIn.messages'; import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import messages from './Activation.messages';
export default class Activation extends Component { export default class Activation extends Component {
displayName = 'Activation'; displayName = 'Activation';
render() { render() {
return ( return (
<div className={styles.signIn}> <div>
<Helmet title="Activation" /> <Message {...messages.accountActivationTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
<Panel icon="arrowLeft" title={<Message {...messages.accountActivationTitle} />}> <Panel icon="arrowLeft" title={<Message {...messages.accountActivationTitle} />}>
<PanelBody> <PanelBody>
@ -30,8 +33,7 @@ export default class Activation extends Component {
</div> </div>
</div> </div>
<div className={styles.formRow}> <div className={styles.formRow}>
{/* TODO: E-mail i18n*/} <Input color="blue" className={styles.activationCodeInput} placeholder={messages.enterTheCode} />
<Input type="email" color="blue" className={styles.activationCodeInput} placeholder="Enter the code from E-mail here" />
</div> </div>
</PanelBody> </PanelBody>
<PanelFooter> <PanelFooter>
@ -40,7 +42,7 @@ export default class Activation extends Component {
</button> </button>
</PanelFooter> </PanelFooter>
</Panel> </Panel>
<div className={styles.helpLinks}> <div className={helpLinksStyles}>
<a href="#"> <a href="#">
<Message {...messages.didNotReceivedEmail} /> <Message {...messages.didNotReceivedEmail} />
</a> </a>

View File

@ -0,0 +1,33 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
accountActivationTitle: {
id: 'accountActivationTitle',
defaultMessage: 'Account activation'
},
activationMailWasSent: {
id: 'activationMailWasSent',
defaultMessage: 'Please check {email} for the message with the last registration step'
},
confirmEmail: {
id: 'confirmEmail',
defaultMessage: 'Confirm E-mail'
},
didNotReceivedEmail: {
id: 'didNotReceivedEmail',
defaultMessage: 'Did not received E-mail?'
},
enterTheCode: {
id: 'enterTheCode',
defaultMessage: 'Enter the code from E-mail here'
},
didNotReceivedEmail: {
id: 'didNotReceivedEmail',
defaultMessage: 'Did not received E-mail?'
}
});

View File

@ -6,24 +6,26 @@ import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
import buttons from 'components/ui/buttons.scss'; import buttons from 'components/ui/buttons.scss';
import icons from 'components/ui/icons.scss'; import { Panel, PanelBody, PanelFooter } from 'components/ui/Panel';
import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel'; import { Input } from 'components/ui/Form';
import { Input, Checkbox } from 'components/ui/Form';
import styles from './signIn.scss'; import messages from './Login.messages';
import messages from './SignIn.messages'; import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import passwordMessages from './Password.messages';
class Login extends Component { class Login extends Component {
displayName = 'Login'; displayName = 'Login';
render() { render() {
return ( return (
<div className={styles.signIn}> <div>
<Helmet title="Login" /> <Message {...messages.signInTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
<Panel title={<Message {...messages.signInTitle} />}> <Panel title={<Message {...messages.signInTitle} />}>
<PanelBody> <PanelBody>
<Input icon="envelope" type="email" placeholder="E-mail or username" /> <Input icon="envelope" type="email" placeholder={messages.emailOrUsername} />
</PanelBody> </PanelBody>
<PanelFooter> <PanelFooter>
<button className={buttons.green} onClick={this.onSubmit}> <button className={buttons.green} onClick={this.onSubmit}>
@ -31,9 +33,9 @@ class Login extends Component {
</button> </button>
</PanelFooter> </PanelFooter>
</Panel> </Panel>
<div className={styles.helpLinks}> <div className={helpLinksStyles}>
<a href="#"> <a href="#">
<Message {...messages.forgotPassword} /> <Message {...passwordMessages.forgotPassword} />
</a> </a>
</div> </div>
</div> </div>

View File

@ -0,0 +1,18 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
signInTitle: {
id: 'signInTitle',
defaultMessage: 'Sign in'
},
emailOrUsername: {
id: 'emailOrUsername',
defaultMessage: 'E-mail or username'
},
next: {
id: 'next',
defaultMessage: 'Next'
}
});

View File

@ -1,22 +1,28 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { FormattedMessage as Message } from 'react-intl'; import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet';
import buttons from 'components/ui/buttons.scss'; import buttons from 'components/ui/buttons.scss';
import icons from 'components/ui/icons.scss'; import icons from 'components/ui/icons.scss';
import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel'; import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel';
import { Input, Checkbox } from 'components/ui/Form'; import { Input, Checkbox } from 'components/ui/Form';
import styles from './signIn.scss'; import styles from './password.scss';
import messages from './SignIn.messages'; import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import messages from './Password.messages';
export default class Password extends Component { export default class Password extends Component {
displayName = 'Password'; displayName = 'Password';
render() { render() {
return ( return (
<div className={styles.signIn}> <div>
<Panel icon="arrowLeft" title={<Message {...messages.enterPassword} />}> <Message {...messages.passwordTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
<Panel icon="arrowLeft" title={<Message {...messages.passwordTitle} />}>
<PanelBody> <PanelBody>
<PanelBodyHeader type="error"> <PanelBodyHeader type="error">
<Message {...messages.invalidPassword} /> <Message {...messages.invalidPassword} />
@ -39,7 +45,7 @@ export default class Password extends Component {
erickskrauch@yandex.ru erickskrauch@yandex.ru
</div> </div>
</div> </div>
<Input icon="key" type="password" placeholder="Account password" /> <Input icon="key" type="password" placeholder={messages.accountPassword} />
<Checkbox label={<Message {...messages.rememberMe} />} /> <Checkbox label={<Message {...messages.rememberMe} />} />
</PanelBody> </PanelBody>
@ -49,7 +55,7 @@ export default class Password extends Component {
</button> </button>
</PanelFooter> </PanelFooter>
</Panel> </Panel>
<div className={styles.helpLinks}> <div className={helpLinksStyles}>
<a href="#"> <a href="#">
<Message {...messages.forgotPassword} /> <Message {...messages.forgotPassword} />
</a> </a>

View File

@ -0,0 +1,43 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
passwordTitle: {
id: 'passwordTitle',
defaultMessage: 'Enter password'
},
signInButton: {
id: 'signInButton',
defaultMessage: 'Sign in'
},
invalidPassword: {
id: 'invalidPassword',
defaultMessage: 'You entered wrong account password.'
},
suggestResetPassword: {
id: 'suggestResetPassword',
defaultMessage: 'Are you have {link}?'
},
forgotYourPassword: {
id: 'forgotYourPassword',
defaultMessage: 'forgot your password'
},
forgotPassword: {
id: 'forgotPassword',
defaultMessage: 'Forgot password'
},
accountPassword: {
id: 'accountPassword',
defaultMessage: 'Account password'
},
rememberMe: {
id: 'rememberMe',
defaultMessage: 'Remember me on this device'
}
});

View File

@ -6,18 +6,20 @@ import Helmet from 'react-helmet';
import buttons from 'components/ui/buttons.scss'; import buttons from 'components/ui/buttons.scss';
import icons from 'components/ui/icons.scss'; import icons from 'components/ui/icons.scss';
import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel'; import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel';
import { Input, Checkbox } from 'components/ui/Form';
import styles from './signIn.scss'; import styles from './permissions.scss';
import messages from './SignIn.messages'; import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import messages from './Permissions.messages';
export default class Permissions extends Component { export default class Permissions extends Component {
displayName = 'Permissions'; displayName = 'Permissions';
render() { render() {
return ( return (
<div className={styles.signIn}> <div>
<Helmet title="App premissions" /> <Message {...messages.permissionsTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
<Panel title={<Message {...messages.permissionsTitle} />}> <Panel title={<Message {...messages.permissionsTitle} />}>
<PanelBody> <PanelBody>
@ -53,7 +55,7 @@ export default class Permissions extends Component {
</button> </button>
</PanelFooter> </PanelFooter>
</Panel> </Panel>
<div className={styles.helpLinks}> <div className={helpLinksStyles}>
<a href="#"> <a href="#">
<Message {...messages.decline} /> <Message {...messages.decline} />
</a> </a>

View File

@ -0,0 +1,29 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
permissionsTitle: {
id: 'permissionsTitle',
defaultMessage: 'Application permissions'
},
youAuthorizedAs: {
id: 'youAuthorizedAs',
defaultMessage: 'You authorized as:'
},
theAppNeedsAccess: {
id: 'theAppNeedsAccess',
// Мне нельзя html? Получите неразрывный пробел! ˅˅˅˅˅˅˅˅˅˅˅
defaultMessage: 'This applications needs access              to your data'
},
decline: {
id: 'decline',
defaultMessage: 'Decline'
},
approve: {
id: 'approve',
defaultMessage: 'Approve'
}
});

View File

@ -4,31 +4,29 @@ import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
import buttons from 'components/ui/buttons.scss'; import buttons from 'components/ui/buttons.scss';
import icons from 'components/ui/icons.scss'; import { Panel, PanelBody, PanelFooter } from 'components/ui/Panel';
import { Panel, PanelBody, PanelFooter, PanelBodyHeader } from 'components/ui/Panel';
import { Input, Checkbox } from 'components/ui/Form'; import { Input, Checkbox } from 'components/ui/Form';
import styles from './signIn.scss'; import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import messages from './SignIn.messages'; import messages from './Register.messages';
import activationMessages from './Activation.messages';
export default class Register extends Component { export default class Register extends Component {
displayName = 'Register'; displayName = 'Register';
render() { render() {
return ( return (
<div className={styles.signIn}> <div>
<Helmet title="Register" /> <Message {...messages.signUpTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
<Panel title={<Message {...messages.signUpTitle} />}> <Panel title={<Message {...messages.signUpTitle} />}>
<PanelBody> <PanelBody>
{/* TODO: E-mail i18n*/} <Input icon="user" color="blue" type="text" placeholder={messages.yourNickname} />
<Input icon="user" color="blue" type="text" placeholder="Your nickname" /> <Input icon="envelope" color="blue" type="email" placeholder={messages.yourEmail} />
{/* TODO: E-mail i18n*/} <Input icon="key" color="blue" type="password" placeholder={messages.accountPassword} />
<Input icon="envelope" color="blue" type="email" placeholder="Your E-mail" /> <Input icon="key" color="blue" type="password" placeholder={messages.repeatPassword} />
{/* TODO: Account password i18n*/}
<Input icon="key" color="blue" type="password" placeholder="Account password" />
{/* TODO: Account password i18n*/}
<Input icon="key" color="blue" type="password" placeholder="Repeat password" />
<Checkbox color="blue" label={ <Checkbox color="blue" label={
<Message {...messages.acceptRules} values={{ <Message {...messages.acceptRules} values={{
@ -46,9 +44,9 @@ export default class Register extends Component {
</button> </button>
</PanelFooter> </PanelFooter>
</Panel> </Panel>
<div className={styles.helpLinks}> <div className={helpLinksStyles}>
<a href="#"> <a href="#">
<Message {...messages.didNotReceivedEmail} /> <Message {...activationMessages.didNotReceivedEmail} />
</a> </a>
</div> </div>
</div> </div>

View File

@ -0,0 +1,43 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
signUpTitle: {
id: 'signUpTitle',
defaultMessage: 'Sign Up'
},
yourNickname: {
id: 'yourNickname',
defaultMessage: 'Your nickname'
},
yourEmail: {
id: 'yourEmail',
defaultMessage: 'Your E-mail'
},
accountPassword: {
id: 'accountPassword',
defaultMessage: 'Account password'
},
repeatPassword: {
id: 'repeatPassword',
defaultMessage: 'Repeat password'
},
signUpButton: {
id: 'signUpButton',
defaultMessage: 'Register'
},
acceptRules: {
id: 'acceptRules',
defaultMessage: 'I agree with {link}'
},
termsOfService: {
id: 'termsOfService',
defaultMessage: 'Terms of service'
}
});

View File

@ -1,125 +0,0 @@
import { defineMessages } from 'react-intl';
export default defineMessages({
signInTitle: {
id: 'signInTitle',
defaultMessage: 'Sign in'
},
next: {
id: 'next',
defaultMessage: 'Next'
},
enterPassword: {
id: 'enterPassword',
defaultMessage: 'Enter password'
},
rememberMe: {
id: 'rememberMe',
defaultMessage: 'Remember me on this device'
},
signInButton: {
id: 'signInButton',
defaultMessage: 'Sign in'
},
invalidPassword: {
id: 'invalidPassword',
defaultMessage: 'You entered wrong account password.'
},
suggestResetPassword: {
id: 'suggestResetPassword',
defaultMessage: 'Are you have {link}?'
},
forgotYourPassword: {
id: 'forgotYourPassword',
defaultMessage: 'forgot your password'
},
forgotPassword: {
id: 'forgotPassword',
defaultMessage: 'Forgot password'
},
contactSupport: {
id: 'contactSupport',
defaultMessage: 'Contact support'
},
permissionsTitle: {
id: 'permissionsTitle',
defaultMessage: 'Application permissions'
},
youAuthorizedAs: {
id: 'youAuthorizedAs',
defaultMessage: 'You authorized as:'
},
theAppNeedsAccess: {
id: 'theAppNeedsAccess',
// Мне нельзя html? Получите неразрывный пробел! ˅˅˅˅˅˅˅˅˅˅˅
defaultMessage: 'This applications needs access              to your data'
},
decline: {
id: 'decline',
defaultMessage: 'Decline'
},
approve: {
id: 'approve',
defaultMessage: 'Approve'
},
signUpTitle: {
id: 'signUpTitle',
defaultMessage: 'Sign Up'
},
signUpButton: {
id: 'signUpButton',
defaultMessage: 'Register'
},
acceptRules: {
id: 'acceptRules',
defaultMessage: 'I agree with {link}'
},
termsOfService: {
id: 'termsOfService',
defaultMessage: 'Terms of service'
},
accountActivationTitle: {
id: 'accountActivationTitle',
defaultMessage: 'Account activation'
},
activationMailWasSent: {
id: 'activationMailWasSent',
defaultMessage: 'Please check {email} for the message with the last registration step'
},
confirmEmail: {
id: 'confirmEmail',
defaultMessage: 'Confirm E-mail'
},
didNotReceivedEmail: {
id: 'didNotReceivedEmail',
defaultMessage: 'Did not received E-mail?'
},
});

View File

@ -0,0 +1,24 @@
@import '~components/ui/colors.scss';
@import '~components/ui/fonts.scss';
.description {
}
.descriptionImage {
composes: envelope from 'components/ui/icons.scss';
font-size: 100px;
color: $blue;
}
.descriptionText {
font-family: $font-family-title;
margin: 5px 0 19px;
line-height: 1.4;
}
.activationCodeInput {
composes: blueTextField from 'components/ui/form.scss';
text-align: center;
}

View File

@ -0,0 +1,19 @@
.helpLinks {
margin: 8px 0;
color: #444;
text-align: center;
font-size: 16px;
a {
color: #444;
border-bottom: 1px dotted #444;
text-decoration: none;
transition: .25s;
&:hover {
border-bottom-color: #777;
color: #777;
}
}
}

View File

@ -0,0 +1,22 @@
@import '~components/ui/fonts.scss';
.avatar {
width: 90px;
height: 90px;
font-size: 90px;
line-height: 1;
margin: 0 auto;
img {
width: 100%;
}
}
.email {
font-family: $font-family-title;
font-size: 18px;
color: #fff;
margin-bottom: 15px;
margin-top: 10px;
}

View File

@ -1,78 +1,6 @@
@import '~components/ui/colors.scss'; @import '~components/ui/colors.scss';
.signIn {
margin-bottom: 10px;
text-align: center;
}
.helpLinks {
margin: 8px 0;
color: #444;
text-align: center;
font-size: 16px;
a {
color: #444;
border-bottom: 1px dotted #444;
text-decoration: none;
transition: .25s;
&:hover {
border-bottom-color: #777;
color: #777;
}
}
}
// sign in second step
@import '~components/ui/fonts.scss'; @import '~components/ui/fonts.scss';
.avatar {
width: 90px;
height: 90px;
font-size: 90px;
line-height: 1;
margin: 0 auto;
img {
width: 100%;
}
}
.email {
font-family: $font-family-title;
font-size: 18px;
color: #fff;
margin-bottom: 15px;
margin-top: 10px;
}
// account activation
@import '~components/ui/fonts.scss';
.description {
}
.descriptionImage {
composes: envelope from 'components/ui/icons.scss';
font-size: 100px;
color: $blue;
}
.descriptionText {
font-family: $font-family-title;
margin: 5px 0 19px;
line-height: 1.4;
}
.activationCodeInput {
composes: blueTextField from 'components/ui/form.scss';
text-align: center;
}
// app permissions
.authInfo { .authInfo {
// Отступы сверху и снизу разные т.к. мы ужимаем высоту линии строки с логином на 2 пикселя и из-за этого теряем отступ снизу // Отступы сверху и снизу разные т.к. мы ужимаем высоту линии строки с логином на 2 пикселя и из-за этого теряем отступ снизу
padding: 5px 20px 7px; padding: 5px 20px 7px;

View File

@ -1,11 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import {injectIntl, intlShape} from 'react-intl';
import icons from './icons.scss'; import icons from './icons.scss';
import styles from './form.scss'; import styles from './form.scss';
export function Input(props) { function Input(props) {
var { icon, color = 'green' } = props; var { icon, color = 'green' } = props;
props = { props = {
@ -13,6 +14,10 @@ export function Input(props) {
...props ...props
}; };
if (props.placeholder && props.placeholder.id) {
props.placeholder = props.intl.formatMessage(props.placeholder);
}
var baseClass = styles.formRow; var baseClass = styles.formRow;
if (icon) { if (icon) {
baseClass = styles.formIconRow; baseClass = styles.formIconRow;
@ -29,20 +34,27 @@ export function Input(props) {
); );
} }
export class Checkbox extends Component { Input.displayName = 'Input';
displayName = 'Checkbox'; Input.propTypes = {
intl: intlShape.isRequired
};
render() { const IntlInput = injectIntl(Input);
var { label, color = 'green' } = this.props;
return ( export {IntlInput as Input};
<div className={styles[`${color}CheckboxRow`]}>
<label className={styles.checkboxContainer}> export function Checkbox(props) {
<input className={styles.checkboxInput} type="checkbox" /> var { label, color = 'green' } = props;
<div className={styles.checkbox} />
{label} return (
</label> <div className={styles[`${color}CheckboxRow`]}>
</div> <label className={styles.checkboxContainer}>
); <input className={styles.checkboxInput} type="checkbox" />
} <div className={styles.checkbox} />
{label}
</label>
</div>
);
} }
Checkbox.displayName = 'Checkbox';

View File

@ -15,4 +15,5 @@ $sidebar-width: 320px;
.content { .content {
margin-left: $sidebar-width; margin-left: $sidebar-width;
padding: 55px 50px; padding: 55px 50px;
text-align: center;
} }