feat: shorts list icons

This commit is contained in:
DIYgod 2023-09-23 01:55:15 +08:00
parent e9aed94d3f
commit 0d3ae54e1a
No known key found for this signature in database
3 changed files with 14 additions and 3 deletions

View File

@ -272,11 +272,13 @@ const Card = ({
</span>
</CharacterFloatCard>
<Titles characterId={+character?.characterId} />
<span className="text-zinc-400 hidden sm:inline-block">·</span>
{!isShort && (
<span className="text-zinc-400 hidden sm:inline-block">·</span>
)}
</>
)}
{isShort && (
<span className="xlog-post-meta text-zinc-400 flex items-center text-[13px] truncate space-x-2">
<span className="xlog-post-meta text-zinc-400 flex items-center text-[13px] truncate space-x-2 !ml-2">
{!!post.stat?.likesCount && (
<span className="xlog-post-views inline-flex items-center">
<i className="icon-[mingcute--thumb-up-2-line] mr-[2px] text-base" />

View File

@ -138,7 +138,11 @@ export const expandCrossbellNote = async ({
)
).json()
expandedNote.stat = stat
} else if ((expandedNote as any)._count) {
}
if ((expandedNote as any)._count) {
if (!expandedNote.stat) {
expandedNote.stat = {}
}
expandedNote.stat.commentsCount = (expandedNote as any)._count.fromNotes
expandedNote.stat.likesCount = (expandedNote as any)._count.links
}

View File

@ -300,6 +300,10 @@ export async function getFeed({
${cursorQuery}
) {
${resultFields}
_count {
fromNotes
links
}
}
}
`,
@ -315,6 +319,7 @@ export async function getFeed({
expandCrossbellNote({
note: page,
useScore: true,
useStat: true,
useHTML,
}),
),