2023-07-01 13:46:23 +00:00
|
|
|
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.
|
|
|
|
*/
|
2023-07-01 13:46:23 +00:00
|
|
|
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();
|
|
|
|
}
|