Fix PR review

Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
HichamELBSI 2020-03-30 18:49:49 +02:00
parent 592e44bd43
commit 210bb4985a
4 changed files with 6 additions and 14 deletions

View File

@ -96,8 +96,8 @@ FiltersCard.defaultProps = {
};
FiltersCard.propTypes = {
onChange: PropTypes.func,
filters: PropTypes.arrayOf(PropTypes.object),
onChange: PropTypes.func,
};
export default FiltersCard;

View File

@ -4,10 +4,10 @@ import IntlText from '../IntlText';
const EmptyText = styled(IntlText)`
position: absolute;
width: 17rem;
margin-top: -0.3rem;
line-height: 1.8rem;
text-align: center;
color: ${({ theme }) => theme.main.colors.white};
line-height: 1.8rem;
margin-top: -0.3rem;
`;
export default EmptyText;

View File

@ -1,7 +0,0 @@
import styled from 'styled-components';
const Input = styled.input`
display: none;
`;
export default Input;

View File

@ -1,4 +1,4 @@
import React, { useState, createRef } from 'react';
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { get } from 'lodash';
@ -15,7 +15,7 @@ import InputFilePreview from './InputFilePreview';
import InputModalStepper from '../../containers/InputModalStepper';
import Name from './Name';
import Wrapper from './Wrapper';
import Input from './Input';
import Input from '../InputFileModal/Input';
const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
const [modal, setModal] = useState({
@ -23,7 +23,6 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
step: null,
fileToEdit: null,
});
const ref = createRef();
const [fileToDisplay, setFileToDisplay] = useState(0);
const hasNoValue = !!value && Array.isArray(value) && value.length === 0;
const currentFile = attribute.multiple ? value[fileToDisplay] : value;
@ -116,7 +115,7 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
onClick={handleFilesNavigation}
/>
)}
<Input ref={ref} type="file" name={name} />
<Input type="file" name={name} />
</CardPreviewWrapper>
{modal.isOpen && (