🚚 Move new-frontend to frontend (#652)
This commit is contained in:
23
frontend/src/hooks/useCustomToast.ts
Normal file
23
frontend/src/hooks/useCustomToast.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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