mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-26 03:06:47 +03:00
2442c80bfb
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
33 lines
752 B
Vue
33 lines
752 B
Vue
<script setup lang="ts">
|
|
const masto = await useMasto()
|
|
|
|
let draftPost = $ref('')
|
|
let isSending = $ref(false)
|
|
|
|
async function publish() {
|
|
try {
|
|
isSending = true
|
|
await masto.statuses.create({ status: draftPost })
|
|
draftPost = ''
|
|
}
|
|
finally {
|
|
isSending = false
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div xl:w-70 flex flex-col gap-4 :class="isSending ? ' pointer-events-none' : ''">
|
|
<textarea
|
|
v-model="draftPost"
|
|
placeholder="What's on your mind?"
|
|
p2 border-rounded w-full h-40
|
|
bg-gray:10 outline-none border="~ border"
|
|
/>
|
|
<div flex justify-end>
|
|
<button h-9 w-22 bg-primary border-rounded :disabled="draftPost === ''" @click="publish">
|
|
Publish!
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</template>
|