Skip to content

Commit

Permalink
add features popup to login page
Browse files Browse the repository at this point in the history
  • Loading branch information
loudar committed Jun 19, 2024
1 parent 6cd64ed commit d0c1745
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions ui/templates/UserTemplates.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {create, ifjs, signal, store} from "https://fjs.targoninc.com/f.js";
import {Auth} from "../js/Auth.mjs";
import {GenericTemplates} from "./GenericTemplates.mjs";
import {StoreKeys} from "../js/StoreKeys.mjs";
import {ChatTemplates} from "./ChatTemplates.mjs";

export class UserTemplates {
static login(router) {
Expand Down Expand Up @@ -29,12 +30,17 @@ export class UserTemplates {
.classes("login-error")
.build(),
).build(),
GenericTemplates.buttonWithSpinner("Log in", async () => {
isLoading.value = true;
await Auth.authorizeFromForm(router, () => {
isLoading.value = false;
});
}, "login", isLoading, [buttonClass]),
create("div")
.classes("flex", "align-content")
.children(
ChatTemplates.featureButton(),
GenericTemplates.buttonWithSpinner("Log in", async () => {
isLoading.value = true;
await Auth.authorizeFromForm(router, () => {
isLoading.value = false;
});
}, "login", isLoading, [buttonClass]),
).build(),
ifjs(store().get(StoreKeys.isCheckingAuth), create("div")
.classes("flex", "align-content")
.children(
Expand Down

0 comments on commit d0c1745

Please sign in to comment.