mango-token-sale/utils/notifications.tsx

21 lines
434 B
TypeScript
Raw Normal View History

2021-04-25 08:03:30 -07:00
import useNotificationStore from '../stores/useNotificationStore'
export function notify(newNotification: {
type?: string
message: string
description?: string
txid?: string
}) {
const {
notifications,
set: setNotificationStore,
} = useNotificationStore.getState()
setNotificationStore((state) => {
state.notifications = [
...notifications,
{ type: 'success', ...newNotification },
]
})
}