Add follow button to user card

This commit is contained in:
styppo 2023-01-12 19:35:35 +00:00
parent a9f3f79dbf
commit dd46b28561
No known key found for this signature in database
GPG Key ID: 3AAA685C50724C28
2 changed files with 13 additions and 2 deletions

View File

@ -1,17 +1,19 @@
<template> <template>
<div class="user-card"> <div class="user-card">
<UserAvatar :pubkey="pubkey" :clickable="clickable" /> <UserAvatar :pubkey="pubkey" :clickable="clickable" />
<UserName :pubkey="pubkey" :clickable="clickable" two-line /> <UserName :pubkey="pubkey" :clickable="clickable" class="username" two-line />
<FollowButton v-if="followButton" :pubkey="pubkey" />
</div> </div>
</template> </template>
<script> <script>
import UserAvatar from 'components/User/UserAvatar.vue' import UserAvatar from 'components/User/UserAvatar.vue'
import UserName from 'components/User/UserName.vue' import UserName from 'components/User/UserName.vue'
import FollowButton from 'components/User/FollowButton.vue'
export default { export default {
name: 'UserCard', name: 'UserCard',
components: {UserName, UserAvatar}, components: {FollowButton, UserName, UserAvatar},
props: { props: {
pubkey: { pubkey: {
type: String, type: String,
@ -20,6 +22,10 @@ export default {
clickable: { clickable: {
type: Boolean, type: Boolean,
default: false, default: false,
},
followButton: {
type: Boolean,
default: false,
} }
} }
} }
@ -32,5 +38,8 @@ export default {
* + * { * + * {
margin-left: 1rem; margin-left: 1rem;
} }
.username {
flex-grow: 1;
}
} }
</style> </style>

View File

@ -24,6 +24,7 @@
:key="contact.pubkey" :key="contact.pubkey"
:pubkey="contact.pubkey" :pubkey="contact.pubkey"
clickable clickable
follow-button
/> />
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="followers" class="no-padding"> <q-tab-panel name="followers" class="no-padding">
@ -32,6 +33,7 @@
:key="follower" :key="follower"
:pubkey="follower" :pubkey="follower"
clickable clickable
follow-button
/> />
</q-tab-panel> </q-tab-panel>
</q-tab-panels> </q-tab-panels>