feat(ark): add user component

This commit is contained in:
2024-01-13 08:21:49 +07:00
parent 0487b8a801
commit 1822eac488
18 changed files with 324 additions and 317 deletions

View File

@@ -4,7 +4,7 @@ import { ReactNode, useMemo } from "react";
import { Link } from "react-router-dom";
import reactStringReplace from "react-string-replace";
import { useEvent } from "../../hooks/useEvent";
import { NoteChildUser } from "./childUser";
import { User } from "../user";
import { Hashtag } from "./mentions/hashtag";
import { MentionUser } from "./mentions/user";
@@ -120,10 +120,17 @@ export function NoteChild({
{richContent}
</div>
</div>
<NoteChildUser
pubkey={data.pubkey}
subtext={isRoot ? "posted" : "replied"}
/>
<User.Provider pubkey={data.pubkey}>
<User.Root>
<User.Avatar className="size-10 shrink-0 rounded-lg object-cover" />
<div className="absolute left-2 top-2 inline-flex items-center gap-1.5 font-semibold leading-tight">
<User.Name />
<div className="font-normal text-neutral-700 dark:text-neutral-300">
{isRoot ? "posted:" : "replied:"}
</div>
</div>
</User.Root>
</User.Provider>
</div>
);
}