]> Repos - mime-chat/commitdiff
add mock message test
authorriqo <hernandeze2@xavier.edu>
Mon, 15 Feb 2021 15:26:36 +0000 (09:26 -0600)
committerriqo <hernandeze2@xavier.edu>
Mon, 15 Feb 2021 15:26:36 +0000 (09:26 -0600)
src/components/messageView/index.vue
src/components/messageView/viewDetails/visualizer.ts
src/modules/scrollView.ts
src/views/home.vue
src/views/mockMessages.ts [new file with mode: 0644]

index a93a69b5890fbc65ac4f85936899a489ec979868..c3d9c99e3dc53b36eef24dd41db95ccfaf8b287c 100644 (file)
@@ -51,8 +51,9 @@ export default defineComponent({
 
       emitter.on("animateSend", async (message) => {
         try {
-          await invoke(message);
-          renderArr.push(data.value);
+            renderArr.push(message)
+          // await invoke(message);
+          //renderArr.push(data.value);
         } catch (e) {
           console.log("No response. Do not render.");
         }
index 33024da3df39329c3b662aa1dc4dd2b8b9ca45a5..455381fd6a7041d035e92c1efa8f66148b621605 100644 (file)
@@ -55,12 +55,7 @@ export default function useMessageView(): {
         if (el) {
             if (shift) {
 
-                console.log(messageOffset.y)
-                if (messageOffset.y < 445 && messageOffset.y < 500) {
-                    shiftOffset -= 15;
-                } else {
-                    shiftOffset -= el.getBBox().height + messagePadding;
-                }
+                shiftOffset -= el.getBBox().height + messagePadding;
             }
             animateMessage(el);
         }
index 8fea63ffc04a66537b834732a5e8e9d714a9bef3..303266737e76798e92d1a38980177210f598b377 100644 (file)
@@ -1,7 +1,7 @@
 import { ref, computed, onMounted, onUnmounted } from "vue";
 
 /**
- * handles visualization of view messages through 
+ * handles visualization of view messages through
  * vue transition callbacks and anime-js animations
  */
 export default function useScrollView({ targetId }: { targetId: string }) {
index 2250cc6716fbf4b6ef79f433f3c2b88b9c58cf14..b57a56b7908c0a03e0e48563211a1fdcb4fecce9 100644 (file)
 <script lang="ts">
 import MessageView from "@/components/messageView/index.vue";
 import TextAudioInput from "@/components/taInput/index.vue";
-import { defineComponent } from "vue";
+import { defineComponent, ref } from "vue";
+import {Messages} from './mockMessages';
+import useMitt from "@/modules/mitt";
 
 export default defineComponent({
   name: "Messenger",
   components: { MessageView, TextAudioInput },
+  setup() {
+     const { emitter } = useMitt();
+     const counter = ref(0);
+
+      const emittMessage = () => {
+          console.log('testing')
+            counter.value++;
+            emitter.emit('animateSend', Messages[counter.value])
+          }
+          return {
+                  emittMessage
+              }
+  }
 });
 </script>
 
diff --git a/src/views/mockMessages.ts b/src/views/mockMessages.ts
new file mode 100644 (file)
index 0000000..7cb4908
--- /dev/null
@@ -0,0 +1,160 @@
+import { Message } from "@/types/message/index";
+
+export const Messages: Message[] = [
+    {
+        content: "Welcome",
+        context: "ai",
+        subContext: "",
+        modifier: "ai",
+        id: "2",
+        time: ""
+    },
+    {
+        content:
+            "add friend",
+        context: "launch",
+        subContext: "",
+        modifier: "sf",
+        id: "1",
+        time: ""
+    },
+    {
+        content: "Did you mean to addcontact?",
+        context: "addcontact",
+        subContext: "",
+        modifier: "ai",
+        id: "5",
+        time: ""
+    },
+    {
+        content: "yes",
+        context: "fulfill",
+        subContext: "",
+        modifier: "sf",
+        id: "6",
+        time: ""
+    },
+
+    {
+        content: "Hey Anna, did you get the paper done?",
+        context: "Mesage from Tommy McConville",
+        subContext: "New Conversation",
+        modifier: "ai",
+        id: "3",
+        time: ""
+    },
+    {
+        content: "Hey do you know Enrique Hernandez?",
+        context: "Message from Crimata",
+        subContext: "",
+        modifier: "ai",
+        id: "7",
+        time: ""
+    },
+
+    {
+        content: "Yes posting it online soon.",
+        context: "You to Tommy McConville",
+        subContext: "",
+        modifier: "sf",
+        id: "4",
+        time: ""
+    },
+    {
+        content: "Hey do you know Enrique Hernandez?",
+        context: "Message from Crimata",
+        subContext: "",
+        modifier: "ai",
+        id: "8",
+        time: ""
+    },
+    {
+        content: "Hey Anna, did you get the paper done?",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "9",
+        time: ""
+    },
+    {
+        content: "Hey Anna, did you get the paper done?",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "10",
+        time: ""
+    },
+    {
+        content: "Yes posting it online soon.",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "sf",
+        id: "11",
+        time: ""
+    },
+    {
+        content:
+            "I can be there at 5 pm tomorrow to greet you at a Chick file with my almond and chive salad.",
+        context: "You to Tommy McConville",
+        subContext: "",
+        modifier: "sf",
+        id: "12",
+        time: ""
+    },
+    {
+        content: "Hey Anna, did you get the paper done?",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "13",
+        time: ""
+    },
+    {
+        content: "Hey Anna, did you get the paper done?",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "14",
+        time: ""
+    },
+    {
+        content: "Yes posting it online soon.",
+        context: "You to Tommy McConville",
+        subContext: "",
+        modifier: "sf",
+        id: "15",
+        time: ""
+    },
+    {
+        content: "Sweet, thanks!",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "16",
+        time: ""
+    },
+    {
+        content: "Hey do you know Enrique Hernandez?",
+        context: "Message from Crimata AI",
+        subContext: "",
+        modifier: "ai",
+        id: "17",
+        time: ""
+    },
+    {
+        content: "Yes posting it online soon.",
+        context: "You to Tommy McConville",
+        subContext: "",
+        modifier: "sf",
+        id: "18",
+        time: ""
+    },
+    {
+        content: "Sweet, thanks!",
+        context: "Message from Tommy McConville",
+        subContext: "",
+        modifier: "ai",
+        id: "19",
+        time: ""
+    },
+];