feat: switch to new toast provider
This commit is contained in:
parent
a19eb6bcda
commit
2c8880c84d
8 changed files with 151 additions and 49 deletions
14
app/utils/toast.ts
Normal file
14
app/utils/toast.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { ToastQueue } from '@react-stately/toast';
|
||||
import React from 'react';
|
||||
|
||||
const toastQueue = new ToastQueue<React.ReactNode>({
|
||||
maxVisibleToasts: 7,
|
||||
});
|
||||
|
||||
export function useToastQueue() {
|
||||
return toastQueue;
|
||||
}
|
||||
|
||||
export default function toast(content: React.ReactNode, duration = 3000) {
|
||||
return toastQueue.add(content, { timeout: duration });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue