From a2d9f02e8cf0589a47e994115749e49b81777d54 Mon Sep 17 00:00:00 2001 From: Jan Mach Date: Fri, 12 Aug 2022 17:56:24 +0200 Subject: [PATCH] hinter - title & actionTitle optional override --- src/tutorials/hint.ts | 10 ++++++++++ src/tutorials/hinter.ts | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/tutorials/hint.ts b/src/tutorials/hint.ts index bb945a4..9974f2d 100644 --- a/src/tutorials/hint.ts +++ b/src/tutorials/hint.ts @@ -11,4 +11,14 @@ export interface Hint { * HTML content. */ content: string; + + /** + * Optional override of the title of the hint. + */ + title?: string; + + /** + * Optional override of the close button text of the hint. + */ + actionTitle?: string; } \ No newline at end of file diff --git a/src/tutorials/hinter.ts b/src/tutorials/hinter.ts index 0de742c..7d0a9a7 100644 --- a/src/tutorials/hinter.ts +++ b/src/tutorials/hinter.ts @@ -1,6 +1,6 @@ import { ILayoutService } from "../layouts"; import { Router } from "../routing"; -import { ViewManager } from "./../ui"; +import { ViewManager } from "../ui"; import { EventManager } from "../events"; import { ISettingsProvider } from "../configuration"; import { Hint } from "./hint"; @@ -31,8 +31,8 @@ export class Hinter { this.activeHintKey = hint.key; - const toast = this.viewManager.addToast("Did you know?", hint.content, [{ - title: "Got it", + const toast = this.viewManager.addToast(hint.title ?? "Did you know?", hint.content, [{ + title: hint.actionTitle ?? "Got it", action: async () => { await this.localSettings.setSetting(hintSettingName, true); this.viewManager.removeToast(toast);