feat: threads improvements (#562)

This commit is contained in:
patak 2022-12-26 08:37:42 +01:00 committed by GitHub
parent baa2696d31
commit d9e8703882
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 91 additions and 78 deletions

View file

@ -1,10 +1,13 @@
<script setup lang="ts">
import type { Status } from 'masto'
const props = defineProps<{
const props = withDefaults(defineProps<{
status: Status
command?: boolean
}>()
actions?: boolean
}>(), {
actions: true,
})
const status = $computed(() => {
if (props.status.reblog && props.status.reblog)
@ -33,37 +36,7 @@ const isDM = $computed(() => status.visibility === 'direct')
<AccountInfo :account="status.account" />
</AccountHoverWrapper>
</NuxtLink>
<div
space-y-3
:class="{
'pt2 pb0.5 px3.5 br2 bg-fade border-primary-light border-1 rounded-3': isDM,
}"
>
<StatusSpoiler :enabled="status.sensitive">
<template #spoiler>
<p text-2xl>
{{ status.spoilerText }}
</p>
</template>
<StatusBody :status="status" :with-action="false" text-xl />
<StatusPoll
v-if="status.poll"
:poll="status.poll"
/>
<StatusMedia
v-if="status.mediaAttachments?.length"
:status="status"
full-size
/>
<StatusPreviewCard
v-if="status.card"
:card="status.card"
:small-picture-only="status.mediaAttachments?.length > 0"
mt-2
/>
<div v-if="isDM" />
</StatusSpoiler>
</div>
<StatusContent :status="status" context="details" />
<div flex="~ gap-1" items-center text-secondary text-sm>
<div flex>
<div>{{ createdAt }}</div>
@ -85,6 +58,8 @@ const isDM = $computed(() => status.visibility === 'direct')
{{ status.application?.name }}
</div>
</div>
<StatusActions :status="status" details :command="command" border="t base" pt-2 />
<div border="t base" pt-2>
<StatusActions v-if="actions" :status="status" details :command="command" />
</div>
</div>
</template>