polish widget code

This commit is contained in:
Ren Amamiya
2023-09-29 09:11:38 +07:00
parent cb3c95b133
commit 2f87ed8949
22 changed files with 293 additions and 260 deletions

View File

@@ -14,7 +14,7 @@ export function ArticleNote(props: { event?: NDKEvent }) {
(tag) => tag[0] === 'published_at'
)?.[1];
if (publishedAt) {
publishedAt = new Date(parseInt(publishedAt)).toLocaleDateString('en-US');
publishedAt = new Date(parseInt(publishedAt) * 1000).toLocaleDateString('en-US');
} else {
publishedAt = new Date(props.event.created_at * 1000).toLocaleDateString('en-US');
}
@@ -29,7 +29,7 @@ export function ArticleNote(props: { event?: NDKEvent }) {
return (
<Link to={`/notes/article/${props.event.id}`} preventScrollReset={true}>
<div className="mb-2 mt-3 flex flex-col rounded-lg">
<div className="mb-2 mt-2 flex flex-col rounded-lg">
{metadata.image && (
<Image
src={metadata.image}