Only show image editing icon in composition area

This commit is contained in:
Josh Perez
2022-02-02 10:31:16 -05:00
committed by GitHub
parent e79fb9d2e5
commit a0c61e5b4a
2 changed files with 4 additions and 1 deletions

View File

@@ -641,6 +641,7 @@ export const CompositionArea = ({
<div className="CompositionArea__attachment-list">
<AttachmentList
attachments={draftAttachments}
canEditImages
i18n={i18n}
onAddAttachment={launchAttachmentPicker}
onClickAttachment={maybeEditAttachment}

View File

@@ -20,6 +20,7 @@ import {
export type Props<T extends AttachmentType | AttachmentDraftType> = Readonly<{
attachments: ReadonlyArray<T>;
canEditImages?: boolean;
i18n: LocalizerType;
onAddAttachment?: () => void;
onClickAttachment?: (attachment: T) => void;
@@ -50,6 +51,7 @@ function getUrl(
export const AttachmentList = <T extends AttachmentType | AttachmentDraftType>({
attachments,
canEditImages,
i18n,
onAddAttachment,
onClickAttachment,
@@ -119,7 +121,7 @@ export const AttachmentList = <T extends AttachmentType | AttachmentDraftType>({
/>
);
if (isImage) {
if (isImage && canEditImages) {
return (
<div className="module-attachments--editable">
{imgElement}