diff --git a/src/allPages.ts b/src/allPages.ts index 821a4ea..0654cd8 100644 --- a/src/allPages.ts +++ b/src/allPages.ts @@ -16,7 +16,7 @@ import { TOTPViewPage } from "./pages/TOTP/TOTPView"; import { TransitDecryptPage } from "./pages/Transit/TransitDecrypt.js"; import { TransitEncryptPage } from "./pages/Transit/TransitEncrypt.js"; import { TransitViewPage } from "./pages/Transit/TransitView"; -import { TransitViewSecretPage } from "./pages/Transit/TransitViewSecret.js"; +import { TransitViewSecretPage } from "./pages/Transit/TransitViewSecret"; import { UnsealPage } from "./pages/Unseal"; type pagesList = { diff --git a/src/pages/Transit/TransitViewSecret.js b/src/pages/Transit/TransitViewSecret.ts similarity index 84% rename from src/pages/Transit/TransitViewSecret.js rename to src/pages/Transit/TransitViewSecret.ts index 33b3b9b..3741c8a 100644 --- a/src/pages/Transit/TransitViewSecret.js +++ b/src/pages/Transit/TransitViewSecret.ts @@ -1,18 +1,25 @@ import { Page } from "../../types/Page"; import { changePage, setPageContent, setTitleElement } from "../../pageUtils"; import { makeElement } from "../../htmlUtils"; -import { pageState } from "../../globalPageState.ts"; +import { pageState } from "../../globalPageState"; import i18next from 'i18next'; export class TransitViewSecretPage extends Page { constructor() { super(); } - goBack() { + + goBack(): void { changePage("TRANSIT_VIEW"); } - makeTile(title, description, icon, iconText, onclick = _ => { }) { + makeTile( + title: string, + description: string, + icon: string, + iconText: string, + onclick: () => void = () => { } + ): HTMLElement { return makeElement({ tag: "a", class: "uk-link-heading", @@ -45,7 +52,7 @@ export class TransitViewSecretPage extends Page { }); } - async render() { + async render(): Promise { setTitleElement(pageState); setPageContent(makeElement({ tag: "div", @@ -64,14 +71,14 @@ export class TransitViewSecretPage extends Page { i18next.t("transit_view_encrypt_description"), "lock", i18next.t("transit_view_encrypt_icon_text"), - _ => { changePage("TRANSIT_ENCRYPT"); } + () => { changePage("TRANSIT_ENCRYPT"); } ), this.makeTile( i18next.t("transit_view_decrypt_text"), i18next.t("transit_view_decrypt_description"), "mail", i18next.t("transit_view_decrypt_icon_text"), - _ => { changePage("TRANSIT_DECRYPT"); } + () => { changePage("TRANSIT_DECRYPT"); } ), ] }), @@ -80,7 +87,7 @@ export class TransitViewSecretPage extends Page { })); } - get name() { + get name(): string { return i18next.t("transit_view_secret_title"); } } \ No newline at end of file