mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: delete image preview after modal close (#511)
This commit is contained in:
parent
6962d7718f
commit
19434342d3
@ -14,7 +14,7 @@ import { PrimaryButton, SecondaryButton } from "components/ui";
|
|||||||
// icons
|
// icons
|
||||||
import { UserCircleIcon } from "components/icons";
|
import { UserCircleIcon } from "components/icons";
|
||||||
|
|
||||||
type TImageUploadModalProps = {
|
type Props = {
|
||||||
value?: string | null;
|
value?: string | null;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@ -22,7 +22,7 @@ type TImageUploadModalProps = {
|
|||||||
userImage?: boolean;
|
userImage?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ImageUploadModal: React.FC<TImageUploadModalProps> = ({
|
export const ImageUploadModal: React.FC<Props> = ({
|
||||||
value,
|
value,
|
||||||
onSuccess,
|
onSuccess,
|
||||||
isOpen,
|
isOpen,
|
||||||
@ -59,6 +59,7 @@ export const ImageUploadModal: React.FC<TImageUploadModalProps> = ({
|
|||||||
const imageUrl = res.asset;
|
const imageUrl = res.asset;
|
||||||
onSuccess(imageUrl);
|
onSuccess(imageUrl);
|
||||||
setIsImageUploading(false);
|
setIsImageUploading(false);
|
||||||
|
setImage(null);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@ -70,6 +71,7 @@ export const ImageUploadModal: React.FC<TImageUploadModalProps> = ({
|
|||||||
const imageUrl = res.asset;
|
const imageUrl = res.asset;
|
||||||
onSuccess(imageUrl);
|
onSuccess(imageUrl);
|
||||||
setIsImageUploading(false);
|
setIsImageUploading(false);
|
||||||
|
setImage(null);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
@ -77,6 +79,7 @@ export const ImageUploadModal: React.FC<TImageUploadModalProps> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
|
setImage(null);
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,14 +19,14 @@ export const LinearProgressIndicator: React.FC<Props> = ({ data }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip key={item.id} tooltipContent={`${item.name} ${Math.round(item.value)}%`}>
|
<Tooltip key={item.id} tooltipContent={`${item.name} ${Math.round(item.value)}%`}>
|
||||||
<div className="bar" style={style} />
|
<div style={style} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-1 w-full items-center justify-between gap-1">
|
<div className="flex h-1 w-full items-center justify-between gap-1">
|
||||||
{total === 0 ? " - 0%" : <div className="flex h-full w-full gap-1 rounded-md">{bars}</div>}
|
{total === 0 ? " - 0%" : <div className="flex h-full w-full gap-1">{bars}</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user