33 lines
883 B
JavaScript
33 lines
883 B
JavaScript
import StakeSuccessToast from "@/components/toasts/StakeSuccessToast.vue";
|
|
import { useToast } from "vue-toastification";
|
|
const toast = useToast();
|
|
|
|
export function showSuccessToast(value, header, subheader, info) {
|
|
|
|
// Define the content object with the component, props and listeners
|
|
const content = {
|
|
component: StakeSuccessToast,
|
|
// Any prop can be passed, but don't expect them to be reactive
|
|
props: {
|
|
value: value,
|
|
header: header,
|
|
subheader: subheader,
|
|
info: info,
|
|
},
|
|
// Listen and react to events using callbacks. In this case we listen for
|
|
// the "click" event emitted when clicking the toast button
|
|
listeners: {},
|
|
};
|
|
|
|
// Render the toast and its contents
|
|
toast(content, {
|
|
position: "top-center",
|
|
icon: false,
|
|
closeOnClick: false,
|
|
toastClassName: "modal-overlay",
|
|
closeButton: false,
|
|
hideProgressBar: true,
|
|
timeout: false,
|
|
});
|
|
}
|