fix: status card styles (#415)

zio/stable
patak 2022-12-13 15:56:00 +01:00 committed by GitHub
parent 0ef44cdf50
commit 965b96c630
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 44 deletions

View File

@ -1,5 +1,5 @@
<template>
<div flex="~" gap-1 items-center absolute top-0 left-0 py-3 px-4>
<div flex="~" gap-1 items-center>
<slot />
</div>
</template>

View File

@ -12,12 +12,15 @@ const withAccounts = $computed(() =>
<template>
<article v-if="conversation.lastStatus" flex flex-col gap-2>
<div absolute flex gap-2 text-sm text-secondary font-bold left-3 px2 pt2>
<StatusCard v-if="conversation.lastStatus" :status="conversation.lastStatus" :actions="false">
<template #meta>
<div flex gap-2 text-sm text-secondary font-bold>
<p mr-1>
{{ $t('conversation.with') }}
</p>
<AccountAvatar v-for="account in withAccounts" :key="account.id" h-5 w-5 :account="account" />
</div>
<StatusCard v-if="conversation.lastStatus" :decorated="true" :status="conversation.lastStatus" :actions="false" />
</template>
</StatusCard>
</article>
</template>

View File

@ -42,20 +42,28 @@ const { notification } = defineProps<{
<AccountCard :account="notification.account" />
</template>
<template v-else-if="notification.type === 'favourite'">
<CommonMetaWrapper z-1>
<StatusCard :status="notification.status!" :faded="true">
<template #meta>
<CommonMetaWrapper>
<div i-ri:heart-fill text-xl mr-1 color-red />
<AccountInlineInfo text-primary font-bold :account="notification.account" mr1 />
</CommonMetaWrapper>
<StatusCard op50 hover:op100 :status="notification.status!" :decorated="true" />
</template>
</StatusCard>
</template>
<template v-else-if="notification.type === 'reblog'">
<CommonMetaWrapper z-1>
<StatusCard :status="notification.status!" :faded="true">
<template #meta>
<CommonMetaWrapper>
<div i-ri:repeat-fill text-xl mr-1 color-green />
<AccountInlineInfo text-primary font-bold :account="notification.account" mr1 />
</CommonMetaWrapper>
<StatusCard op50 hover:op100 :status="notification.status!" :decorated="true" />
</template>
</StatusCard>
</template>
<template v-else-if="notification.type === 'update'">
<StatusCard :status="notification.status!" :faded="true">
<template #meta>
<CommonMetaWrapper z-1>
<div i-ri:edit-2-fill text-xl mr-1 text-secondary />
<AccountInlineInfo :account="notification.account" mr1 />
@ -63,7 +71,8 @@ const { notification } = defineProps<{
{{ $t('notification.update_status') }}
</span>
</CommonMetaWrapper>
<StatusCard :status="notification.status!" :decorated="true" />
</template>
</StatusCard>
</template>
<template v-else-if="notification.type === 'mention' || notification.type === 'poll' || notification.type === 'status'">
<StatusCard :status="notification.status!" />

View File

@ -8,14 +8,17 @@ const { group } = defineProps<{
<template>
<article flex flex-col relative>
<div flex flex-col class="-mb-12" py-3>
<div v-for="like of group.likes" :key="like.account.id" flex px-3 py-1>
<StatusCard :status="group.status!" :faded="true">
<template #meta>
<div flex flex-col gap-2>
<div v-for="like of group.likes" :key="like.account.id" flex>
<div v-if="like.reblog" i-ri:repeat-fill text-xl mr-2 color-green />
<div v-if="like.favourite && !like.reblog" i-ri:heart-fill text-xl mr-2 color-red />
<AccountInlineInfo text-primary font-bold :account="like.account" mr2 />
<div v-if="like.favourite && like.reblog" i-ri:heart-fill text-xl mr-2 color-red />
</div>
</div>
<StatusCard op50 hover:op100 :status="group.status!" :decorated="true" />
</template>
</StatusCard>
</article>
</template>

View File

@ -7,7 +7,7 @@ const props = withDefaults(
actions?: boolean
context?: FilterContext
hover?: boolean
decorated?: boolean
faded?: boolean
showReplyTo?: boolean
}>(),
{ actions: true, showReplyTo: true },
@ -62,13 +62,17 @@ const showRebloggedByAvatarOnAvatar = rebloggedBy && avatarOnAvatar && reblogged
<template>
<div v-if="filter?.filterAction !== 'hide'" :id="`status-${status.id}`" ref="el" relative flex flex-col gap-2 px-4 pt-3 pb-4 transition-100 :class="{ 'hover:bg-active': hover }" tabindex="0" focus:outline-none focus-visible:ring="2 primary" @click="onclick" @keydown.enter="onclick">
<StatusReplyingTo v-if="showReplyTo" :status="status" />
<div flex justify-between pb1>
<slot name="meta">
<CommonMetaWrapper v-if="rebloggedBy" text-secondary text-sm ws-nowrap>
<div i-ri:repeat-fill mr-1 text-primary />
<AccountInlineInfo font-bold :account="rebloggedBy" :avatar="!avatarOnAvatar" />
</CommonMetaWrapper>
<div v-if="decorated || rebloggedBy || (showReplyTo && status.inReplyToAccountId)" h-6 />
<div flex gap-4>
<div v-else />
</slot>
<StatusReplyingTo v-if="showReplyTo" :status="status" :class="faded ? 'text-secondary-light' : ''" />
</div>
<div flex gap-4 :class="faded ? 'text-secondary' : ''">
<div relative>
<AccountHoverWrapper :account="status.account" :class="showRebloggedByAvatarOnAvatar ? 'mt-4' : 'mt-1'">
<NuxtLink :to="getAccountRoute(status.account)" rounded-full>

View File

@ -9,7 +9,7 @@ const account = useAccountById(status.inReplyToAccountId)
</script>
<template>
<div v-if="status.inReplyToAccountId" absolute top-0 right-0 px-4 py-3 flex="~ wrap" gap-1>
<div v-if="status.inReplyToAccountId" flex="~ wrap" gap-1>
<NuxtLink
v-if="status.inReplyToId"
flex="~" items-center font-bold text-sm text-secondary gap-1