1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-12 20:09:59 +00:00

feat(status): add visibility indicator

closes #117
This commit is contained in:
三咲智子 2022-11-26 11:02:26 +08:00
parent b379322ce2
commit 714b8d2bb1
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
2 changed files with 12 additions and 5 deletions

View file

@ -21,7 +21,7 @@ const rebloggedBy = $computed(() => props.status.reblog ? props.status.account :
const el = ref<HTMLElement>()
const router = useRouter()
function onclick(e: MouseEvent) {
function onclick(e: MouseEvent | KeyboardEvent) {
const path = e.composedPath() as HTMLElement[]
const el = path.find(el => ['A', 'BUTTON', 'IMG', 'VIDEO'].includes(el.tagName?.toUpperCase()))
if (!el)

View file

@ -12,6 +12,8 @@ const status = $computed(() => {
})
const date = useFormattedDateTime(status.createdAt)
const visibility = $computed(() => STATUS_VISIBILITIES.find(v => v.value === status.visibility)!)
</script>
<template>
@ -28,10 +30,15 @@ const date = useFormattedDateTime(status.createdAt)
:status="status"
/>
</StatusSpoiler>
<div>
<span op50 text-sm>
{{ date }} {{ status.application?.name ? `· ${status.application?.name}` : '' }}
</span>
<div flex="~ gap-1" items-center op50 text-sm>
<div>{{ date }}</div>
<div>·</div>
<CommonTooltip :content="visibility.label" placement="bottom">
<div :class="visibility.icon" />
</CommonTooltip>
<div v-if="status.application?.name">
· {{ status.application?.name }}
</div>
</div>
<StatusActions :status="status" border="t base" pt-2 />
</div>