use ne author component in post card

This commit is contained in:
Grzegorz Leoniec 2018-10-16 09:43:44 +02:00
parent 196de5f4be
commit ae50a3f6e8

View File

@ -12,17 +12,17 @@
<ds-space <ds-space
margin="small" margin="small"
style="position: absolute; bottom: 44px;"> style="position: absolute; bottom: 44px;">
<ds-avatar <hc-author
:image="post.author.User.avatar" :post="post"
size="32px" /> <b class="username">{{ post.author.User.name }}</b> :show-author-popover="showAuthorPopover" />
</ds-space> </ds-space>
<template slot="footer"> <template slot="footer">
<span> <span :style="{ opacity: post.commentsCount ? 1 : .5 }">
<ds-icon name="comments" /> <small v-if="post.commentsCount">{{ post.commentsCount }}</small> <ds-icon name="comments" /> <small>{{ post.commentsCount }}</small>
</span> </span>
&nbsp; &nbsp;
<span> <span :style="{ opacity: post.shoutedCount ? 1 : .5 }">
<ds-icon name="heart-o" /> <small v-if="post.shoutedCount">{{ post.shoutedCount }}</small> <ds-icon name="heart-o" /> <small>{{ post.shoutedCount }}</small>
</span> </span>
</template> </template>
</ds-card> </ds-card>
@ -30,15 +30,21 @@
</template> </template>
<script> <script>
/** import HcAuthor from '~/components/Author.vue'
* TODO: we have to check if the user is already following
*/
export default { export default {
name: 'HcPostCard', name: 'HcPostCard',
components: {
HcAuthor
},
props: { props: {
post: { post: {
type: Object, type: Object,
required: true required: true
},
showAuthorPopover: {
type: Boolean,
default: true
} }
}, },
methods: { methods: {