2020-06-29 21:54:07 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import { Modal } from 'modal/modal';
|
|
|
|
import SelectAsset from 'component/selectAsset';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
closeModal: () => void,
|
|
|
|
currentValue: string,
|
2020-06-30 07:51:15 +02:00
|
|
|
title: string,
|
|
|
|
helpText: string,
|
2021-08-25 02:28:23 +02:00
|
|
|
onUpdate: (string, boolean) => void,
|
2020-06-30 07:51:15 +02:00
|
|
|
assetName: string,
|
2020-06-29 21:54:07 +02:00
|
|
|
};
|
|
|
|
|
2020-06-30 07:51:15 +02:00
|
|
|
function ModalImageUpload(props: Props) {
|
|
|
|
const { closeModal, currentValue, title, assetName, helpText, onUpdate } = props;
|
2020-06-29 21:54:07 +02:00
|
|
|
|
|
|
|
return (
|
2020-06-30 07:51:15 +02:00
|
|
|
<Modal isOpen type="card" onAborted={closeModal} contentLabel={title}>
|
|
|
|
<SelectAsset
|
2021-08-25 02:28:23 +02:00
|
|
|
onUpdate={(a, b) => onUpdate(a, b)}
|
2020-06-30 07:51:15 +02:00
|
|
|
currentValue={currentValue}
|
|
|
|
assetName={assetName}
|
|
|
|
recommended={helpText}
|
|
|
|
onDone={closeModal}
|
2020-06-29 21:54:07 +02:00
|
|
|
/>
|
|
|
|
</Modal>
|
|
|
|
);
|
2020-06-30 07:51:15 +02:00
|
|
|
}
|
2020-06-29 21:54:07 +02:00
|
|
|
|
|
|
|
export default ModalImageUpload;
|