modernize group.vue

This commit is contained in:
ThatOneCalculator 2022-09-13 17:08:09 -07:00
parent 7a21709309
commit 031b3661e2
1 changed files with 67 additions and 52 deletions

View File

@ -1,41 +1,44 @@
<template> <template>
<div class="mk-group-page"> <MkStickyContainer>
<transition :name="$store.state.animation ? 'zoom' : ''" mode="out-in"> <template #header><MkPageHeader/></template>
<div v-if="group" class="_section"> <div class="mk-group-page">
<div class="_content" style="display: flex; gap: var(--margin); flex-wrap: wrap;"> <transition :name="$store.state.animation ? 'zoom' : ''" mode="out-in">
<MkButton inline @click="invite()">{{ $ts.invite }}</MkButton> <div v-if="group" class="_section">
<MkButton inline @click="renameGroup()">{{ $ts.rename }}</MkButton> <div class="_content" style="display: flex; gap: var(--margin); flex-wrap: wrap;">
<MkButton inline @click="transfer()">{{ $ts.transfer }}</MkButton> <MkButton inline @click="invite()">{{ $ts.invite }}</MkButton>
<MkButton inline @click="deleteGroup()">{{ $ts.delete }}</MkButton> <MkButton inline @click="renameGroup()">{{ $ts.rename }}</MkButton>
<MkButton inline @click="transfer()">{{ $ts.transfer }}</MkButton>
<MkButton inline @click="deleteGroup()">{{ $ts.delete }}</MkButton>
</div>
</div> </div>
</div> </transition>
</transition> <transition :name="$store.state.animation ? 'zoom' : ''" mode="out-in">
<div v-if="group" class="_section members _gap">
<transition :name="$store.state.animation ? 'zoom' : ''" mode="out-in"> <div class="_content">
<div v-if="group" class="_section members _gap"> <div class="users">
<div class="_title">{{ $ts.members }}</div> <div v-for="user in users" :key="user.id" class="user _panel">
<div class="_content"> <MkAvatar :user="user" class="avatar" :show-indicator="true"/>
<div class="users"> <div class="body">
<div v-for="user in users" :key="user.id" class="user _panel"> <MkUserName :user="user" class="name"/>
<MkAvatar :user="user" class="avatar" :show-indicator="true"/> <MkAcct :user="user" class="acct"/>
<div class="body"> </div>
<MkUserName :user="user" class="name"/> <div class="action">
<MkAcct :user="user" class="acct"/> <button class="_button" @click="removeUser(user)"><i class="fas fa-times"></i></button>
</div> </div>
<div class="action">
<button class="_button" @click="removeUser(user)"><i class="fas fa-times"></i></button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </transition>
</transition> </div>
</div> </MkStickyContainer>
</template> </template>
<script lang="ts"> <script lang="ts" setup>
import { computed, defineComponent } from 'vue'; import { computed, defineComponent } from 'vue';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import { definePageMetadata } from '@/scripts/page-metadata';\
import { i18n } from '@/i18n';
import * as os from '@/os'; import * as os from '@/os';
export default defineComponent({ export default defineComponent({
@ -139,39 +142,51 @@ export default defineComponent({
} }
} }
}); });
definePageMetadata(computed(() => ({
title: i18n.ts.members,
icon: 'fas fa-users',
})));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-group-page { .mk-group-page {
> .members { > ._section {
> ._content { > ._content {
> .users { padding-top: 1rem;
> .user { justify-content: center;
display: flex; }
align-items: center; }
padding: 16px; > .members {
> ._content {
> .users {
> .user {
display: flex;
align-items: center;
padding: 16px;
> .avatar { > .avatar {
width: 50px; width: 50px;
height: 50px; height: 50px;
}
> .body {
flex: 1;
padding: 8px;
> .name {
display: block;
font-weight: bold;
} }
> .acct { > .body {
opacity: 0.5; flex: 1;
padding: 8px;
> .name {
display: block;
font-weight: bold;
}
> .acct {
opacity: 0.5;
}
} }
} }
} }
} }
} }
} }
} </style>
</style>