mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Created InputFileWithErrors component and add it to the index
This commit is contained in:
parent
8e73ff6e0b
commit
0013e90eb0
@ -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;
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { includes, isEmpty, isFunction, mapKeys, reject } from 'lodash';
|
import { includes, isEmpty, isFunction } from 'lodash';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
|
|
||||||
// Design
|
// Design
|
||||||
|
@ -12,6 +12,7 @@ import InputAddonWithErrors from 'components/InputAddonWithErrors';
|
|||||||
import InputCheckboxWithErrors from 'components/InputCheckboxWithErrors';
|
import InputCheckboxWithErrors from 'components/InputCheckboxWithErrors';
|
||||||
import InputDateWithErrors from 'components/InputDateWithErrors';
|
import InputDateWithErrors from 'components/InputDateWithErrors';
|
||||||
import InputEmailWithErrors from 'components/InputEmailWithErrors';
|
import InputEmailWithErrors from 'components/InputEmailWithErrors';
|
||||||
|
import InputFileWithErrors from 'components/InputFileWithErrors';
|
||||||
import InputNumberWithErrors from 'components/InputNumberWithErrors';
|
import InputNumberWithErrors from 'components/InputNumberWithErrors';
|
||||||
import InputSearchWithErrors from 'components/InputSearchWithErrors';
|
import InputSearchWithErrors from 'components/InputSearchWithErrors';
|
||||||
import InputSelectWithErrors from 'components/InputSelectWithErrors';
|
import InputSelectWithErrors from 'components/InputSelectWithErrors';
|
||||||
@ -27,6 +28,7 @@ const inputs = {
|
|||||||
checkbox: InputCheckboxWithErrors,
|
checkbox: InputCheckboxWithErrors,
|
||||||
date: InputDateWithErrors,
|
date: InputDateWithErrors,
|
||||||
email: InputEmailWithErrors,
|
email: InputEmailWithErrors,
|
||||||
|
file: InputFileWithErrors,
|
||||||
number: InputNumberWithErrors,
|
number: InputNumberWithErrors,
|
||||||
password: InputPasswordWithErrors,
|
password: InputPasswordWithErrors,
|
||||||
search: InputSearchWithErrors,
|
search: InputSearchWithErrors,
|
||||||
@ -63,6 +65,7 @@ export {
|
|||||||
InputCheckboxWithErrors,
|
InputCheckboxWithErrors,
|
||||||
InputDateWithErrors,
|
InputDateWithErrors,
|
||||||
InputEmailWithErrors,
|
InputEmailWithErrors,
|
||||||
|
InputFileWithErrors,
|
||||||
InputNumberWithErrors,
|
InputNumberWithErrors,
|
||||||
InputPasswordWithErrors,
|
InputPasswordWithErrors,
|
||||||
InputSearchWithErrors,
|
InputSearchWithErrors,
|
||||||
|
@ -11,7 +11,7 @@ import { createStructuredSelector } from 'reselect';
|
|||||||
import { injectIntl } from 'react-intl';
|
import { injectIntl } from 'react-intl';
|
||||||
import { bindActionCreators, compose } from 'redux';
|
import { bindActionCreators, compose } from 'redux';
|
||||||
|
|
||||||
import InputFile from 'components/InputFile';
|
import Input from 'components/InputsIndex';
|
||||||
import injectReducer from 'utils/injectReducer';
|
import injectReducer from 'utils/injectReducer';
|
||||||
import injectSaga from 'utils/injectSaga';
|
import injectSaga from 'utils/injectSaga';
|
||||||
|
|
||||||
@ -35,11 +35,12 @@ export class HomePage extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div className={styles.homePage} style={{ paddingTop: '98px', marginLeft: '100px'}}>
|
<div className={styles.homePage} style={{ paddingTop: '98px', marginLeft: '100px'}}>
|
||||||
<form>
|
<form>
|
||||||
<InputFile
|
<Input
|
||||||
name="test"
|
name="test"
|
||||||
value={this.state.value}
|
value={this.state.value}
|
||||||
onChange={this.onChange}
|
onChange={this.onChange}
|
||||||
/>
|
type="file"
|
||||||
|
/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user