Skip to content

Commit ea1c298

Browse files
committed
Add default avatar to tweet
1 parent 8e5ead7 commit ea1c298

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

frontend/src/components/view/tweet/Tweet.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<div>
33
<article class="media box tweet">
44
<figure class="media-left">
5-
<p class="image is-64x64 is-square">
5+
<p v-if="tweet.author.avatar" class="image is-64x64 is-square">
66
<img class="is-rounded" :src="tweet.author.avatar">
77
</p>
8+
<DefaultAvatar v-else class="image is-64x64" :user="tweet.author" />
89
</figure>
910

1011
<div class="media-content">
@@ -69,14 +70,16 @@ import { mapGetters, mapActions } from 'vuex';
6970
import Comment from './Comment.vue';
7071
import NewCommentForm from './NewCommentForm.vue';
7172
import EditTweetForm from './EditTweetForm.vue';
73+
import DefaultAvatar from '../../common/DefaultAvatar.vue';
7274
7375
export default {
7476
name: 'Tweet',
7577
7678
components: {
7779
Comment,
7880
NewCommentForm,
79-
EditTweetForm
81+
EditTweetForm,
82+
DefaultAvatar,
8083
},
8184
8285
props: {

0 commit comments

Comments
 (0)