refactor: improve status card UI (#28)

This commit is contained in:
三咲智子 Kevin Deng 2022-11-23 16:37:31 +08:00 committed by GitHub
parent 8f54b6db2e
commit 074da4768e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -24,8 +24,8 @@ const router = useRouter()
function go(e: MouseEvent) {
const path = e.composedPath() as HTMLElement[]
const el = path.find(el => ['A', 'BUTTON', 'P', 'IMG', 'VIDEO'].includes(el.tagName?.toUpperCase()))
if (!el || el.tagName.toUpperCase() === 'P')
const el = path.find(el => ['A', 'BUTTON', 'IMG', 'VIDEO'].includes(el.tagName?.toUpperCase()))
if (!el)
router.push(`/@${status.account.acct}/${status.id}`)
}
@ -63,7 +63,7 @@ const timeago = useTimeAgo(() => status.createdAt, {
</script>
<template>
<div ref="el" flex flex-col gap-2 my-2 px-4 @click="go">
<div ref="el" flex flex-col gap-2 px-4 hover:bg="gray/10" transition="duration-100" cursor-pointer @click="go">
<div v-if="rebloggedBy" pl8>
<div flex gap-1 items-center text-gray:75 text-sm>
<div i-ri:repeat-fill mr-1 />