adrema/resources/livewire-js/toastify.js

28 lines
608 B
JavaScript
Raw Permalink Normal View History

2024-10-14 20:25:11 +02:00
import Toastify from 'toastify-js';
import 'toastify-js/src/toastify.css';
const defaultToast = {
duration: 3000,
gravity: 'bottom', // `top` or `bottom`
position: 'right', // `left`, `center` or `right`
style: {
background: 'none',
},
};
export function success(message) {
Toastify({
...defaultToast,
text: message,
className: '!bg-green-700 !text-green-100',
}).showToast();
}
export function error(message) {
Toastify({
...defaultToast,
text: message,
className: '!bg-red-700 !text-red-100',
}).showToast();
}