Move user list from reactions to its own component, make favs and rts use it
This commit is contained in:
parent
950ae6d89a
commit
6079301ec4
6 changed files with 131 additions and 90 deletions
|
@ -9,6 +9,7 @@ import AvatarList from '../avatar_list/avatar_list.vue'
|
|||
import Timeago from '../timeago/timeago.vue'
|
||||
import StatusContent from '../status_content/status_content.vue'
|
||||
import StatusPopover from '../status_popover/status_popover.vue'
|
||||
import UserListPopover from '../user_list_popover/user_list_popover.vue'
|
||||
import EmojiReactions from '../emoji_reactions/emoji_reactions.vue'
|
||||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||
import { highlightClass, highlightStyle } from '../../services/user_highlighter/user_highlighter.js'
|
||||
|
@ -18,6 +19,21 @@ import { mapGetters, mapState } from 'vuex'
|
|||
|
||||
const Status = {
|
||||
name: 'Status',
|
||||
components: {
|
||||
FavoriteButton,
|
||||
ReactButton,
|
||||
RetweetButton,
|
||||
ExtraButtons,
|
||||
PostStatusForm,
|
||||
UserCard,
|
||||
UserAvatar,
|
||||
AvatarList,
|
||||
Timeago,
|
||||
StatusPopover,
|
||||
UserListPopover,
|
||||
EmojiReactions,
|
||||
StatusContent
|
||||
},
|
||||
props: [
|
||||
'statusoid',
|
||||
'expandable',
|
||||
|
@ -197,20 +213,6 @@ const Status = {
|
|||
currentUser: state => state.users.currentUser
|
||||
})
|
||||
},
|
||||
components: {
|
||||
FavoriteButton,
|
||||
ReactButton,
|
||||
RetweetButton,
|
||||
ExtraButtons,
|
||||
PostStatusForm,
|
||||
UserCard,
|
||||
UserAvatar,
|
||||
AvatarList,
|
||||
Timeago,
|
||||
StatusPopover,
|
||||
EmojiReactions,
|
||||
StatusContent
|
||||
},
|
||||
methods: {
|
||||
visibilityIcon (visibility) {
|
||||
switch (visibility) {
|
||||
|
|
|
@ -265,24 +265,30 @@
|
|||
class="favs-repeated-users"
|
||||
>
|
||||
<div class="stats">
|
||||
<div
|
||||
<UserListPopover
|
||||
v-if="statusFromGlobalRepository.rebloggedBy && statusFromGlobalRepository.rebloggedBy.length > 0"
|
||||
class="stat-count"
|
||||
:users="statusFromGlobalRepository.rebloggedBy"
|
||||
>
|
||||
<a class="stat-title">{{ $t('status.repeats') }}</a>
|
||||
<div class="stat-number">
|
||||
{{ statusFromGlobalRepository.rebloggedBy.length }}
|
||||
<div class="stat-count">
|
||||
<a class="stat-title">{{ $t('status.repeats') }}</a>
|
||||
<div class="stat-number">
|
||||
{{ statusFromGlobalRepository.rebloggedBy.length }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
</UserListPopover>
|
||||
<UserListPopover
|
||||
v-if="statusFromGlobalRepository.favoritedBy && statusFromGlobalRepository.favoritedBy.length > 0"
|
||||
class="stat-count"
|
||||
:users="statusFromGlobalRepository.favoritedBy"
|
||||
>
|
||||
<a class="stat-title">{{ $t('status.favorites') }}</a>
|
||||
<div class="stat-number">
|
||||
{{ statusFromGlobalRepository.favoritedBy.length }}
|
||||
<div
|
||||
class="stat-count"
|
||||
>
|
||||
<a class="stat-title">{{ $t('status.favorites') }}</a>
|
||||
<div class="stat-number">
|
||||
{{ statusFromGlobalRepository.favoritedBy.length }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</UserListPopover>
|
||||
<div class="avatar-row">
|
||||
<AvatarList :users="combinedFavsAndRepeatsUsers" />
|
||||
</div>
|
||||
|
@ -722,6 +728,11 @@ $status-margin: 0.75em;
|
|||
|
||||
.stat-count {
|
||||
margin-right: $status-margin;
|
||||
user-select: none;
|
||||
|
||||
&:hover .stat-title {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.stat-title {
|
||||
color: var(--faint, $fallback--faint);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue