From 210bb4985a3b320957b69ece2ff91f23da9d876b Mon Sep 17 00:00:00 2001 From: HichamELBSI Date: Mon, 30 Mar 2020 18:49:49 +0200 Subject: [PATCH] Fix PR review Signed-off-by: HichamELBSI --- .../src/components/FiltersPicker/FiltersCard/index.js | 2 +- .../admin/src/components/InputMedia/EmptyText.js | 4 ++-- .../admin/src/components/InputMedia/Input.js | 7 ------- .../admin/src/components/InputMedia/index.js | 7 +++---- 4 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 packages/strapi-plugin-upload/admin/src/components/InputMedia/Input.js diff --git a/packages/strapi-plugin-upload/admin/src/components/FiltersPicker/FiltersCard/index.js b/packages/strapi-plugin-upload/admin/src/components/FiltersPicker/FiltersCard/index.js index ac749ef9ae..1325cf46a3 100644 --- a/packages/strapi-plugin-upload/admin/src/components/FiltersPicker/FiltersCard/index.js +++ b/packages/strapi-plugin-upload/admin/src/components/FiltersPicker/FiltersCard/index.js @@ -96,8 +96,8 @@ FiltersCard.defaultProps = { }; FiltersCard.propTypes = { - onChange: PropTypes.func, filters: PropTypes.arrayOf(PropTypes.object), + onChange: PropTypes.func, }; export default FiltersCard; diff --git a/packages/strapi-plugin-upload/admin/src/components/InputMedia/EmptyText.js b/packages/strapi-plugin-upload/admin/src/components/InputMedia/EmptyText.js index f9ad5f300e..8a1fea05dd 100644 --- a/packages/strapi-plugin-upload/admin/src/components/InputMedia/EmptyText.js +++ b/packages/strapi-plugin-upload/admin/src/components/InputMedia/EmptyText.js @@ -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; diff --git a/packages/strapi-plugin-upload/admin/src/components/InputMedia/Input.js b/packages/strapi-plugin-upload/admin/src/components/InputMedia/Input.js deleted file mode 100644 index a6f746d73f..0000000000 --- a/packages/strapi-plugin-upload/admin/src/components/InputMedia/Input.js +++ /dev/null @@ -1,7 +0,0 @@ -import styled from 'styled-components'; - -const Input = styled.input` - display: none; -`; - -export default Input; diff --git a/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js b/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js index 8e7849da93..16570c7c7e 100644 --- a/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js +++ b/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js @@ -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} /> )} - + {modal.isOpen && (