Change presence layout

This commit is contained in:
Douglas Barone 2020-12-04 09:39:48 -04:00
parent 3dfbbe9264
commit 7f763020c7
2 changed files with 57 additions and 43 deletions

View File

@ -1,15 +1,25 @@
<template> <template>
<div v-if="!loading"> <div v-if="!loading">
<v-list three-line> <transition-group
<v-fade-transition group hide-on-leave appear> name="scale-transition"
<v-list-item tag="div"
class="d-flex flex-wrap"
>
<v-col
v-for="userPresence in userPresences" v-for="userPresence in userPresences"
:key="userPresence.user.id" :key="userPresence.user.id"
cols="12"
md="6"
> >
<v-card rounded outlined>
<v-list three-line>
<v-list-item>
<v-list-item-avatar size="52px" style="overflow: visible"> <v-list-item-avatar size="52px" style="overflow: visible">
<v-badge <v-badge
:color=" :color="
userPresence.wifiDevices.some(wifiDevice => wifiDevice.isOnline) userPresence.wifiDevices.some(
wifiDevice => wifiDevice.isOnline
)
? 'green' ? 'green'
: 'grey' : 'grey'
" "
@ -25,7 +35,9 @@
<v-list-item-title> <v-list-item-title>
{{ userPresence.user.displayName }} {{ userPresence.user.displayName }}
</v-list-item-title> </v-list-item-title>
<v-list-item-subtitle v-if="!userPresence.wifiDevices[0].isOnline"> <v-list-item-subtitle
v-if="!userPresence.wifiDevices[0].isOnline"
>
<span class="font-weight-medium">Off-line.</span> <span class="font-weight-medium">Off-line.</span>
Visto {{ userPresence.wifiDevices[0].lastSeen | from }} Visto {{ userPresence.wifiDevices[0].lastSeen | from }}
</v-list-item-subtitle> </v-list-item-subtitle>
@ -40,8 +52,10 @@
</v-list-item-subtitle> </v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
</v-list-item> </v-list-item>
</v-fade-transition>
</v-list> </v-list>
</v-card>
</v-col>
</transition-group>
</div> </div>
<v-list v-else> <v-list v-else>
<v-divider /> <v-divider />

View File

@ -29,7 +29,7 @@
text text
large large
block block
@click="resultSize = resultSize + 5" @click="resultSize += 10"
> >
Mostrar mais Mostrar mais
</v-btn> </v-btn>
@ -56,7 +56,7 @@ export default {
components: { UserPresenceStatusList }, components: { UserPresenceStatusList },
data: () => ({ data: () => ({
search: '', search: '',
resultSize: 5 resultSize: 10
}), }),
apollo: { apollo: {
userPresence: { userPresence: {