fix: accept image in edit page

This commit is contained in:
jialin
2025-04-23 15:51:48 +08:00
parent 9bb7a125e3
commit a46286872d
6 changed files with 54 additions and 25 deletions
+5 -2
View File
@@ -53,6 +53,7 @@ type CanvasImageEditorProps = {
handleUpdateImageList: (fileList: any[]) => void;
handleUpdateMaskList: (fileList: any[]) => void;
uploadButton?: React.ReactNode;
accept?: string;
imageStatus: {
isOriginal: boolean;
isResetNeeded: boolean;
@@ -70,11 +71,12 @@ const CanvasImageEditor: React.FC<CanvasImageEditorProps> = forwardRef(
imageSrc,
disabled: isDisabled,
imageStatus,
maskUpload,
accept,
onSave,
onScaleImageSize,
handleUpdateImageList,
handleUpdateMaskList,
maskUpload
handleUpdateMaskList
},
ref
) => {
@@ -544,6 +546,7 @@ const CanvasImageEditor: React.FC<CanvasImageEditorProps> = forwardRef(
lineWidth={lineWidth}
invertMask={invertMask}
loading={loading}
accept={accept}
></ToolsBar>
<ImageActionsBar
+4 -2
View File
@@ -19,6 +19,7 @@ interface ToolsBarProps {
lineWidth: number;
uploadButton?: React.ReactNode;
invertMask?: boolean;
accept?: string;
handleBrushSizeChange: (value: number) => void;
undo: () => void;
onClear: () => void;
@@ -33,6 +34,7 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
loading,
lineWidth,
invertMask,
accept,
handleBrushSizeChange,
undo,
onClear,
@@ -97,7 +99,7 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
disabled={loading || invertMask}
handleUpdateImgList={handleUpdateImageList}
size="middle"
accept="image/*"
accept={accept}
></UploadImg>
<UploadImg
title={intl.formatMessage({
@@ -107,7 +109,7 @@ const ToolsBar: React.FC<ToolsBarProps> = (props) => {
disabled={loading || invertMask}
handleUpdateImgList={handleUpdateMaskList}
size="middle"
accept="image/*"
accept={accept}
></UploadImg>
<Tooltip title={intl.formatMessage({ id: 'playground.image.fitview' })}>
<Button