Port follow button to ncbutton

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
pull/1500/head
Carl Schwan 2022-10-27 15:47:14 +02:00
rodzic c75af8deed
commit 0d6fa6dde5
1 zmienionych plików z 15 dodań i 6 usunięć

Wyświetl plik

@ -23,28 +23,37 @@
<template>
<!-- Show button only if user is authenticated and she is not the same as the account viewed -->
<div v-if="!serverData.public && accountInfo && accountInfo.viewerLink!='viewer'">
<button v-if="isCurrentUserFollowing"
<NcButton v-if="isCurrentUserFollowing"
:class="{'icon-loading-small': followLoading}"
@click="unfollow()"
@mouseover="followingText=t('social', 'Unfollow')"
@mouseleave="followingText=t('social', 'Following')">
<span><span class="icon-checkmark" />{{ followingText }}</span>
</button>
<button v-else
<template #icon>
<Check :size="32" />
</template>
{{ followingText }}
</NcButton>
<NcButton v-else
:class="{'icon-loading-small': followLoading}"
class="primary"
@click="follow">
<span>{{ t('social', 'Follow') }}</span>
</button>
{{ t('social', 'Follow') }}
</NcButton>
</div>
</template>
<script>
import accountMixins from '../mixins/accountMixins.js'
import currentUser from '../mixins/currentUserMixin.js'
import Check from 'vue-material-design-icons/Check.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
export default {
name: 'FollowButton',
components: {
Check,
NcButton,
},
mixins: [
accountMixins,
currentUser,