Merge branch 'issue-291-disable-empty-tabs' into 'develop'

#291 - disable empty tabs in user profile panel

See merge request pleroma/pleroma-fe!548
This commit is contained in:
Shpuld Shpludson 2019-02-08 15:48:07 +00:00
commit da0a5535eb
2 changed files with 6 additions and 3 deletions

View file

@ -37,7 +37,7 @@ export default Vue.component('tab-switcher', {
return ( return (
<div class={ classesWrapper.join(' ')}> <div class={ classesWrapper.join(' ')}>
<button onClick={this.activateTab(index)} class={ classesTab.join(' ') }>{slot.data.attrs.label}</button> <button disabled={slot.data.attrs.disabled} onClick={this.activateTab(index)} class={ classesTab.join(' ') }>{slot.data.attrs.label}</button>
</div> </div>
) )
}) })

View file

@ -9,19 +9,20 @@
<tab-switcher :renderOnlyFocused="true"> <tab-switcher :renderOnlyFocused="true">
<Timeline <Timeline
:label="$t('user_card.statuses')" :label="$t('user_card.statuses')"
:disabled="!user.statuses_count"
:embedded="true" :embedded="true"
:title="$t('user_profile.timeline_title')" :title="$t('user_profile.timeline_title')"
:timeline="timeline" :timeline="timeline"
:timeline-name="'user'" :timeline-name="'user'"
:user-id="fetchBy" :user-id="fetchBy"
/> />
<div :label="$t('user_card.followees')" v-if="followsTabVisible"> <div :label="$t('user_card.followees')" v-if="followsTabVisible" :disabled="!user.friends_count">
<FollowList v-if="user.friends_count > 0" :userId="userId" :showFollowers="false" /> <FollowList v-if="user.friends_count > 0" :userId="userId" :showFollowers="false" />
<div class="userlist-placeholder" v-else> <div class="userlist-placeholder" v-else>
<i class="icon-spin3 animate-spin"></i> <i class="icon-spin3 animate-spin"></i>
</div> </div>
</div> </div>
<div :label="$t('user_card.followers')" v-if="followersTabVisible"> <div :label="$t('user_card.followers')" v-if="followersTabVisible" :disabled="!user.followers_count">
<FollowList v-if="user.followers_count > 0" :userId="userId" :showFollowers="true" /> <FollowList v-if="user.followers_count > 0" :userId="userId" :showFollowers="true" />
<div class="userlist-placeholder" v-else> <div class="userlist-placeholder" v-else>
<i class="icon-spin3 animate-spin"></i> <i class="icon-spin3 animate-spin"></i>
@ -29,6 +30,7 @@
</div> </div>
<Timeline <Timeline
:label="$t('user_card.media')" :label="$t('user_card.media')"
:disabled="!media.visibleStatuses.length"
:embedded="true" :title="$t('user_card.media')" :embedded="true" :title="$t('user_card.media')"
timeline-name="media" timeline-name="media"
:timeline="media" :timeline="media"
@ -37,6 +39,7 @@
<Timeline <Timeline
v-if="isUs" v-if="isUs"
:label="$t('user_card.favorites')" :label="$t('user_card.favorites')"
:disabled="!favorites.visibleStatuses.length"
:embedded="true" :embedded="true"
:title="$t('user_card.favorites')" :title="$t('user_card.favorites')"
timeline-name="favorites" timeline-name="favorites"