fix alert provider | remove alert from notes and contact

This commit is contained in:
Christopher committed 2021-02-13 13:48:05 +01:00
1 parent 9ba8bd683f
commit b4258718d8
13 files changed
+67 -175

No files matched your search

+8 -1
View File
@@ -1,8 +1,15 @@
import { useContext } from 'react';
import { SnackbarContext } from '../components/SnackbarProvider';
export interface IAlert {
message: string;
type: 'success' | 'error'
}
interface ISnackBar {
addAlert: (message: string, type: 'success' | 'error') => void;
addAlert: ({ message, type}: IAlert) => void;
alert: IAlert | null;
}
export const useSnackbar = (): ISnackBar => useContext(SnackbarContext);