Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Updated UI to show attachments

Jake Daynescafaab90086d
diff --git a/web/components/MessageThread.vue b/web/components/MessageThread.vue
index e2ed4739..51676b85 100644
--- a/web/components/MessageThread.vue
+++ b/web/components/MessageThread.vue
@@ -96,12 +96,9 @@
{{ thread.contact | phoneNumber }}
</v-list-item-title>
<v-list-item-subtitle class="text--secondary">
- <span v-if="thread.last_message_content">
+ <span>
{{ thread.last_message_content }}
</span>
- <span v-else>
- <v-icon small>{{ mdiPaperclip }}</v-icon> Multimedia Message
- </span>
</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action>
diff --git a/web/pages/threads/_id/index.vue b/web/pages/threads/_id/index.vue
index 06042a45..21ff39c7 100644
--- a/web/pages/threads/_id/index.vue
+++ b/web/pages/threads/_id/index.vue
@@ -173,6 +173,46 @@
>
</v-card-text>
</v-card>
+ <v-card
+ v-if="message.attachments"
+ shaped
+ >
+ <v-card-title>Message Attachments</v-card-title>
+ <v-card-text>
+ <v-row>
+ <v-col
+ v-for="(attachment, index) in message.attachments"
+ :key="index"
+ cols="12"
+ sm="6"
+ md="4"
+ >
+ <v-img
+ v-if="attachment.content_type?.startsWith('image/')"
+ :src="attachment.url"
+ :alt="`Attachment ${index + 1}`"
+ aspect-ratio="1"
+ class="bg-grey-lighten-2 rounded"
+ cover
+ >
+ <template v-slot:placeholder>
+ <v-row class="fill-height ma-0" align="center" justify="center">
+ <v-progress-circular
+ indeterminate
+ color="grey-lighten-1"
+ ></v-progress-circular>
+ </v-row>
+ </template>
+ </v-img>
+
+ <div v-else class="text-center pa-4 bg-grey-lighten-4 rounded">
+ <v-icon icon="mdi-file-document-outline" size="large"></v-icon>
+ <div class="text-caption mt-2">Unsupported file type</div>
+ </div>
+ </v-col>
+ </v-row>
+ </v-card-text>
+ </v-card>
<div class="d-flex">
<p class="ml-2 text--secondary caption mr-2">
{{ new Date(message.order_timestamp).toLocaleString() }}