Add list of followed hashtags to profile
This commit is contained in:
parent
dfba8be134
commit
e9f16af82d
7 changed files with 147 additions and 13 deletions
|
@ -13,6 +13,7 @@ import {
|
|||
faCircleNotch,
|
||||
faCircleCheck
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import FollowedTagCard from '../followed_tag_card/FollowedTagCard.vue'
|
||||
|
||||
library.add(
|
||||
faCircleNotch,
|
||||
|
@ -35,6 +36,14 @@ const FriendList = withLoadMore({
|
|||
additionalPropNames: ['userId']
|
||||
})(List)
|
||||
|
||||
const FollowedTagList = withLoadMore({
|
||||
fetch: (props, $store) => $store.dispatch('fetchFollowedTags', props.userId),
|
||||
select: (props, $store) => get($store.getters.findUser(props.userId), 'followedTagIds', []).map(id => $store.getters.findTag(id)),
|
||||
destroy: (props, $store) => $store.dispatch('clearFollowedTags', props.userId),
|
||||
childPropName: 'items',
|
||||
additionalPropNames: ['userId']
|
||||
})(List)
|
||||
|
||||
const isUserPage = ({ name }) => name === 'user-profile' || name === 'external-user-profile'
|
||||
|
||||
const UserProfile = {
|
||||
|
@ -202,6 +211,7 @@ const UserProfile = {
|
|||
}
|
||||
},
|
||||
components: {
|
||||
FollowedTagCard,
|
||||
UserCard,
|
||||
Timeline,
|
||||
FollowerList,
|
||||
|
@ -209,7 +219,8 @@ const UserProfile = {
|
|||
FollowCard,
|
||||
TabSwitcher,
|
||||
Conversation,
|
||||
RichContent
|
||||
RichContent,
|
||||
FollowedTagList,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -105,11 +105,36 @@
|
|||
key="followees"
|
||||
:label="$t('user_card.followees')"
|
||||
>
|
||||
<FriendList :user-id="userId">
|
||||
<template #item="{item}">
|
||||
<FollowCard :user="item" />
|
||||
</template>
|
||||
</FriendList>
|
||||
<tab-switcher
|
||||
:active-tab="users"
|
||||
:render-only-focused="true"
|
||||
>
|
||||
<div
|
||||
key="users"
|
||||
:label="$t('user_card.followed_users')"
|
||||
>
|
||||
<FriendList :user-id="userId">
|
||||
<template #item="{item}">
|
||||
<FollowCard :user="item" />
|
||||
</template>
|
||||
</FriendList>
|
||||
</div>
|
||||
<div
|
||||
key="tags"
|
||||
v-if="isUs"
|
||||
:label="$t('user_card.followed_tags')"
|
||||
>
|
||||
<FollowedTagList
|
||||
:user-id="userId"
|
||||
:following="false"
|
||||
:get-key="(item) => item.name"
|
||||
>
|
||||
<template #item="{item}">
|
||||
<FollowedTagCard :tag="item" />
|
||||
</template>
|
||||
</FollowedTagList>
|
||||
</div>
|
||||
</tab-switcher>
|
||||
</div>
|
||||
<div
|
||||
v-if="followersTabVisible"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue