1
Fork 0
tildes-shepherd/source/tours/shared/tour-error.tsx

30 lines
604 B
TypeScript
Raw Permalink Normal View History

import Shepherd from "shepherd.js";
import {renderInContainer} from "../utilities.js";
2023-07-02 10:04:29 +00:00
/**
* Start an ad-hoc tour to display an error message.
* @param text The message to show.
*/
export function showTourError(text: string) {
const tour = new Shepherd.Tour({
defaultStepOptions: {
buttons: [
{
classes: "btn",
text: "Continue",
action() {
this.complete();
},
},
],
},
useModalOverlay: true,
});
tour.addStep({
text: renderInContainer(<p class="tish-warning">{text}</p>),
});
tour.start();
}