-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jeroen Branje <[email protected]>
- Loading branch information
1 parent
4ebce65
commit f53799e
Showing
6 changed files
with
17 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 6 additions & 7 deletions
13
apps/envited.ascs.digital/common/notifications/useNotification.hook.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { toast } from 'react-toastify' | ||
|
||
// export const notification = (notify: typeof toast) => { | ||
export const useNotification = () => { | ||
const info = (content: string) => toast(content) | ||
export const notification = (notify: typeof toast) => { | ||
const info = (content: string) => notify(content) | ||
|
||
const success = (content: string) => toast.success(content) | ||
const success = (content: string) => notify.success(content) | ||
|
||
const error = (content: string) => toast.error(content) | ||
const error = (content: string) => notify.error(content) | ||
|
||
const warning = (content: string) => toast.warning(content) | ||
const warning = (content: string) => notify.warning(content) | ||
|
||
return { info, success, error, warning } | ||
} | ||
|
||
// export const useNotification = notification(toast) | ||
export const useNotification = () => notification(toast) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { NotifiactionContainer } from './Notifications' | ||
export { NotificationContainer } from './Notifications' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.