Skip to content

Commit 649aad4

Browse files
authored
feat: show relationship badge and remove hover-only label on follow button (elk-zone#2397)
1 parent 1bfe5c0 commit 649aad4

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

app/components/account/AccountFollowButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ const buttonStyle = computed(() => {
9595
<span hidden elk-group-hover="inline">{{ $t('account.unmute') }}</span>
9696
</template>
9797
<template v-else-if="relationship ? relationship.following : context === 'following'">
98-
<span elk-group-hover="hidden">{{ relationship?.followedBy ? $t('account.mutuals') : $t('account.following') }}</span>
98+
<span elk-group-hover="hidden">{{ relationship?.followedBy ? $t('account.unfollow') : $t('account.following') }}</span>
9999
<span hidden elk-group-hover="inline">{{ $t('account.unfollow') }}</span>
100100
</template>
101101
<template v-else-if="relationship?.requested">
102102
<span elk-group-hover="hidden">{{ $t('account.follow_requested') }}</span>
103103
<span hidden elk-group-hover="inline">{{ $t('account.withdraw_follow_request') }}</span>
104104
</template>
105105
<template v-else-if="relationship ? relationship.followedBy : context === 'followedBy'">
106-
<span elk-group-hover="hidden">{{ $t('account.follows_you') }}</span>
106+
<span elk-group-hover="hidden">{{ account.locked ? $t('account.request_follow') : $t('account.follow_back') }}</span>
107107
<span hidden elk-group-hover="inline">{{ account.locked ? $t('account.request_follow') : $t('account.follow_back') }}</span>
108108
</template>
109109
<template v-else>

app/components/account/AccountHeader.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ async function copyAccountName() {
191191
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
192192
<AccountLockIndicator v-if="account.locked" show-label />
193193
<AccountBotIndicator v-if="account.bot" show-label />
194+
<AccountRelationshipIndicator v-if="relationship" :relationship="relationship" />
194195
</div>
195196

196197
<div flex items-center gap-1>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup lang="ts">
2+
import type { mastodon } from 'masto'
3+
4+
defineProps<{
5+
relationship: mastodon.v1.Relationship
6+
}>()
7+
8+
const { t } = useI18n()
9+
</script>
10+
11+
<template>
12+
<span
13+
v-if="relationship.followedBy"
14+
border border-base rounded-md px-2 text-secondary-light
15+
>
16+
{{ relationship.following ? t('account.mutuals') : t('account.follows_you') }}
17+
</span>
18+
</template>

0 commit comments

Comments
 (0)