Web: Client: SelectFileDialog: Added hide cancel button if event not set for embedded mode

This commit is contained in:
Ilya Oleshko 2023-07-14 14:57:13 +03:00
parent 8b5eebffab
commit 5b95e9df97
2 changed files with 10 additions and 8 deletions

View File

@ -105,13 +105,15 @@ const SelectFileDialogAsideView = ({
onClick={onButtonClick}
isDisabled={!fileId}
/>
<Button
theme={theme}
scale
size="normal"
label={t("Common:CancelButton")}
onClick={onClose}
/>
{onClose && (
<Button
theme={theme}
scale
size="normal"
label={t("Common:CancelButton")}
onClick={onClose}
/>
)}
</ModalDialog.Footer>
</ModalDialog>
);

View File

@ -304,7 +304,7 @@ class SelectFileDialog extends React.Component {
}
}
SelectFileDialog.propTypes = {
onClose: PropTypes.func.isRequired,
onClose: PropTypes.func,
isPanelVisible: PropTypes.bool.isRequired,
onSelectFile: PropTypes.func.isRequired,
filteredType: PropTypes.oneOf([