refactor: use MkAvatars for mods
This commit is contained in:
parent
92572157fa
commit
dbe74ed098
|
@ -3,9 +3,7 @@
|
||||||
<Transition :name="$store.state.animation ? '_transition_zoom' : ''" mode="out-in">
|
<Transition :name="$store.state.animation ? '_transition_zoom' : ''" mode="out-in">
|
||||||
<MkLoading v-if="fetching"/>
|
<MkLoading v-if="fetching"/>
|
||||||
<div v-else :class="$style.root" class="_panel">
|
<div v-else :class="$style.root" class="_panel">
|
||||||
<MkA v-for="user in moderators" :key="user.id" class="user" :to="`/user-info/${user.id}`">
|
<MkAvatars :user-ids="moderators.userIds" class="userAvatars"/>
|
||||||
<MkAvatar :user="user" class="avatar" indicator/>
|
|
||||||
</MkA>
|
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,8 +12,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, onUnmounted, ref } from 'vue';
|
import { onMounted, onUnmounted, ref } from 'vue';
|
||||||
import * as os from '@/os';
|
import * as os from '@/os';
|
||||||
import number from '@/filters/number';
|
import MkAvatars from '@/components/MkAvatars.vue';
|
||||||
import { i18n } from '@/i18n';
|
|
||||||
|
|
||||||
let moderators: any = $ref(null);
|
let moderators: any = $ref(null);
|
||||||
let fetching = $ref(true);
|
let fetching = $ref(true);
|
||||||
|
@ -38,18 +35,5 @@ onMounted(async () => {
|
||||||
grid-gap: 12px;
|
grid-gap: 12px;
|
||||||
place-content: center;
|
place-content: center;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
|
|
||||||
&:global {
|
|
||||||
> .user {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
aspect-ratio: 1;
|
|
||||||
|
|
||||||
> .avatar {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<MkContainer :show-header="widgetProps.showHeader" class="mkw-userList">
|
<MkContainer :show-header="widgetProps.showHeader" class="mkw-userList">
|
||||||
<template #header><i class="ph-user-list-bold ph-lg"></i> {{ list ? list.name : i18n.ts._widgets.userList }}</template>
|
<template #header><i class="ph-user-list-bold ph-lg"></i> {{ list ? list.name : i18n.ts._widgets.userList }}</template>
|
||||||
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configure()"><i class="ph-gear-six-bold ph-lg"></i></button></template>
|
<template #func="{ buttonStyleClass }"><button class="_button" :class="buttonStyleClass" @click="configure()"><i class="ph-gear-six-bold ph-lg"></i></button></template>
|
||||||
|
|
||||||
<div class="wsdlkfj">
|
<div class="wsdlkfj">
|
||||||
<div v-if="widgetProps.listId == null" class="init">
|
<div v-if="widgetProps.listId == null" class="init">
|
||||||
<MkButton primary @click="chooseList">{{ i18n.ts._widgets._userList.chooseList }}</MkButton>
|
<MkButton primary @click="chooseList">{{ i18n.ts._widgets._userList.chooseList }}</MkButton>
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
</MkContainer>
|
</MkContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useWidgetPropsManager, Widget, WidgetComponentExpose } from './widget';
|
import { useWidgetPropsManager, Widget, WidgetComponentExpose } from './widget';
|
||||||
import { GetFormResultType } from '@/scripts/form';
|
import { GetFormResultType } from '@/scripts/form';
|
||||||
|
@ -92,7 +92,7 @@ defineExpose<WidgetComponentExpose>({
|
||||||
id: props.widget ? props.widget.id : null,
|
id: props.widget ? props.widget.id : null,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.wsdlkfj {
|
.wsdlkfj {
|
||||||
> .init {
|
> .init {
|
||||||
|
|
Loading…
Reference in New Issue