feat(annotation): add toast feedback to annotation templates (#18116)

This commit is contained in:
Kamil Gabryjelski 2022-01-24 11:41:39 +01:00 committed by GitHub
parent 4b89ac7447
commit 9fa2812343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import { AnnotationLayerObject } from './types';
interface AnnotationLayerModalProps {
addDangerToast: (msg: string) => void;
addSuccessToast: (msg: string) => void;
layer?: AnnotationLayerObject | null;
onLayerAdd?: (layer?: AnnotationLayerObject) => void;
onHide: () => void;
@ -80,6 +81,7 @@ const LayerContainer = styled.div`
const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
addDangerToast,
addSuccessToast,
onLayerAdd,
onHide,
show,
@ -134,6 +136,7 @@ const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
}
hide();
addSuccessToast(t('Annotation template updated'));
});
}
} else if (currentLayer) {
@ -148,6 +151,7 @@ const AnnotationLayerModal: FunctionComponent<AnnotationLayerModalProps> = ({
}
hide();
addSuccessToast(t('Annotation template created'));
});
}
};