chore: reformat messaging/index.vue

This commit is contained in:
cutestnekoaqua 2023-01-19 00:08:26 +01:00
parent beb5f95ce4
commit 0edc80b10a
No known key found for this signature in database
GPG Key ID: 6BF0964A5069C1E0
1 changed files with 52 additions and 48 deletions

View File

@ -1,39 +1,43 @@
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header>
<div> <MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs" />
<MkSpacer :content-max="800"> </template>
<swiper <div>
:modules="[Virtual]" <MkSpacer :content-max="800">
:space-between="20" <swiper :modules="[Virtual]" :space-between="20" :virtual="true"
:virtual="true" :allow-touch-move="!(deviceKind === 'desktop' && !defaultStore.state.swipeOnDesktop)" @swiper="setSwiperRef"
:allow-touch-move="!(deviceKind === 'desktop' && !defaultStore.state.swipeOnDesktop)" @slide-change="onSlideChange">
@swiper="setSwiperRef" <swiper-slide>
@slide-change="onSlideChange" <div class="_content yweeujhr dms">
> <MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{
<swiper-slide> i18n.ts.startMessaging
<div class="_content yweeujhr dms"> }}</MkButton>
<MkButton primary class="start" @click="startUser"><i class="ph-plus-bold ph-lg"></i> {{ i18n.ts.startMessaging }}</MkButton> <MkPagination v-slot="{ items }" :externalItemArray="messages" :pagination="dmsPagination">
<MkPagination v-slot="{items}" :externalItemArray="messages" :pagination="dmsPagination"> <MkChatPreview v-for="message in messages" :key="message.id" class="yweeujhr message _block"
<MkChatPreview v-for="message in messages" :key="message.id" class="yweeujhr message _block" :message="message"/> :message="message" />
</MkPagination> </MkPagination>
</div>
</swiper-slide>
<swiper-slide>
<div class="_content yweeujhr groups">
<div class="groupsbuttons">
<MkButton primary class="start" :link="true" to="/my/groups"><i class="ph-user-circle-gear-bold ph-lg"></i> {{ i18n.ts.manageGroups }}</MkButton>
<MkButton primary class="start" @click="startGroup"><i class="ph-plus-bold ph-lg"></i> {{ i18n.ts.startMessaging }}</MkButton>
</div> </div>
<MkPagination v-slot="{items}" :externalItemArray="groupMessages" :pagination="groupsPagination"> </swiper-slide>
<MkChatPreview v-for="message in groupMessages" :key="message.id" class="yweeujhr message _block" :message="message"/> <swiper-slide>
</MkPagination> <div class="_content yweeujhr groups">
</div> <div class="groupsbuttons">
</swiper-slide> <MkButton primary class="start" :link="true" to="/my/groups"><i
</swiper> class="ph-user-circle-gear-bold ph-lg"></i> {{ i18n.ts.manageGroups }}</MkButton>
</MkSpacer> <MkButton primary class="start" @click="startGroup"><i class="ph-plus-bold ph-lg"></i> {{
</div> i18n.ts.startMessaging
</MkStickyContainer> }}</MkButton>
</div>
<MkPagination v-slot="{ items }" :externalItemArray="groupMessages" :pagination="groupsPagination">
<MkChatPreview v-for="message in groupMessages" :key="message.id" class="yweeujhr message _block"
:message="message" />
</MkPagination>
</div>
</swiper-slide>
</swiper>
</MkSpacer>
</div>
</MkStickyContainer>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -106,7 +110,7 @@ function onMessage(message): void {
if (message.recipientId) { if (message.recipientId) {
messages = messages.filter(m => !( messages = messages.filter(m => !(
(m.recipientId === message.recipientId && m.userId === message.userId) || (m.recipientId === message.recipientId && m.userId === message.userId) ||
(m.recipientId === message.userId && m.userId === message.recipientId))); (m.recipientId === message.userId && m.userId === message.recipientId)));
messages.unshift(message); messages.unshift(message);
} else if (message.groupId) { } else if (message.groupId) {
@ -206,17 +210,17 @@ onUnmounted(() => {
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.yweeujhr { .yweeujhr {
> .start { >.start {
margin: 0 auto var(--margin) auto; margin: 0 auto var(--margin) auto;
}
> .groupsbuttons {
max-width: 100%;
display: flex;
justify-content: center;
margin-bottom: 1rem;
}
} }
</style>
>.groupsbuttons {
max-width: 100%;
display: flex;
justify-content: center;
margin-bottom: 1rem;
}
}
</style>