Skip to content

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

fix: add laout to new message page

Acho Arnold Ewin9027178a395d
diff --git a/web/app/components/MessageThread.vue b/web/app/components/MessageThread.vue
index f9cc89db..58f9ed39 100644
--- a/web/app/components/MessageThread.vue
+++ b/web/app/components/MessageThread.vue
@@ -51,8 +51,7 @@ function onInstallApp() {
threadsStore.threads.length === 0 &&
!threadsStore.archivedThreads
"
- class="text-center mt-8 mx-3"
- :color="mdAndDown ? '#121212' : '#363636'"
+ class="text-center mt-6 mx-3"
>
<div v-if="mdAndDown">
<v-img
@@ -69,7 +68,7 @@ function onInstallApp() {
color="primary"
:to="{ name: 'messages' }"
>
- <v-icon :icon="mdiPlus" />
+ <v-icon :icon="mdiPlus" start />
New Message
</v-btn>
</v-sheet>
diff --git a/web/app/layouts/default.vue b/web/app/layouts/default.vue
index 1256cb15..47c901de 100644
--- a/web/app/layouts/default.vue
+++ b/web/app/layouts/default.vue
@@ -66,10 +66,9 @@ function startPoller() {
<template>
<v-app>
- <v-divider v-if="appStore.isLocal" class="py-2 bg-warning" />
<v-navigation-drawer v-if="lgAndUp && hasDrawer" :width="400" permanent>
<template #prepend>
- <v-divider v-if="appStore.isLocal" class="py-2 bg-warning" />
+ <div v-if="appStore.isLocal" class="py-2 bg-warning" />
<MessageThreadHeader />
<div class="overflow-y-auto v-navigation-drawer__message-thread">
<MessageThread />
diff --git a/web/app/pages/messages/index.vue b/web/app/pages/messages/index.vue
index c291d0d4..9d27f28d 100644
--- a/web/app/pages/messages/index.vue
+++ b/web/app/pages/messages/index.vue
@@ -3,6 +3,7 @@ import { mdiArrowLeft, mdiSend, mdiCircle } from '@mdi/js'
import {
isValidPhoneNumber,
getCountryCallingCode,
+ parsePhoneNumber,
type CountryCode,
} from 'libphonenumber-js'
import { toApiError } from '~/utils/api-error'
@@ -98,6 +99,12 @@ async function sendMessage() {
onMounted(async () => {
await phonesStore.loadPhones()
+ if (phonesStore.owner) {
+ const country = parsePhoneNumber(phonesStore.owner)?.country
+ if (country) {
+ phoneCountry.value = country
+ }
+ }
})
</script>
@@ -119,6 +126,12 @@ onMounted(async () => {
<VContainer>
<VRow>
<VCol cols="12" md="8" offset-md="2" xl="6" offset-xl="3">
+ <p class="mb-8 mt-0">
+ Enter the recipient's phone number and your message below, and
+ we'll deliver a real SMS it through your connected Android phone.
+ You can also text a short code like
+ <v-code>24273</v-code> without entering a full phone number.
+ </p>
<form @submit.prevent="sendMessage">
<v-phone-input
v-model="formPhoneNumber"
@@ -146,22 +159,6 @@ onMounted(async () => {
placeholder="Enter your message here"
label="Content"
/>
- <VTextarea
- v-model="formAttachments"
- :error="errors.has('attachments')"
- :error-messages="errors.get('attachments')"
- :disabled="sending"
- variant="outlined"
- density="compact"
- rows="2"
- color="primary"
- class="mb-8"
- persistent-placeholder
- persistent-hint
- hint="The message will be sent as an MMS when a comma separated list of attachment URLs are present"
- placeholder="https://example.com/image.jpg, https://example.com/video.mp4"
- label="Attachment URLs (optional)"
- />
<loading-button
:disabled="sending"
:block="mdAndDown"