feat: publish and show sensitive content
This commit is contained in:
parent
f54e135848
commit
43479aaa66
2 changed files with 35 additions and 1 deletions
|
@ -63,6 +63,10 @@ async function pickAttachments() {
|
|||
await uploadAttachments(files)
|
||||
}
|
||||
|
||||
async function toggleSensitive() {
|
||||
draft.params.sensitive = !draft.params.sensitive
|
||||
}
|
||||
|
||||
async function uploadAttachments(files: File[]) {
|
||||
isUploading = true
|
||||
for (const file of files) {
|
||||
|
@ -137,6 +141,16 @@ onUnmounted(() => {
|
|||
border="2 dashed transparent" p-1
|
||||
:class="[isSending ? 'pointer-events-none' : '', isOverDropZone ? '!border-primary' : '']"
|
||||
>
|
||||
<div v-if="draft.params.sensitive">
|
||||
<input
|
||||
v-model="draft.params.spoilerText"
|
||||
type="text"
|
||||
placeholder="Write your warning here"
|
||||
p2 border-rounded w-full bg-transparent
|
||||
outline-none border="~ base"
|
||||
>
|
||||
</div>
|
||||
|
||||
<textarea
|
||||
v-model="draft.params.status"
|
||||
:placeholder="placeholder"
|
||||
|
@ -174,6 +188,13 @@ onUnmounted(() => {
|
|||
|
||||
<div flex-auto />
|
||||
|
||||
<CommonTooltip placement="bottom" content="Add content warning">
|
||||
<button btn-action-icon @click="toggleSensitive">
|
||||
<div v-if="draft.params.sensitive" i-ri:alarm-warning-fill text-orange />
|
||||
<div v-else i-ri:alarm-warning-line />
|
||||
</button>
|
||||
</CommonTooltip>
|
||||
|
||||
<CommonDropdown>
|
||||
<button btn-action-icon w-12>
|
||||
<div :class="currentVisibility.icon" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue