Merge branch 'features/media-lib' of github.com:strapi/strapi into features/media-lib

This commit is contained in:
Alexandre Bodin 2020-04-15 19:15:26 +02:00
commit e8bac9c9a9

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import { get } from 'lodash';
@ -32,6 +32,10 @@ const InputMedia = ({ label, onChange, name, attribute, value, type }) => {
const displaySlidePagination =
attribute.multiple && value.length > 1 ? ` (${fileToDisplay + 1}/${value.length})` : '';
useEffect(() => {
setFileToDisplay(0);
}, [modal.isOpen]);
const handleClickToggleModal = () => {
setModal(prev => ({ isDisplayed: true, step: 'list', isOpen: !prev.isOpen, fileToEdit: null }));
};