fixable lints

This commit is contained in:
Ulf Gebhardt 2023-07-06 13:08:41 +02:00
parent 5c7bd46139
commit 610d279465
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
6 changed files with 68 additions and 73 deletions

View File

@ -10,18 +10,14 @@
:text-messages="JSON.stringify(textMessages)"
:messages="JSON.stringify(messages)"
:messages-loaded="messagesLoaded"
:rooms="JSON.stringify(rooms)"
:room-actions="JSON.stringify(roomActions)"
:rooms-loaded="true"
show-files="false"
show-audio="false"
:show-footer="true"
@send-message="sendMessage($event.detail[0])"
@fetch-messages="fetchMessages($event.detail[0])"
:responsive-breakpoint="responsiveBreakpoint"
:single-room="singleRoom"
@show-demo-options="showDemoOptions = $event"
@ -43,7 +39,7 @@ export default {
singleRoom: {
type: Boolean,
default: false,
}
},
},
data() {
return {
@ -216,26 +212,26 @@ export default {
}, 2000)
},
},
// apollo: {
// Rooms: {
// query() {
// return roomQuery()
// },
// update({ Room }) {
// console.log('Rooms', Room)
// if (!Room) {
// this.rooms = []
// return
// }
// this.rooms = Room
// },
// error(error) {
// this.rooms = []
// this.$toast.error(error.message)
// },
// fetchPolicy: 'cache-and-network',
// },
// },
// apollo: {
// Rooms: {
// query() {
// return roomQuery()
// },
// update({ Room }) {
// console.log('Rooms', Room)
// if (!Room) {
// this.rooms = []
// return
// }
// this.rooms = Room
// },
// error(error) {
// this.rooms = []
// this.$toast.error(error.message)
// },
// fetchPolicy: 'cache-and-network',
// },
// },
}
</script>
<style lang="scss">

View File

@ -1,9 +1,5 @@
<template>
<nuxt-link
v-if="!unreadChatNotificationsCount"
class="chat-menu"
:to="{ name: 'chat' }"
>
<nuxt-link v-if="!unreadChatNotificationsCount" class="chat-menu" :to="{ name: 'chat' }">
<base-button
ghost
circle
@ -11,9 +7,9 @@
content: $t('notifications.headerMenuButton.chat'),
placement: 'bottom-start',
}"
><img src="/img/empty/chat-bubble.svg"/>
>
<img src="/img/empty/chat-bubble.svg" />
</base-button>
</nuxt-link>
<dropdown v-else class="notifications-menu" offset="8">
<template #default="{ toggleMenu }">
@ -26,33 +22,33 @@
}"
@click="toggleMenu"
>
<counter-icon icon="envelope" :count="unreadChatNotificationsCount" danger />
<img src="/img/empty/chat-bubble.svg"/>
<counter-icon icon="envelope" :count="unreadChatNotificationsCount" danger />
<img src="/img/empty/chat-bubble.svg" />
</base-button>
</template>
<template #popover="{}">
<div class="notifications-menu-popover">
<div v-for="notification in notifications" v-bind:key="notification.roomid">
<ds-space>
<div class="notifications-menu-popover-item" @click="$store.commit('chat/SET_OPEN_CHAT', { showChat: true , roomID: notification.roomid })">
<p>{{ notification.name }}</p>
{{ notification.title }}</div>
</ds-space>
<ds-space>
<div
class="notifications-menu-popover-item"
@click="
$store.commit('chat/SET_OPEN_CHAT', { showChat: true, roomID: notification.roomid })
"
>
<p>{{ notification.name }}</p>
{{ notification.title }}
</div>
</ds-space>
</div>
<!-- <notification-list :notifications="notifications" /> -->
</div>
<ds-flex class="notifications-link-container">
<ds-flex-item class="notifications-link-container-item" :width="{ base: '100%' }" centered>
<nuxt-link :to="{ name: 'chat' }">
<base-button ghost primary>
All Chat Messages
</base-button>
<base-button ghost primary>All Chat Messages</base-button>
</nuxt-link>
</ds-flex-item>
</ds-flex>
</template>
</dropdown>
@ -72,14 +68,14 @@ export default {
},
data() {
return {
notifications: [
{roomid: 'u1', name: 'Jenny', title: 'last Message from Jenny'},
{roomid: 'u2', name: 'Honey', title: 'last Message from Honey'},
{roomid: 'u3', name: 'Bob der Baumeister', title: 'last Message from Bob der Baumeister'},
],
notifications: [
{ roomid: 'u1', name: 'Jenny', title: 'last Message from Jenny' },
{ roomid: 'u2', name: 'Honey', title: 'last Message from Honey' },
{ roomid: 'u3', name: 'Bob der Baumeister', title: 'last Message from Bob der Baumeister' },
],
}
},
computed: {
computed: {
unreadChatNotificationsCount() {
const result = this.notifications.reduce((count, notification) => {
return notification.read ? count : count + 1
@ -89,17 +85,17 @@ export default {
hasNotifications() {
return this.notifications.length
},
}
},
}
</script>
<style lang="scss">
.notifications-menu {
max-width: 500px;
max-width: 500px;
}
.vue-popover-theme {
z-index: 1000000;
}
.counter-icon {
position: relative;

View File

@ -12,15 +12,17 @@
<div id="overlay" />
<client-only>
<modal />
</client-only>
<div v-if="$store.getters['chat/showChat'].showChat" class="chat-modul" >
</client-only>
<div v-if="$store.getters['chat/showChat'].showChat" class="chat-modul">
<ds-text align="right" class="close">
RoomID: {{ $store.getters['chat/showChat'].roomID }}
<ds-button @click="$store.commit('chat/SET_OPEN_CHAT', { showChat: false , roomID: 'u0' })">x</ds-button>
<ds-button @click="$store.commit('chat/SET_OPEN_CHAT', { showChat: false, roomID: 'u0' })">
x
</ds-button>
</ds-text>
<chat-module :singleRoom="true"/>
</div>
>
<chat-module :singleRoom="true" />
</div>
>
</div>
</template>
<script>
@ -60,8 +62,8 @@ export default {
right: 0;
z-index: 10000;
.close {
padding: 10px;
color: blue;
padding: 10px;
color: blue;
cursor: pointer;
}
}

View File

@ -1,5 +1,5 @@
<template>
<chat/>
<chat />
</template>
<script>

View File

@ -80,12 +80,13 @@
@update="updateFollow"
/>
<base-button
@click="$store.commit('chat/SET_OPEN_CHAT', { showChat: true , roomID: user.id })"
@click="$store.commit('chat/SET_OPEN_CHAT', { showChat: true, roomID: user.id })"
v-tooltip="{
content: $t('notifications.headerMenuButton.chat'),
placement: 'bottom-start',
}"
><img src="/img/empty/chat-bubble.svg" height="20"/>
>
<img src="/img/empty/chat-bubble.svg" height="20" />
</base-button>
</div>
<template v-if="user.about">

View File

@ -1,7 +1,7 @@
export const state = () => {
return {
showChat: false,
roomID: 'u0'
roomID: 'u0',
}
}
@ -14,10 +14,10 @@ export const mutations = {
}
export const getters = {
showChat(state) {
return state
},
roomID(state) {
return state
},
showChat(state) {
return state
},
roomID(state) {
return state
},
}