refactor: getAccountHandle, getAccountPath, getStatusPath
This commit is contained in:
parent
713617e19a
commit
f596973603
8 changed files with 26 additions and 14 deletions
|
@ -37,7 +37,7 @@ const toggleBookmark = () => toggleStatusAction(
|
|||
|
||||
<template>
|
||||
<div flex justify-between gap-8>
|
||||
<RouterLink flex gap-1 items-center rounded op50 hover="op100 text-blue" group :to="`/@${status.account.acct}/${status.id}`">
|
||||
<RouterLink flex gap-1 items-center rounded op50 hover="op100 text-blue" group :to="getStatusPath(status)">
|
||||
<div rounded-full p2 group-hover="bg-blue/10">
|
||||
<div i-ri:chat-3-line />
|
||||
</div>
|
||||
|
|
|
@ -26,7 +26,7 @@ function go(e: MouseEvent) {
|
|||
const path = e.composedPath() as HTMLElement[]
|
||||
const el = path.find(el => ['A', 'BUTTON', 'IMG', 'VIDEO'].includes(el.tagName?.toUpperCase()))
|
||||
if (!el)
|
||||
router.push(`/@${status.account.acct}/${status.id}`)
|
||||
router.push(getStatusPath(status))
|
||||
}
|
||||
|
||||
const timeago = useTimeAgo(() => status.createdAt, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue