Skip to content

hinter - title & actionTitle optional override #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/tutorials/hint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
6 changes: 3 additions & 3 deletions src/tutorials/hinter.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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);
Expand Down