|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import React, { useCallback } from 'react';
|
|
|
|
|
import { useDispatch } from 'react-redux';
|
|
|
|
|
import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
|
import AppState from 'App/State/AppState';
|
|
|
|
|
import Modal from 'Components/Modal/Modal';
|
|
|
|
|
import { sizes } from 'Helpers/Props';
|
|
|
|
|
import { clearPendingChanges } from 'Store/Actions/baseActions';
|
|
|
|
@ -7,7 +8,8 @@ import EditMetadataModalContent, {
|
|
|
|
|
EditMetadataModalContentProps,
|
|
|
|
|
} from './EditMetadataModalContent';
|
|
|
|
|
|
|
|
|
|
interface EditMetadataModalProps extends EditMetadataModalContentProps {
|
|
|
|
|
interface EditMetadataModalProps
|
|
|
|
|
extends Omit<EditMetadataModalContentProps, 'advancedSettings'> {
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -18,6 +20,10 @@ function EditMetadataModal({
|
|
|
|
|
}: EditMetadataModalProps) {
|
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
|
|
|
|
|
|
const advancedSettings = useSelector(
|
|
|
|
|
(state: AppState) => state.settings.advancedSettings
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
const handleModalClose = useCallback(() => {
|
|
|
|
|
dispatch(clearPendingChanges({ section: 'metadata' }));
|
|
|
|
|
onModalClose();
|
|
|
|
@ -27,6 +33,7 @@ function EditMetadataModal({
|
|
|
|
|
<Modal size={sizes.MEDIUM} isOpen={isOpen} onModalClose={handleModalClose}>
|
|
|
|
|
<EditMetadataModalContent
|
|
|
|
|
{...otherProps}
|
|
|
|
|
advancedSettings={advancedSettings}
|
|
|
|
|
onModalClose={handleModalClose}
|
|
|
|
|
/>
|
|
|
|
|
</Modal>
|
|
|
|
|