Passaggio dei promps, Header

feature_keyboard
reddigriz 2 years ago
parent 63aa7c73db
commit db59f38f9d

1
.gitignore vendored

@ -24,3 +24,4 @@ node_modules/
# Generated by Cordova # Generated by Cordova
/plugins/ /plugins/
/platforms/ /platforms/
.vscode

@ -1,9 +1,31 @@
<script setup> <script setup>
//TODO: Fixare passaggio promps a header
import ChatList from "@/components/ChatList.vue"; import ChatList from "@/components/ChatList.vue";
import Header from "@/components/Header.vue";
</script> </script>
<template> <template>
<main> <main>
<ChatList /> <Header
:chat-picture="chat-picture"
:chat-name="chat-name"
:header-chat="header-chat"
/>
<ChatList @change-header="changeHeader" />
</main> </main>
</template> </template>
<script>
export default {
chatPicture: { type: String, default: "" },
chatName: { type: String, default: "" },
headerChat: { type: Boolean, default: false },
methods: {
changeHeader(e) {
this.chatPicture = e[1];
this.chatName = e[2];
this.headerChat = true;
},
},
};
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

@ -2,6 +2,7 @@
"history": [ "history": [
{ {
"id": 1, "id": 1,
"picture": "../assets/cat_skate.png",
"name": "test-name1", "name": "test-name1",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,
@ -11,6 +12,7 @@
}, },
{ {
"id": 2, "id": 2,
"picture": "../assets/cat_skate.png",
"name": "test-name2", "name": "test-name2",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,
@ -20,6 +22,7 @@
}, },
{ {
"id": 3, "id": 3,
"picture": "../assets/cat_skate.png",
"name": "test-name3", "name": "test-name3",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,
@ -29,6 +32,7 @@
}, },
{ {
"id": 4, "id": 4,
"picture": "../assets/cat_skate.png",
"name": "test-name4", "name": "test-name4",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,
@ -38,6 +42,7 @@
}, },
{ {
"id": 5, "id": 5,
"picture": "../assets/cat_skate.png",
"name": "test-name5", "name": "test-name5",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,
@ -47,6 +52,7 @@
}, },
{ {
"id": 6, "id": 6,
"picture": "../assets/cat_skate.png",
"name": "test-name6", "name": "test-name6",
"last_message": "🐱⛸️➡️?", "last_message": "🐱⛸️➡️?",
"seen": false, "seen": false,

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69" xmlns:v="https://vecta.io/nano"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>

Before

Width:  |  Height:  |  Size: 308 B

@ -1,19 +1,23 @@
<script setup> <script setup>
//Fix v-if riga 20
import ChatPreview from "@/components/ChatPreview.vue"; import ChatPreview from "@/components/ChatPreview.vue";
import ChatMsg from "@/components/ChatMsg.vue"; import ChatView from "./ChatView.vue";
</script> </script>
<template> <template>
<div id="background"> <div id="background chat-list">
<li :key="chat.id" v-for="chat in $options.demo_chats.history"> <ChatPreview
<ChatPreview v-for="chat in $options.demo_chats.history"
:chat-name="chat.name" :key="chat.id"
:chat-last-message="chat.last_message" :chat-picture="chat.picture"
:chat-seen="chat.seen" :chat-name="chat.name"
:chat-date="chat.date" :chat-last-message="chat.last_message"
:chat-new-messages="chat.new_messages" :chat-seen="chat.seen"
/> :chat-date="chat.date"
</li> :chat-new-messages="chat.new_messages"
@click="showChat(chat)"
/>
<ChatView v-if="selected-chat" />
</div> </div>
</template> </template>
@ -21,6 +25,13 @@ import ChatMsg from "@/components/ChatMsg.vue";
import demo_chats_json from "../assets/demo_chats.json"; import demo_chats_json from "../assets/demo_chats.json";
export default { export default {
demo_chats: demo_chats_json, demo_chats: demo_chats_json,
selectedChat: false,
methods: {
showChat(chat) {
this.$emit("change-header", [chat.picture, chat.name]);
this.selectedChat = true;
},
},
}; };
</script> </script>

@ -1,7 +1,9 @@
<template> <template>
<div class="chat-preview"> <button class="chat-preview">
<div class="chat-picture"> <div class="chat-picture">
<img src="" alt="chat-picture"> <figure>
<img src="chat-picture" alt="chat-picture">
</figure>
</div> </div>
<div class="chat-text"> <div class="chat-text">
<div class="chat-name"> <div class="chat-name">
@ -27,14 +29,14 @@
</div> </div>
</div> </div>
</div> </div>
</div> </button>
</template> </template>
<script> <script>
export default { export default {
setup() {}, setup() {},
props: { props: {
picProfile: String, ChatPicture: String,
chatName: String, chatName: String,
chatLastMessage: String, chatLastMessage: String,
chatSeen: Boolean, chatSeen: Boolean,

@ -6,13 +6,21 @@ import ChatHistory from "./ChatHistory.vue";
<template> <template>
<div> <div>
<ChatHistory /> <ChatHistory />
<v-if="writeMessage" Keyboard /> <button
alt="write-message"
name="write-message"
@click="write-message == true"
>
+
</button>
<Keyboard v-if="write-message" />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
setup() {}, setup() {},
props: { chat: Object },
}; };
</script> </script>

@ -0,0 +1,30 @@
<template>
<header>
<div id="header">
<p>Geografia</p>
</div>
<div v-if="header-chat" id="header-chat">
<div class="chat-picture">
<figure>
<img src="chat-picture" alt="The chat picture" />
</figure>
</div>
<div class="chat-name">
<h3>{{ chatName }}</h3>
</div>
</div>
</header>
</template>
<script>
export default {
setup() {},
props: {
ChatPicture: { type: String, default: "" },
chatName: { type: String, default: "" },
headerChat: { type: Boolean, default: true },
},
};
</script>
<style scoped></style>

@ -1,17 +1,5 @@
<template> <template>
<div class="msg-composition"> <div class="msg-composition"></div>
<KeyboardWord type="subject" />
<KeyboardWord type="object" />
<KeyboardWord type="verb" />
</div>
</template> </template>
<script>
import KeyboardWord from "./KeyboardWord.vue";
export default {
components: { KeyboardWord },
setup() {},
};
</script>
<style scoped></style> <style scoped></style>

@ -0,0 +1,19 @@
<script setup>
import Keyboard from "./Keyboard.vue";
import KeyboardWord from "./KeyboardWord.vue";
</script>
<template>
<div>
<KeyboardWord />
<Keyboard />
</div>
</template>
<script>
export default {
setup() {},
};
</script>
<style scoped></style>

@ -1,8 +1,6 @@
import { createApp } from "vue"; import { createApp } from "vue";
import { createPinia } from "pinia"; import { createPinia } from "pinia";
import App from "./App.vue"; import App from "./App.vue";
import "./assets/main.css"; import "./assets/main.css";
const app = createApp(App); const app = createApp(App);

@ -0,0 +1,24 @@
/*
VueRouter inutile fino allo sviluppo dell'handler dei messaggi
e solo nel caso si voglia supportare l'uso di url nella versione web
*/
import { createRouter, createWebHashHistory } from "vue-router";
2; // 1. Define route components.
const ChatList = { template: "./components/ChatList.vue" };
// const ChatView = { template: "./components/ChatView.vue" };
// const MessageComposition = { template: "./components/MessageComposition.vue" };
// 2. Define some routes
const routes = [
{ path: "/", component: ChatList },
// { path: "/chat_view", component: ChatView },
// { path: "/chat_view/write", component: MessageComposition },
];
// 3. Create the router instance and pass the `routes` option
export const router = createRouter({
history: createWebHashHistory(),
routes,
});
Loading…
Cancel
Save