clean up & save onboarding process as state

This commit is contained in:
Ren Amamiya
2023-08-10 12:34:11 +07:00
parent d63690e9d0
commit e6d8f084ae
38 changed files with 545 additions and 695 deletions

View File

@@ -8,10 +8,10 @@ import { Button } from '@shared/button';
import { CancelIcon, ZapIcon } from '@shared/icons';
import { useEvent } from '@utils/hooks/useEvent';
import { usePublish } from '@utils/hooks/usePublish';
import { useNostr } from '@utils/hooks/useNostr';
export function NoteZap({ id }: { id: string }) {
const { createZap } = usePublish();
const { createZap } = useNostr();
const { data: event } = useEvent(id);
const [amount, setAmount] = useState<null | number>(null);
@@ -23,6 +23,7 @@ export function NoteZap({ id }: { id: string }) {
};
const createZapRequest = async () => {
// @ts-expect-error, todo: fix this
const res = await createZap(event as unknown as NostrEvent, amount);
if (res) setInvoice(res);
};