add follow/unfollow function

This commit is contained in:
Ren Amamiya
2023-06-27 16:12:21 +07:00
parent 6abff45678
commit a29ef03198
9 changed files with 85 additions and 69 deletions

View File

@@ -1,12 +1,12 @@
import { usePublish } from "@libs/ndk";
import { Button } from "@shared/button";
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { DEFAULT_AVATAR, FULL_RELAYS } from "@stores/constants";
import { useAccount } from "@utils/hooks/useAccount";
import { useProfile } from "@utils/hooks/useProfile";
import { useState } from "react";
export function NoteReplyForm({ id }: { id: string }) {
export function NoteReplyForm({ rootID }: { rootID: string }) {
const publish = usePublish();
const { account } = useAccount();
@@ -15,7 +15,7 @@ export function NoteReplyForm({ id }: { id: string }) {
const [value, setValue] = useState("");
const submit = () => {
const tags = [["e", id]];
const tags = [["e", rootID, FULL_RELAYS[0], "root"]];
// publish event
publish({ content: value, kind: 1, tags });

View File

@@ -33,7 +33,7 @@ export function User({
}`}
>
<Popover.Button
className={`${avatarWidth} ${avatarHeight} relative z-10 bg-zinc-900 shrink-0 overflow-hidden`}
className={`${avatarWidth} ${avatarHeight} relative z-50 bg-zinc-900 shrink-0 overflow-hidden`}
>
<Image
src={user?.image}