wip: zap
This commit is contained in:
@@ -28,7 +28,7 @@ export function NoteActions({
|
||||
<NoteReply id={id} pubkey={pubkey} />
|
||||
<NoteReaction id={id} pubkey={pubkey} />
|
||||
<NoteRepost id={id} pubkey={pubkey} />
|
||||
<NoteZap />
|
||||
<NoteZap id={id} />
|
||||
</div>
|
||||
{!noOpenThread && (
|
||||
<>
|
||||
|
||||
@@ -32,7 +32,7 @@ export function NoteReaction({ id, pubkey }: { id: string; pubkey: string }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [reaction, setReaction] = useState<string | null>(null);
|
||||
|
||||
const publish = usePublish();
|
||||
const { publish } = usePublish();
|
||||
|
||||
const getReactionImage = (content: string) => {
|
||||
const reaction: { img: string } = REACTIONS.find((el) => el.content === content);
|
||||
|
||||
@@ -7,7 +7,7 @@ import { FULL_RELAYS } from '@stores/constants';
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
|
||||
export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) {
|
||||
const publish = usePublish();
|
||||
const { publish } = usePublish();
|
||||
|
||||
const submit = async () => {
|
||||
const tags = [
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
import { NostrEvent } from '@nostr-dev-kit/ndk';
|
||||
import * as Tooltip from '@radix-ui/react-tooltip';
|
||||
|
||||
import { ZapIcon } from '@shared/icons';
|
||||
|
||||
export function NoteZap() {
|
||||
import { useEvent } from '@utils/hooks/useEvent';
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
|
||||
export function NoteZap({ id }: { id: string }) {
|
||||
const { createZap } = usePublish();
|
||||
const { data: event } = useEvent(id);
|
||||
|
||||
const submit = async () => {
|
||||
const res = await createZap(event as NostrEvent, 21000);
|
||||
console.log(res);
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip.Root delayDuration={150}>
|
||||
<Tooltip.Trigger asChild>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => submit()}
|
||||
className="group inline-flex h-7 w-7 items-center justify-center"
|
||||
>
|
||||
<ZapIcon className="h-5 w-5 text-zinc-300 group-hover:text-orange-400" />
|
||||
|
||||
@@ -10,9 +10,9 @@ import { usePublish } from '@utils/hooks/usePublish';
|
||||
import { displayNpub } from '@utils/shortenKey';
|
||||
|
||||
export function NoteReplyForm({ id, pubkey }: { id: string; pubkey: string }) {
|
||||
const publish = usePublish();
|
||||
|
||||
const { publish } = usePublish();
|
||||
const { status, user } = useProfile(pubkey);
|
||||
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
const submit = () => {
|
||||
|
||||
Reference in New Issue
Block a user