Only show image editing icon in composition area
This commit is contained in:
parent
e79fb9d2e5
commit
a0c61e5b4a
2 changed files with 4 additions and 1 deletions
|
@ -641,6 +641,7 @@ export const CompositionArea = ({
|
||||||
<div className="CompositionArea__attachment-list">
|
<div className="CompositionArea__attachment-list">
|
||||||
<AttachmentList
|
<AttachmentList
|
||||||
attachments={draftAttachments}
|
attachments={draftAttachments}
|
||||||
|
canEditImages
|
||||||
i18n={i18n}
|
i18n={i18n}
|
||||||
onAddAttachment={launchAttachmentPicker}
|
onAddAttachment={launchAttachmentPicker}
|
||||||
onClickAttachment={maybeEditAttachment}
|
onClickAttachment={maybeEditAttachment}
|
||||||
|
|
|
@ -20,6 +20,7 @@ import {
|
||||||
|
|
||||||
export type Props<T extends AttachmentType | AttachmentDraftType> = Readonly<{
|
export type Props<T extends AttachmentType | AttachmentDraftType> = Readonly<{
|
||||||
attachments: ReadonlyArray<T>;
|
attachments: ReadonlyArray<T>;
|
||||||
|
canEditImages?: boolean;
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
onAddAttachment?: () => void;
|
onAddAttachment?: () => void;
|
||||||
onClickAttachment?: (attachment: T) => void;
|
onClickAttachment?: (attachment: T) => void;
|
||||||
|
@ -50,6 +51,7 @@ function getUrl(
|
||||||
|
|
||||||
export const AttachmentList = <T extends AttachmentType | AttachmentDraftType>({
|
export const AttachmentList = <T extends AttachmentType | AttachmentDraftType>({
|
||||||
attachments,
|
attachments,
|
||||||
|
canEditImages,
|
||||||
i18n,
|
i18n,
|
||||||
onAddAttachment,
|
onAddAttachment,
|
||||||
onClickAttachment,
|
onClickAttachment,
|
||||||
|
@ -119,7 +121,7 @@ export const AttachmentList = <T extends AttachmentType | AttachmentDraftType>({
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isImage) {
|
if (isImage && canEditImages) {
|
||||||
return (
|
return (
|
||||||
<div className="module-attachments--editable">
|
<div className="module-attachments--editable">
|
||||||
{imgElement}
|
{imgElement}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue