mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-10 06:00:45 +00:00
Refactor Hashtag component from #5427
This commit is contained in:
parent
6ea108b67c
commit
0a73094d82
1 changed files with 299 additions and 288 deletions
|
@ -34,8 +34,7 @@
|
|||
v-else
|
||||
:disabled="followingLoading"
|
||||
class="btn btn-primary hashtag-follow font-weight-bold rounded-pill py-1 px-4"
|
||||
@click="followHashtag()"
|
||||
>
|
||||
@click="followHashtag()">
|
||||
<b-spinner v-if="followingLoading" small />
|
||||
<span v-else>
|
||||
{{ $t('profile.follow') }}
|
||||
|
@ -43,7 +42,6 @@
|
|||
</button>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -74,7 +72,7 @@
|
|||
width="32"
|
||||
height="32"
|
||||
:hash="status.media_attachments[0].blurhash"
|
||||
:src="status.media_attachments[0].preview_url"
|
||||
:src="getMediaSource(status)"
|
||||
/>
|
||||
</div>
|
||||
<span v-if="status.pf_type == 'photo:album'" class="float-right mr-3 post-icon"><i class="fas fa-images fa-2x"></i></span>
|
||||
|
@ -99,9 +97,7 @@
|
|||
</div>
|
||||
</intersect>
|
||||
|
||||
<!-- <div v-else class="ph-item">
|
||||
<div class="ph-picture big"></div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -120,6 +116,7 @@
|
|||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<drawer />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -281,6 +278,20 @@
|
|||
}, 500);
|
||||
});
|
||||
},
|
||||
|
||||
getMediaSource(status) {
|
||||
let media = status.media_attachments[0];
|
||||
|
||||
if(media.preview_url && media.preview_url.endsWith('storage/no-preview.png')) {
|
||||
return media.url;
|
||||
}
|
||||
|
||||
if(media.preview_url && media.preview_url.length) {
|
||||
return media.url;
|
||||
}
|
||||
|
||||
return media.url;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue