diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-12-21 17:33:29 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-01-03 10:01:03 +0100 |
commit | 6afde1293259041d1504ce0cc8e997c03ccd04ae (patch) | |
tree | 8cf2835d858e4e3fe8cdc6f16383ae48d68e700e /src/components/UserEntry.vue | |
parent | fb3e156846b09360b43e30c032acb47a8401265d (diff) |
Move follow/unfollow to store and rework account store handling
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'src/components/UserEntry.vue')
-rw-r--r-- | src/components/UserEntry.vue | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/components/UserEntry.vue b/src/components/UserEntry.vue index 933ac618..7aa1fd15 100644 --- a/src/components/UserEntry.vue +++ b/src/components/UserEntry.vue @@ -29,22 +29,19 @@ <avatar v-else :url="avatarUrl" /> </div> <div class="user-details"> - <router-link v-if="item.local" :to="{ name: 'profile', params: { account: item.preferredUsername }}"> - <span class="post-author">{{ item.preferredUsername }}</span> + <router-link v-if="!serverData.public" :to="{ name: 'profile', params: { account: item.local ? item.preferredUsername : item.account }}"> + <span class="post-author">{{ item.name }}</span> + <span class="user-description">{{ item.account }}</span> </router-link> <a v-else :href="item.id" target="_blank" - rel="noreferrer">{{ item.name }} <span class="user-description">{{ item.account }}</span></a> + rel="noreferrer"> + <span class="post-author">{{ item.name }}</span> + <span class="user-description">{{ item.account }}</span> + </a> <!-- TODO check where the html is coming from to avoid security issues --> <p v-html="item.summary" /> </div> - <template v-if="!serverData.public && cloudId !== item.account"> - <button v-if="item.details && item.details.following" :class="{'icon-loading-small': followLoading}" - @click="unfollow()" - @mouseover="followingText=t('social', 'Unfollow')" @mouseleave="followingText=t('social', 'Following')"> - <span><span class="icon-checkmark" />{{ followingText }}</span></button> - <button v-else-if="item.details" :class="{'icon-loading-small': followLoading}" class="primary" - @click="follow"><span>{{ t('social', 'Follow') }}</span></button> - </template> + <follow-button :account="item.account" /> </div> </div> </template> @@ -53,10 +50,12 @@ import { Avatar } from 'nextcloud-vue' import follow from '../mixins/follow' import currentUser from '../mixins/currentUserMixin' +import FollowButton from './FollowButton' export default { name: 'UserEntry', components: { + FollowButton, Avatar }, mixins: [ |