pleroma-fe/src/components/follow_card/follow_card.vue

57 lines
1.6 KiB
Vue
Raw Normal View History

2019-02-26 14:51:04 +11:00
<template>
<basic-user-card :user="user">
<div class="follow-card-content-container">
2019-02-28 06:01:57 +11:00
<span class="faint" v-if="!noFollowsYou && user.follows_you">
2019-02-27 03:00:25 +11:00
{{ isMe ? $t('user_card.its_you') : $t('user_card.follows_you') }}
</span>
<div class="btn-follow" v-if="showFollow && !loggedIn">
<RemoteFollow :user="user" />
</div>
2019-02-26 14:57:40 +11:00
<button
v-if="showFollow && loggedIn"
class="btn btn-default btn-follow"
2019-02-26 14:57:40 +11:00
@click="followUser"
2019-02-27 02:14:12 +11:00
:disabled="inProgress"
2019-02-26 14:57:40 +11:00
:title="requestSent ? $t('user_card.follow_again') : ''"
>
2019-02-27 02:14:12 +11:00
<template v-if="inProgress">
2019-02-26 14:57:40 +11:00
{{ $t('user_card.follow_progress') }}
</template>
<template v-else-if="requestSent">
{{ $t('user_card.follow_sent') }}
</template>
<template v-else>
{{ $t('user_card.follow') }}
</template>
</button>
2019-02-27 02:14:12 +11:00
<button v-if="following" class="btn btn-default pressed" @click="unfollowUser" :disabled="inProgress">
<template v-if="inProgress">
2019-02-26 14:57:40 +11:00
{{ $t('user_card.follow_progress') }}
</template>
<template v-else>
{{ $t('user_card.follow_unfollow') }}
</template>
</button>
</div>
2019-02-26 14:51:04 +11:00
</basic-user-card>
</template>
<script src="./follow_card.js"></script>
<style lang="scss">
.follow-card-content-container {
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
line-height: 1.5em;
.btn-follow {
margin-top: 0.5em;
margin-left: auto;
width: 10em;
}
}
</style>