✨ Migrate to TanStack Query (React Query) and TanStack Router (#637)
This commit is contained in:
21
new-frontend/src/hooks/useCustomToast.ts
Normal file
21
new-frontend/src/hooks/useCustomToast.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import { useToast } from '@chakra-ui/react';
|
||||
|
||||
const useCustomToast = () => {
|
||||
const toast = useToast();
|
||||
|
||||
const showToast = useCallback((title: string, description: string, status: 'success' | 'error') => {
|
||||
toast({
|
||||
title,
|
||||
description,
|
||||
status,
|
||||
isClosable: true,
|
||||
position: 'bottom-right'
|
||||
});
|
||||
}, [toast]);
|
||||
|
||||
return showToast;
|
||||
};
|
||||
|
||||
export default useCustomToast;
|
Reference in New Issue
Block a user