diff options
author | wlodekm <[email protected]> | 2024-11-09 16:37:43 +0200 |
---|---|---|
committer | wlodekm <[email protected]> | 2024-11-09 16:37:43 +0200 |
commit | 22a2150eef88430f9d9d5491a002e23e7813ac0c (patch) | |
tree | 16e275e98e7a358f617a5404230e894db267eee1 /v2/screen | |
parent | 12617679441c80cb827cb486e269b56c14b055f4 (diff) |
v2 progress
Diffstat (limited to 'v2/screen')
-rw-r--r-- | v2/screen/home.ts | 27 | ||||
-rw-r--r-- | v2/screen/login.ts | 15 |
2 files changed, 41 insertions, 1 deletions
diff --git a/v2/screen/home.ts b/v2/screen/home.ts new file mode 100644 index 0000000..6fb4f24 --- /dev/null +++ b/v2/screen/home.ts @@ -0,0 +1,27 @@ +import { ElemType } from "../screenbuilder.ts"; +import { Screen } from "../screen.ts"; +import * as client from "../client.ts" + +export default { + elements: [ + { + type: ElemType.TextElem, + id: 'home', + data: ["Username: \n"] + }, + { + type: ElemType.InputElem, + id: 'msg-input', + data: [false, false] + }, + { + type: ElemType.ButtonElem, + id: 'done-btn', + data: ["Send", async function (this: Screen) { + + }] + } + ], + focus: "msg-input", + name: 'home' +} \ No newline at end of file diff --git a/v2/screen/login.ts b/v2/screen/login.ts index c9e4fec..525127b 100644 --- a/v2/screen/login.ts +++ b/v2/screen/login.ts @@ -1,4 +1,8 @@ import { ElemType } from "../screenbuilder.ts"; +import { Screen } from "../screen.ts"; +import * as client from "../client.ts" +import { build } from "../screenbuilder.ts"; +import HomeScreen from "./home.ts"; export default { elements: [ @@ -25,7 +29,16 @@ export default { { type: ElemType.ButtonElem, id: 'done-btn', - data: ["Done"] + data: ["Done", async function (this: Screen) { + this.off() + this.logs.push(`clicked button`) + console.clear() + console.log("logging in...") + //@ts-ignore + await client.login(this.elements.get("username-input").value, this.elements.get("password-input").value) + build(HomeScreen); + client + }] } ], focus: "username-input", |