aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2022-06-27 19:26:52 +0300
committerHenry Jameson <me@hjkos.com>2022-06-27 19:26:52 +0300
commit700df11e9a0d36b3e1afdc50034567014c2b71cc (patch)
tree1e441daa3ba637aeccee3e9f0148b9ad9e172137 /src/components
parentcb135645f9b290944c40052f09a3eb9a487598a1 (diff)
fix basicusercard
Diffstat (limited to 'src/components')
-rw-r--r--src/components/basic_user_card/basic_user_card.js12
-rw-r--r--src/components/basic_user_card/basic_user_card.vue31
-rw-r--r--src/components/user_popover/user_popover.js2
-rw-r--r--src/components/user_popover/user_popover.vue2
4 files changed, 18 insertions, 29 deletions
diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js
index 8f41e2fb..8b1a2c38 100644
--- a/src/components/basic_user_card/basic_user_card.js
+++ b/src/components/basic_user_card/basic_user_card.js
@@ -1,4 +1,4 @@
-import UserCard from '../user_card/user_card.vue'
+import UserPopover from '../user_popover/user_popover.vue'
import UserAvatar from '../user_avatar/user_avatar.vue'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
@@ -7,20 +7,12 @@ const BasicUserCard = {
props: [
'user'
],
- data () {
- return {
- userExpanded: false
- }
- },
components: {
- UserCard,
+ UserPopover,
UserAvatar,
RichContent
},
methods: {
- toggleUserExpanded () {
- this.userExpanded = !this.userExpanded
- },
userProfileLink (user) {
return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames)
}
diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue
index eeca7828..effd9268 100644
--- a/src/components/basic_user_card/basic_user_card.vue
+++ b/src/components/basic_user_card/basic_user_card.vue
@@ -1,24 +1,19 @@
<template>
<div class="basic-user-card">
- <router-link :to="userProfileLink(user)">
- <UserAvatar
- class="avatar"
- :user="user"
- @click.prevent="toggleUserExpanded"
- />
+ <router-link @click.prevent :to="userProfileLink(user)">
+ <UserPopover
+ :userId="user.id"
+ :overlayCenters="true"
+ overlayCentersSelector=".avatar"
+ >
+ <UserAvatar
+ class="user-avatar avatar"
+ :user="user"
+ @click.prevent
+ />
+ </UserPopover>
</router-link>
<div
- v-if="userExpanded"
- class="basic-user-card-expanded-content"
- >
- <UserCard
- :user-id="user.id"
- :rounded="true"
- :bordered="true"
- />
- </div>
- <div
- v-else
class="basic-user-card-collapsed-content"
>
<div
@@ -53,6 +48,8 @@
margin: 0;
padding: 0.6em 1em;
+ --emoji-size: 14px;
+
&-collapsed-content {
margin-left: 0.7em;
text-align: left;
diff --git a/src/components/user_popover/user_popover.js b/src/components/user_popover/user_popover.js
index 962ae6a0..3b3722ce 100644
--- a/src/components/user_popover/user_popover.js
+++ b/src/components/user_popover/user_popover.js
@@ -4,7 +4,7 @@ import { defineAsyncComponent } from 'vue'
const UserPopover = {
name: 'UserPopover',
props: [
- 'userId', 'overlayCenters', 'disabled'
+ 'userId', 'overlayCenters', 'disabled', 'overlay-centers-selector'
],
components: {
UserCard,
diff --git a/src/components/user_popover/user_popover.vue b/src/components/user_popover/user_popover.vue
index c998e298..f4f505ae 100644
--- a/src/components/user_popover/user_popover.vue
+++ b/src/components/user_popover/user_popover.vue
@@ -2,7 +2,7 @@
<Popover
trigger="click"
popover-class="popover-default user-popover"
- overlay-centers-selector=".user-info-avatar-link .Avatar"
+ :overlay-centers-selector="overlayCentersSelector || '.user-info-avatar-link .Avatar'"
:overlay-centers="overlayCenters"
:disabled="disabled"
>