feat: publish and show sensitive content

This commit is contained in:
三咲智子 2022-11-25 20:10:45 +08:00
parent f54e135848
commit 43479aaa66
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 35 additions and 1 deletions

View file

@ -5,10 +5,23 @@ const { status } = defineProps<{
status: Status
}>()
const { translation } = useTranslation(status)
const [showContent, toggleContent] = $(useToggle(!status.sensitive))
</script>
<template>
<div class="status-body" whitespace-pre-wrap break-words>
<ContentRichSetup :content="translation.visible ? translation.text : status.content" :emojis="status.emojis" />
<template v-if="status.sensitive">
{{ status.spoilerText }}
<button btn-outline px-2 py-1 text-3 @click="toggleContent()">
{{ showContent ? 'Show less' : 'Show more' }}
</button>
</template>
<ContentRichSetup
v-if="showContent"
:content="translation.visible ? translation.text : status.content"
:emojis="status.emojis"
/>
</div>
</template>