summary refs log tree commit diff
path: root/v2/screen
diff options
context:
space:
mode:
Diffstat (limited to 'v2/screen')
-rw-r--r--v2/screen/home.ts21
-rw-r--r--v2/screen/login.ts9
2 files changed, 26 insertions, 4 deletions
diff --git a/v2/screen/home.ts b/v2/screen/home.ts
index 6fb4f24..4c8a7cc 100644
--- a/v2/screen/home.ts
+++ b/v2/screen/home.ts
@@ -1,5 +1,6 @@
 import { ElemType } from "../screenbuilder.ts";
 import { Screen } from "../screen.ts";
+import type { Input } from "../elements.ts";
 import * as client from "../client.ts"
 
 export default {
@@ -7,21 +8,33 @@ export default {
         {
             type: ElemType.TextElem,
             id: 'home',
-            data: ["Username: \n"]
+            data: ["Loading home posts...\n"]
+        },
+        {
+            type: ElemType.HR,
+            id: 'hr',
+            data: []
         },
         {
             type: ElemType.InputElem,
             id: 'msg-input',
-            data: [false, false]
+            data: [false, false, true]
         },
         {
             type: ElemType.ButtonElem,
             id: 'done-btn',
             data: ["Send", async function (this: Screen) {
-                
+                const msgInput: Input = this.elements.get('msg-input') as Input
+                client.sendHome(msgInput.value);
+                msgInput.value = ""
+                this.render()
             }]
         }
     ],
     focus: "msg-input",
-    name: 'home'
+    name: 'home',
+    onload (screen: Screen) {
+        client.setScreen(screen)
+        client.loadHome(screen)
+    }
 }
\ No newline at end of file
diff --git a/v2/screen/login.ts b/v2/screen/login.ts
index 525127b..bc39655 100644
--- a/v2/screen/login.ts
+++ b/v2/screen/login.ts
@@ -17,6 +17,10 @@ export default {
             data: [false]
         },
         {
+            type: ElemType.BR,
+            id: 'naoiuou'
+        },
+        {
             type: ElemType.TextElem,
             id: 'password-label',
             data: ["Password: \n"]
@@ -27,9 +31,14 @@ export default {
             data: [true]
         },
         {
+            type: ElemType.BR,
+            id: 'faij0ifsj'
+        },
+        {
             type: ElemType.ButtonElem,
             id: 'done-btn',
             data: ["Done", async function (this: Screen) {
+                client.setScreen(this)
                 this.off()
                 this.logs.push(`clicked button`)
                 console.clear()