👽 Corrections RuleValueVignette et Input

pull/188/head
Laurent Bossavit 2018-03-29 10:18:38 +02:00 committed by Mael
parent 8e73437b29
commit 19c7c8f918
2 changed files with 7 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import React, { Component } from 'react'
import { Trans, translate } from 'react-i18next'
import PropTypes from 'prop-types'
import { FormDecorator } from './FormDecorator'
import classnames from 'classnames'
@ -7,6 +8,7 @@ import { Field } from 'redux-form'
import SendButton from './SendButton'
@FormDecorator('input')
@translate()
export default class Input extends Component {
static contextTypes = {
i18n: PropTypes.object.isRequired
@ -25,8 +27,9 @@ export default class Input extends Component {
suffixed = answerSuffix != null,
inputError = dirty && error,
submitDisabled = !dirty || inputError,
{ i18n } = this.context
attributes['placeholder'] = i18n.t(attributes['placeholder']);
{ i18n } = this.context,
transformedAttributes = Object.assign({}, attributes)
transformedAttributes['placeholder'] = i18n.t(attributes['placeholder'])
return (
<span>
@ -40,7 +43,7 @@ export default class Input extends Component {
{...input}
className={classnames({ suffixed })}
id={'step-' + dottedName}
{...attributes}
{...transformedAttributes}
style={
!active
? { border: '2px dashed #ddd' }

View File

@ -1,5 +1,5 @@
import React from 'react'
import { Trans, translate } from 'react-i18next'
import { Trans } from 'react-i18next'
import { Link } from 'react-router-dom'
import { encodeRuleName } from 'Engine/rules'
import classNames from 'classnames'
@ -8,7 +8,6 @@ import { humanFigure } from '../../utils'
import './RuleValueVignette.css'
import ReactCSSTransitionGroup from 'react-addons-css-transition-group'
@translate()
export default ({
name,
type,