diff --git a/src/pages/Access/AccessHome.ts b/src/pages/Access/AccessHome.ts deleted file mode 100644 index 9ffe97a..0000000 --- a/src/pages/Access/AccessHome.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { Page } from "../../types/Page"; -import { Tile } from "../../elements/Tile"; -import { makeElement } from "z-makeelement"; -import { prePageChecks, setErrorText } from "../../pageUtils"; -import i18next from "i18next"; - -export class AccessHomePage extends Page { - constructor() { - super(); - } - async goBack(): Promise { - await this.router.changePage("HOME"); - } - async render(): Promise { - await this.router.setPageContent(""); - if (!(await prePageChecks(this.router))) return; - - await this.router.setPageContent( - makeElement({ - tag: "div", - class: "uk-child-width-1-1@s uk-child-width-1-2@m uk-grid-small uk-grid-match", - attributes: { "uk-grid": "" }, - children: [ - Tile({ - title: i18next.t("access_auth_methods_title"), - description: i18next.t("access_auth_methods_description"), - icon: "sign-in", - onclick: async () => { - await this.router.changePage("AUTH_HOME"); - }, - }), - Tile({ - title: i18next.t("access_entities_title"), - description: i18next.t("access_entities_description"), - icon: "user", - onclick: async () => { - setErrorText(i18next.t("not_implemented")); - //await this.router.changePage("SECRETS_HOME"); - }, - }), - Tile({ - title: i18next.t("access_groups_title"), - description: i18next.t("access_groups_description"), - icon: "users", - onclick: async () => { - setErrorText(i18next.t("not_implemented")); - //await this.router.changePage("SECRETS_HOME"); - }, - }), - Tile({ - title: i18next.t("access_leases_title"), - description: i18next.t("access_leases_description"), - icon: "unlock", - onclick: async () => { - setErrorText(i18next.t("not_implemented")); - //await this.router.changePage("SECRETS_HOME"); - }, - }), - ], - }), - ); - } - get name(): string { - return i18next.t("access_home_page_title"); - } -} diff --git a/src/pages/Access/AccessHome.tsx b/src/pages/Access/AccessHome.tsx new file mode 100644 index 0000000..46fe9e6 --- /dev/null +++ b/src/pages/Access/AccessHome.tsx @@ -0,0 +1,51 @@ +import { Page } from "../../types/Page"; +import { Tile } from "../../elements/ReactTile"; +import { notImplemented, prePageChecks } from "../../pageUtils"; +import { render } from "preact"; +import i18next from "i18next"; + +export class AccessHomePage extends Page { + constructor() { + super(); + } + async goBack(): Promise { + await this.router.changePage("HOME"); + } + async render(): Promise { + await this.router.setPageContent(""); + if (!(await prePageChecks(this.router))) return; + + render( +
+ await this.router.changePage("AUTH_HOME")} + /> + notImplemented()} + /> + notImplemented()} + /> + notImplemented()} + /> +
, + this.router.pageContentElement, + ); + } + get name(): string { + return i18next.t("access_home_page_title"); + } +}