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

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

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