Update RemotePost component, update likes reaction bar

This commit is contained in:
Daniel Supernault 2021-07-24 23:37:44 -06:00
parent 7c6cff3103
commit 1060dd23d5
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 16 additions and 17 deletions

View file

@ -222,13 +222,13 @@
</div> </div>
<div class="reaction-counts mb-0"> <div class="reaction-counts mb-0">
<div v-if="status.liked_by.username && status.liked_by.username !== user.username" class="likes mb-1"> <div v-if="status.liked_by.username && status.liked_by.username !== user.username" class="likes mb-1">
<span class="like-count">Liked by <span class="like-count">Liked by
<a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a> <a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a>
<span v-if="status.liked_by.others == true"> <span v-if="status.liked_by.others == true">
and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span> and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span>
</span> </span>
</span> </span>
</div> </div>
</div> </div>
<div class="timestamp d-flex align-items-bottom justify-content-between"> <div class="timestamp d-flex align-items-bottom justify-content-between">
<a v-bind:href="statusUrl" class="small text-muted" :title="status.created_at"> <a v-bind:href="statusUrl" class="small text-muted" :title="status.created_at">

View file

@ -224,13 +224,15 @@
<h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.bookmarked ? 'fas fa-bookmark text-warning m-0 mr-3 cursor-pointer' : 'far fa-bookmark m-0 mr-3 cursor-pointer']" title="Bookmark" v-on:click="bookmarkStatus"></h3> <h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.bookmarked ? 'fas fa-bookmark text-warning m-0 mr-3 cursor-pointer' : 'far fa-bookmark m-0 mr-3 cursor-pointer']" title="Bookmark" v-on:click="bookmarkStatus"></h3>
<h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.shared ? 'fas fa-retweet m-0 text-primary cursor-pointer' : 'fas fa-retweet m-0 share-btn cursor-pointer']" title="Share" v-on:click="shareStatus"></h3> <h3 v-if="status.visibility == 'public'" v-bind:class="[reactions.shared ? 'fas fa-retweet m-0 text-primary cursor-pointer' : 'fas fa-retweet m-0 share-btn cursor-pointer']" title="Share" v-on:click="shareStatus"></h3>
</div> </div>
<div class="reaction-counts font-weight-bold mb-0"> <div class="reaction-counts mb-0">
<span style="cursor:pointer;" v-on:click="likesModal"> <div v-if="status.liked_by.username && status.liked_by.username !== user.username" class="likes mb-1">
<span class="like-count">{{status.favourites_count || 0}}</span> likes <span class="like-count">Liked by
</span> <a class="font-weight-bold text-dark" :href="status.liked_by.url">{{status.liked_by.username}}</a>
<span v-if="status.visibility == 'public'" class="float-right" style="cursor:pointer;" v-on:click="sharesModal"> <span v-if="status.liked_by.others == true">
<span class="share-count pl-4">{{status.reblogs_count || 0}}</span> shares and <span class="font-weight-bold text-dark cursor-pointer" @click="likesModal"><span v-if="status.liked_by.total_count_pretty">{{status.liked_by.total_count_pretty}}</span> others</span>
</span> </span>
</span>
</div>
</div> </div>
<div class="timestamp pt-2 d-flex align-items-bottom justify-content-between"> <div class="timestamp pt-2 d-flex align-items-bottom justify-content-between">
<a v-bind:href="statusUrl" class="small text-muted" :title="status.created_at"> <a v-bind:href="statusUrl" class="small text-muted" :title="status.created_at">
@ -692,9 +694,6 @@ export default {
window.location.href = '/login?next=' + encodeURIComponent('/p/' + this.status.shortcode); window.location.href = '/login?next=' + encodeURIComponent('/p/' + this.status.shortcode);
return; return;
} }
if(this.status.favourites_count == 0) {
return;
}
if(this.likes.length) { if(this.likes.length) {
this.$refs.likesModal.show(); this.$refs.likesModal.show();
return; return;