mirror of
https://github.com/strapi/strapi.git
synced 2025-08-14 11:48:43 +00:00
Fix PR review
Signed-off-by: HichamELBSI <elabbassih@gmail.com>
This commit is contained in:
parent
592e44bd43
commit
210bb4985a
@ -96,8 +96,8 @@ FiltersCard.defaultProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
FiltersCard.propTypes = {
|
FiltersCard.propTypes = {
|
||||||
onChange: PropTypes.func,
|
|
||||||
filters: PropTypes.arrayOf(PropTypes.object),
|
filters: PropTypes.arrayOf(PropTypes.object),
|
||||||
|
onChange: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FiltersCard;
|
export default FiltersCard;
|
||||||
|
@ -4,10 +4,10 @@ import IntlText from '../IntlText';
|
|||||||
const EmptyText = styled(IntlText)`
|
const EmptyText = styled(IntlText)`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 17rem;
|
width: 17rem;
|
||||||
|
margin-top: -0.3rem;
|
||||||
|
line-height: 1.8rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: ${({ theme }) => theme.main.colors.white};
|
color: ${({ theme }) => theme.main.colors.white};
|
||||||
line-height: 1.8rem;
|
|
||||||
margin-top: -0.3rem;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default EmptyText;
|
export default EmptyText;
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
const Input = styled.input`
|
|
||||||
display: none;
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default Input;
|
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useState, createRef } from 'react';
|
import React, { useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||||
import { get } from 'lodash';
|
import { get } from 'lodash';
|
||||||
@ -15,7 +15,7 @@ import InputFilePreview from './InputFilePreview';
|
|||||||
import InputModalStepper from '../../containers/InputModalStepper';
|
import InputModalStepper from '../../containers/InputModalStepper';
|
||||||
import Name from './Name';
|
import Name from './Name';
|
||||||
import Wrapper from './Wrapper';
|
import Wrapper from './Wrapper';
|
||||||
import Input from './Input';
|
import Input from '../InputFileModal/Input';
|
||||||
|
|
||||||
const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
|
const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
|
||||||
const [modal, setModal] = useState({
|
const [modal, setModal] = useState({
|
||||||
@ -23,7 +23,6 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
|
|||||||
step: null,
|
step: null,
|
||||||
fileToEdit: null,
|
fileToEdit: null,
|
||||||
});
|
});
|
||||||
const ref = createRef();
|
|
||||||
const [fileToDisplay, setFileToDisplay] = useState(0);
|
const [fileToDisplay, setFileToDisplay] = useState(0);
|
||||||
const hasNoValue = !!value && Array.isArray(value) && value.length === 0;
|
const hasNoValue = !!value && Array.isArray(value) && value.length === 0;
|
||||||
const currentFile = attribute.multiple ? value[fileToDisplay] : value;
|
const currentFile = attribute.multiple ? value[fileToDisplay] : value;
|
||||||
@ -116,7 +115,7 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
|
|||||||
onClick={handleFilesNavigation}
|
onClick={handleFilesNavigation}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Input ref={ref} type="file" name={name} />
|
<Input type="file" name={name} />
|
||||||
</CardPreviewWrapper>
|
</CardPreviewWrapper>
|
||||||
|
|
||||||
{modal.isOpen && (
|
{modal.isOpen && (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user