Improve follow-requests page

This commit is contained in:
syuilo 2020-02-15 08:42:21 +09:00
parent 37c80e8ef5
commit 2a04f2ca4d
3 changed files with 47 additions and 21 deletions

View file

@ -401,6 +401,7 @@ createAccount: "アカウントを作成"
existingAcount: "既存のアカウント" existingAcount: "既存のアカウント"
regenerate: "再生成" regenerate: "再生成"
fontSize: "フォントサイズ" fontSize: "フォントサイズ"
noFollowRequests: "フォロー申請はありません"
_ago: _ago:
unknown: "謎" unknown: "謎"

View file

@ -58,13 +58,13 @@
<fa :icon="faComments" fixed-width/><span class="text">{{ $t('messaging') }}</span> <fa :icon="faComments" fixed-width/><span class="text">{{ $t('messaging') }}</span>
<i v-if="$store.state.i.hasUnreadMessagingMessage"><fa :icon="faCircle"/></i> <i v-if="$store.state.i.hasUnreadMessagingMessage"><fa :icon="faCircle"/></i>
</router-link> </router-link>
<router-link class="item" active-class="active" to="/my/drive" v-if="$store.getters.isSignedIn">
<fa :icon="faCloud" fixed-width/><span class="text">{{ $t('drive') }}</span>
</router-link>
<router-link class="item" active-class="active" to="/my/follow-requests" v-if="$store.getters.isSignedIn && $store.state.i.isLocked"> <router-link class="item" active-class="active" to="/my/follow-requests" v-if="$store.getters.isSignedIn && $store.state.i.isLocked">
<fa :icon="faUserClock" fixed-width/><span class="text">{{ $t('followRequests') }}</span> <fa :icon="faUserClock" fixed-width/><span class="text">{{ $t('followRequests') }}</span>
<i v-if="$store.state.i.pendingReceivedFollowRequestsCount"><fa :icon="faCircle"/></i> <i v-if="$store.state.i.pendingReceivedFollowRequestsCount"><fa :icon="faCircle"/></i>
</router-link> </router-link>
<router-link class="item" active-class="active" to="/my/drive" v-if="$store.getters.isSignedIn">
<fa :icon="faCloud" fixed-width/><span class="text">{{ $t('drive') }}</span>
</router-link>
<div class="divider"></div> <div class="divider"></div>
<router-link class="item" active-class="active" to="/featured"> <router-link class="item" active-class="active" to="/featured">
<fa :icon="faFireAlt" fixed-width/><span class="text">{{ $t('featured') }}</span> <fa :icon="faFireAlt" fixed-width/><span class="text">{{ $t('featured') }}</span>

View file

@ -1,27 +1,40 @@
<template> <template>
<mk-pagination :pagination="pagination" #default="{items}" class="mk-follow-requests" ref="list"> <div>
<div class="user _panel" v-for="(req, i) in items" :key="req.id"> <portal to="icon"><fa :icon="faUserClock"/></portal>
<mk-avatar class="avatar" :user="req.follower"/> <portal to="title">{{ $t('followRequests') }}</portal>
<div class="body">
<div class="name"> <mk-pagination :pagination="pagination" class="mk-follow-requests" ref="list">
<router-link class="name" :to="req.follower | userPage" v-user-preview="req.follower.id"><mk-user-name :user="req.follower"/></router-link> <template #empty>
<p class="acct">@{{ req.follower | acct }}</p> <div class="tkdrhpxr">
<img src="https://xn--931a.moe/assets/info.png" alt="" class="_ghost"/>
<div>{{ $t('noFollowRequests') }}</div>
</div> </div>
<div class="description" v-if="req.follower.description" :title="req.follower.description"> </template>
<mfm :text="req.follower.description" :is-note="false" :author="req.follower" :i="$store.state.i" :custom-emojis="req.follower.emojis" :plain="true" :nowrap="true"/> <template #default="{items}">
<div class="user _panel" v-for="req in items" :key="req.id">
<mk-avatar class="avatar" :user="req.follower"/>
<div class="body">
<div class="name">
<router-link class="name" :to="req.follower | userPage" v-user-preview="req.follower.id"><mk-user-name :user="req.follower"/></router-link>
<p class="acct">@{{ req.follower | acct }}</p>
</div>
<div class="description" v-if="req.follower.description" :title="req.follower.description">
<mfm :text="req.follower.description" :is-note="false" :author="req.follower" :i="$store.state.i" :custom-emojis="req.follower.emojis" :plain="true" :nowrap="true"/>
</div>
<div class="actions">
<button class="_button" @click="accept(req.follower)"><fa :icon="faCheck"/></button>
<button class="_button" @click="reject(req.follower)"><fa :icon="faTimes"/></button>
</div>
</div>
</div> </div>
<div class="actions"> </template>
<button class="_button" @click="accept(req.follower)"><fa :icon="faCheck"/></button> </mk-pagination>
<button class="_button" @click="reject(req.follower)"><fa :icon="faTimes"/></button> </div>
</div>
</div>
</div>
</mk-pagination>
</template> </template>
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import { faCheck, faTimes } from '@fortawesome/free-solid-svg-icons'; import { faUserClock, faCheck, faTimes } from '@fortawesome/free-solid-svg-icons';
import MkPagination from '../components/ui/pagination.vue'; import MkPagination from '../components/ui/pagination.vue';
export default Vue.extend({ export default Vue.extend({
@ -41,7 +54,7 @@ export default Vue.extend({
endpoint: 'following/requests/list', endpoint: 'following/requests/list',
limit: 10, limit: 10,
}, },
faCheck, faTimes faCheck, faTimes, faUserClock
}; };
}, },
@ -62,6 +75,18 @@ export default Vue.extend({
<style lang="scss" scoped> <style lang="scss" scoped>
.mk-follow-requests { .mk-follow-requests {
.tkdrhpxr {
padding: 32px;
text-align: center;
> img {
vertical-align: bottom;
height: 128px;
margin-bottom: 16px;
border-radius: 16px;
}
}
> .user { > .user {
display: flex; display: flex;
padding: 16px; padding: 16px;