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> <template>
<div flex="~" gap-1 items-center absolute top-0 left-0 py-3 px-4> <div flex="~" gap-1 items-center>
<slot /> <slot />
</div> </div>
</template> </template>

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@ const props = withDefaults(
actions?: boolean actions?: boolean
context?: FilterContext context?: FilterContext
hover?: boolean hover?: boolean
decorated?: boolean faded?: boolean
showReplyTo?: boolean showReplyTo?: boolean
}>(), }>(),
{ actions: true, showReplyTo: true }, { actions: true, showReplyTo: true },
@ -62,13 +62,17 @@ const showRebloggedByAvatarOnAvatar = rebloggedBy && avatarOnAvatar && reblogged
<template> <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"> <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>
<CommonMetaWrapper v-if="rebloggedBy" text-secondary text-sm ws-nowrap> <slot name="meta">
<div i-ri:repeat-fill mr-1 text-primary /> <CommonMetaWrapper v-if="rebloggedBy" text-secondary text-sm ws-nowrap>
<AccountInlineInfo font-bold :account="rebloggedBy" :avatar="!avatarOnAvatar" /> <div i-ri:repeat-fill mr-1 text-primary />
</CommonMetaWrapper> <AccountInlineInfo font-bold :account="rebloggedBy" :avatar="!avatarOnAvatar" />
<div v-if="decorated || rebloggedBy || (showReplyTo && status.inReplyToAccountId)" h-6 /> </CommonMetaWrapper>
<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> <div relative>
<AccountHoverWrapper :account="status.account" :class="showRebloggedByAvatarOnAvatar ? 'mt-4' : 'mt-1'"> <AccountHoverWrapper :account="status.account" :class="showRebloggedByAvatarOnAvatar ? 'mt-4' : 'mt-1'">
<NuxtLink :to="getAccountRoute(status.account)" rounded-full> <NuxtLink :to="getAccountRoute(status.account)" rounded-full>

View File

@ -9,7 +9,7 @@ const account = useAccountById(status.inReplyToAccountId)
</script> </script>
<template> <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 <NuxtLink
v-if="status.inReplyToId" v-if="status.inReplyToId"
flex="~" items-center font-bold text-sm text-secondary gap-1 flex="~" items-center font-bold text-sm text-secondary gap-1