From 90b37f72971e3d4564ae7a7cb7f1be00baef19e4 Mon Sep 17 00:00:00 2001 From: reddigriz Date: Mon, 5 Sep 2022 17:22:33 +0200 Subject: [PATCH] Creato componente contenitore messaggio, impostata bozza della visualizzazione di una chat TODO Routing e Keyboard --- geografia-vue/package.json | 2 +- geografia-vue/src/components/ChatHistory.vue | 11 +--- geografia-vue/src/components/ChatList.vue | 20 ++++--- geografia-vue/src/components/ChatMsg.vue | 60 ++++++++++++++++++-- geografia-vue/src/components/ChatPreview.vue | 10 ---- geografia-vue/src/components/ChatView.vue | 19 +++++++ 6 files changed, 90 insertions(+), 32 deletions(-) create mode 100644 geografia-vue/src/components/ChatView.vue diff --git a/geografia-vue/package.json b/geografia-vue/package.json index 916fb9b..a3c52c9 100644 --- a/geografia-vue/package.json +++ b/geografia-vue/package.json @@ -2,7 +2,7 @@ "name": "geografia_vue", "version": "0.0.0", "scripts": { - "dev": "vite", + "dev": "vite --host", "build": "vite build", "preview": "vite preview --port 4173", "test:unit": "vitest --environment jsdom", diff --git a/geografia-vue/src/components/ChatHistory.vue b/geografia-vue/src/components/ChatHistory.vue index bbf89c5..19c2246 100644 --- a/geografia-vue/src/components/ChatHistory.vue +++ b/geografia-vue/src/components/ChatHistory.vue @@ -1,19 +1,12 @@ diff --git a/geografia-vue/src/components/ChatList.vue b/geografia-vue/src/components/ChatList.vue index a19c84f..78a634c 100644 --- a/geografia-vue/src/components/ChatList.vue +++ b/geografia-vue/src/components/ChatList.vue @@ -1,18 +1,23 @@ @@ -25,10 +30,11 @@ export default { chats: { id: 1, name: "test-name", - last_msg: "test-msg", + last_msg: "🐱⛸️➡️?", seen: false, date: "25/08/22", new_messages: 1, + is_user: false, }, }, }; diff --git a/geografia-vue/src/components/ChatMsg.vue b/geografia-vue/src/components/ChatMsg.vue index 95fb5c6..3c76dba 100644 --- a/geografia-vue/src/components/ChatMsg.vue +++ b/geografia-vue/src/components/ChatMsg.vue @@ -1,15 +1,65 @@ - + diff --git a/geografia-vue/src/components/ChatPreview.vue b/geografia-vue/src/components/ChatPreview.vue index d60fb16..df653e6 100644 --- a/geografia-vue/src/components/ChatPreview.vue +++ b/geografia-vue/src/components/ChatPreview.vue @@ -41,16 +41,6 @@ export default { chatDate: String, chatNewMessages: Number, }, - methods: { - fetchCats(){ - var url = "https://api.thecatapi.com/v1/images/search?api_key=live_wErMWjgaxvhV4nsfoyHxwyvscBbfBW606hsQB6iWeG4oLY0IleWSKrs2XgQaQIYB" - fetch(url).then((response) => { - return response.json() - }).then((data)=>{ - return data.url - }) - }, - } }; diff --git a/geografia-vue/src/components/ChatView.vue b/geografia-vue/src/components/ChatView.vue new file mode 100644 index 0000000..a61ff19 --- /dev/null +++ b/geografia-vue/src/components/ChatView.vue @@ -0,0 +1,19 @@ + + + + + + +