ImportData: move FileChooserCSV params into CSVImporter
This commit is contained in:
parent
e6e4a5c447
commit
0666557282
|
@ -264,11 +264,3 @@ export const FileChooserLogo = props => (
|
||||||
FileChooserLogo.defaultProps = {
|
FileChooserLogo.defaultProps = {
|
||||||
accept: ['image/svg', 'image/png'],
|
accept: ['image/svg', 'image/png'],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FileChooserCSV = props => (
|
|
||||||
<SimpleInput type='file' {...props} />
|
|
||||||
);
|
|
||||||
|
|
||||||
FileChooserCSV.defaultProps = {
|
|
||||||
accept: ['text/csv'],
|
|
||||||
};
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { injectIntl } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import {
|
import {
|
||||||
|
SimpleInput,
|
||||||
SimpleForm,
|
SimpleForm,
|
||||||
FieldsGroup,
|
FieldsGroup,
|
||||||
FileChooserCSV,
|
|
||||||
} from 'soapbox/features/forms';
|
} from 'soapbox/features/forms';
|
||||||
|
|
||||||
export default @connect()
|
export default @connect()
|
||||||
|
@ -55,7 +55,9 @@ class CSVImporter extends ImmutablePureComponent {
|
||||||
<FieldsGroup>
|
<FieldsGroup>
|
||||||
<div className='fields-row file-picker'>
|
<div className='fields-row file-picker'>
|
||||||
<div className='fields-row__column fields-group fields-row__column-6'>
|
<div className='fields-row__column fields-group fields-row__column-6'>
|
||||||
<FileChooserCSV
|
<SimpleInput
|
||||||
|
type='file'
|
||||||
|
accept={['.csv', 'text/csv']}
|
||||||
label={intl.formatMessage(messages.input_label)}
|
label={intl.formatMessage(messages.input_label)}
|
||||||
hint={intl.formatMessage(messages.input_hint)}
|
hint={intl.formatMessage(messages.input_hint)}
|
||||||
onChange={this.handleFileChange}
|
onChange={this.handleFileChange}
|
||||||
|
|
Loading…
Reference in New Issue