From d289a5b9182052ec0068735106fc35fef04d3f22 Mon Sep 17 00:00:00 2001 From: cv <34649812+cpvalente@users.noreply.github.com> Date: Sat, 10 Apr 2021 11:29:52 +0200 Subject: [PATCH] create global toast def --- client/src/common/helpers/toastManager.jsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 client/src/common/helpers/toastManager.jsx diff --git a/client/src/common/helpers/toastManager.jsx b/client/src/common/helpers/toastManager.jsx new file mode 100644 index 000000000..3d6e417db --- /dev/null +++ b/client/src/common/helpers/toastManager.jsx @@ -0,0 +1,16 @@ +import { createStandaloneToast } from '@chakra-ui/react'; + +const toast = createStandaloneToast(); +// const customToast = createStandaloneToast({ theme: yourCustomTheme }) + +// error toast +export const showErrorToast = (title, description) => { + toast({ + title: title, + description: description, + position: 'top-left', + variant: 'subtle', + status: 'error', + isClosable: true, + }); +};