Commit 11fc92d4 authored by Killian Kemps's avatar Killian Kemps

Display photos in conversations

parent 55ec3271
......@@ -7,6 +7,11 @@
<template v-if="attachment.type === 'sticker'">
<img v-bind:src="attachment.url" v-bind:width="attachment.width"/>
</template>
<template v-if="attachment.type === 'photo'">
<a v-bind:href="attachment.previewUrl">
<img v-bind:src="attachment.thumbnailUrl" v-bind:alt="attachment.name"/>
</a>
</template>
<template v-else>
<img v-bind:src="attachment.image" v-bind:alt="attachment.title" width="150px"/>
</template>
......
......@@ -4,11 +4,22 @@
<li v-for="conversation in conversations">
<router-link :to="{ name: 'conversation', params: { conversationID: conversation.threadID , conversationName: conversation.name}}">
{{ conversation.name }}
<img v-bind:src="conversation.imageSrc" width="30px"/>
<template v-if="conversation.imageSrc">
<img v-bind:src="conversation.imageSrc" width="30px"/>
</template>
<!-- Temporary placeholder if conversation has no image -->
<template v-else>
<div style="width: 30px; height: 30px; display: inline-block; background-color: gray;"></div>
</template>
{{ conversation.snippet }}
<!-- Display image in snippet if there is one -->
<template v-if="conversation.snippetAttachments.length > 0">
<img v-bind:src="conversation.snippetAttachments[0].url"/>
<!-- Display images in snippet if there are some -->
<template v-for="attachment in conversation.snippetAttachments">
<template v-if="attachment.attach_type === 'photo'">
<img v-bind:src="attachment.thumbnail_url"/>
</template>
<template v-else>
<img v-bind:src="attachment.url"/>
</template>
</template>
</router-link>
</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment