Created InputFileWithErrors component and add it to the index

This commit is contained in:
cyril lopez 2018-02-13 18:56:53 +01:00
parent 8e73ff6e0b
commit 0013e90eb0
5 changed files with 37 additions and 4 deletions

View File

@ -0,0 +1,29 @@
/**
*
* InputFileWithErrors
*
*/
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
// Design
import Label from 'components/Label';
import InputDescription from 'components/InputDescription';
import InputFile from 'components/InputFile';
class InputFileWithErrors extends React.Component {
// TODO handle errors lifecycle
render() {
return (
<div>
</div>
);
}
}
InputFileWithErrors.defaultProps = {};
InputFileWithErrors.propTypes = {};
export default InputFileWithErrors;

View File

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
import { includes, isEmpty, isFunction } from 'lodash';
import cn from 'classnames';
// Design

View File

@ -12,6 +12,7 @@ import InputAddonWithErrors from 'components/InputAddonWithErrors';
import InputCheckboxWithErrors from 'components/InputCheckboxWithErrors';
import InputDateWithErrors from 'components/InputDateWithErrors';
import InputEmailWithErrors from 'components/InputEmailWithErrors';
import InputFileWithErrors from 'components/InputFileWithErrors';
import InputNumberWithErrors from 'components/InputNumberWithErrors';
import InputSearchWithErrors from 'components/InputSearchWithErrors';
import InputSelectWithErrors from 'components/InputSelectWithErrors';
@ -27,6 +28,7 @@ const inputs = {
checkbox: InputCheckboxWithErrors,
date: InputDateWithErrors,
email: InputEmailWithErrors,
file: InputFileWithErrors,
number: InputNumberWithErrors,
password: InputPasswordWithErrors,
search: InputSearchWithErrors,
@ -63,6 +65,7 @@ export {
InputCheckboxWithErrors,
InputDateWithErrors,
InputEmailWithErrors,
InputFileWithErrors,
InputNumberWithErrors,
InputPasswordWithErrors,
InputSearchWithErrors,

View File

@ -11,7 +11,7 @@ import { createStructuredSelector } from 'reselect';
import { injectIntl } from 'react-intl';
import { bindActionCreators, compose } from 'redux';
import InputFile from 'components/InputFile';
import Input from 'components/InputsIndex';
import injectReducer from 'utils/injectReducer';
import injectSaga from 'utils/injectSaga';
@ -35,10 +35,11 @@ export class HomePage extends React.Component {
return (
<div className={styles.homePage} style={{ paddingTop: '98px', marginLeft: '100px'}}>
<form>
<InputFile
<Input
name="test"
value={this.state.value}
onChange={this.onChange}
type="file"
/>
</form>
</div>