feat: use time tag
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
useDismiss,
|
||||
} from "@floating-ui/react-dom-interactions"
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import dayjs from "~/lib/date"
|
||||
import dayjs, { formatToISO } from "~/lib/date"
|
||||
import { FollowingButton } from "~/components/common/FollowingButton"
|
||||
import { FollowingCount } from "~/components/common/FollowingCount"
|
||||
import * as siteModel from "~/models/site.model"
|
||||
@@ -95,13 +95,15 @@ export const CharacterCard: React.FC<{
|
||||
</span>
|
||||
<span className="block text-gray-500">
|
||||
Joined{" "}
|
||||
{dayjs
|
||||
.duration(
|
||||
dayjs(site?.date_created).diff(dayjs(), "minute"),
|
||||
"minute",
|
||||
)
|
||||
.humanize()}{" "}
|
||||
ago
|
||||
<time dateTime={formatToISO(site?.date_created)}>
|
||||
{dayjs
|
||||
.duration(
|
||||
dayjs(site?.date_created).diff(dayjs(), "minute"),
|
||||
"minute",
|
||||
)
|
||||
.humanize()}{" "}
|
||||
ago
|
||||
</time>
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Avatar } from "~/components/ui/Avatar"
|
||||
import dayjs from "~/lib/date"
|
||||
import dayjs, { formatToISO } from "~/lib/date"
|
||||
import { UniLink } from "~/components/ui/UniLink"
|
||||
import { BlockchainIcon } from "~/components/icons/BlockchainIcon"
|
||||
import { CSB_SCAN } from "~/lib/env"
|
||||
@@ -62,13 +62,16 @@ export const CommentItem: React.FC<{
|
||||
{comment?.character?.metadata?.content?.name}
|
||||
</UniLink>{" "}
|
||||
·{" "}
|
||||
{dayjs
|
||||
.duration(
|
||||
dayjs(comment?.createdAt).diff(dayjs(), "minute"),
|
||||
"minute",
|
||||
)
|
||||
.humanize()}{" "}
|
||||
ago ·{" "}
|
||||
<time dateTime={formatToISO(comment?.createdAt)}>
|
||||
{dayjs
|
||||
.duration(
|
||||
dayjs(comment?.createdAt).diff(dayjs(), "minute"),
|
||||
"minute",
|
||||
)
|
||||
.humanize()}{" "}
|
||||
ago
|
||||
</time>{" "}
|
||||
·{" "}
|
||||
<UniLink href={`${CSB_SCAN}/tx/${comment.transactionHash}`}>
|
||||
<BlockchainIcon className="w-3 h-3 inline-block" />
|
||||
</UniLink>
|
||||
|
||||
Reference in New Issue
Block a user