feat: add published date
This commit is contained in:
@@ -39,10 +39,16 @@ const getAlias = (did: string) => aka.value.get(did) ?? ""
|
|||||||
class="btn btn-link"
|
class="btn btn-link"
|
||||||
>{{ note.title }}</router-link
|
>{{ note.title }}</router-link
|
||||||
>
|
>
|
||||||
|
|
||||||
<div class="text-xs opacity-80 alias">
|
<div class="text-xs opacity-80 alias">
|
||||||
<span v-if="getAlias(note.did)">
|
<span v-if="getAlias(note.did)">
|
||||||
{{ getAlias(note.did) }}
|
{{ getAlias(note.did) }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="note.publishedAt"
|
||||||
|
> • {{
|
||||||
|
new Date(note.publishedAt).toLocaleDateString()
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
<div v-else class="skeleton h-4 w-20"></div>
|
<div v-else class="skeleton h-4 w-20"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -93,6 +93,11 @@ const content = computed(() =>
|
|||||||
? toHTML(withATProtoImages(article.value?.value.content))
|
? toHTML(withATProtoImages(article.value?.value.content))
|
||||||
: "",
|
: "",
|
||||||
)
|
)
|
||||||
|
const publishedAt = computed(() =>
|
||||||
|
article.value?.value.publishedAt
|
||||||
|
? new Date(article.value?.value.publishedAt).toLocaleDateString()
|
||||||
|
: null,
|
||||||
|
)
|
||||||
|
|
||||||
const { listenToClick } = useATProtoLinks("note-display")
|
const { listenToClick } = useATProtoLinks("note-display")
|
||||||
|
|
||||||
@@ -117,7 +122,9 @@ watch(
|
|||||||
>{{ title }}</a
|
>{{ title }}</a
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<span class="badge badge-accent" v-if="author">{{ author.alias }}</span>
|
<span class="badge badge-accent badge-author" v-if="author">{{
|
||||||
|
author.alias
|
||||||
|
}}</span>
|
||||||
<article class="note-display" v-html="content"></article>
|
<article class="note-display" v-html="content"></article>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'Home' }"
|
:to="{ name: 'Home' }"
|
||||||
@@ -162,7 +169,7 @@ watch(
|
|||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.badge-author {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0.4rem;
|
top: 0.4rem;
|
||||||
right: 2rem;
|
right: 2rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user