clean up & save onboarding process as state
This commit is contained in:
@@ -15,12 +15,12 @@ import { MentionNote } from '@shared/notes';
|
||||
|
||||
import { useComposer } from '@stores/composer';
|
||||
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
import { useNostr } from '@utils/hooks/useNostr';
|
||||
import { useImageUploader } from '@utils/hooks/useUploader';
|
||||
import { sendNativeNotification } from '@utils/notification';
|
||||
|
||||
export function Composer() {
|
||||
const { publish } = usePublish();
|
||||
const { publish } = useNostr();
|
||||
|
||||
const [status, setStatus] = useState<null | 'loading' | 'done'>(null);
|
||||
const [reply, clearReply] = useComposer((state) => [state.reply, state.clearReply]);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Image } from '@shared/image';
|
||||
import { DEFAULT_AVATAR } from '@stores/constants';
|
||||
|
||||
import { useAccount } from '@utils/hooks/useAccount';
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
import { useNostr } from '@utils/hooks/useNostr';
|
||||
|
||||
export function EditProfileModal() {
|
||||
const queryClient = useQueryClient();
|
||||
@@ -24,7 +24,7 @@ export function EditProfileModal() {
|
||||
const [banner, setBanner] = useState('');
|
||||
const [nip05, setNIP05] = useState({ verified: false, text: '' });
|
||||
|
||||
const { publish } = usePublish();
|
||||
const { publish } = useNostr();
|
||||
const { account } = useAccount();
|
||||
const {
|
||||
register,
|
||||
@@ -65,7 +65,6 @@ export function EditProfileModal() {
|
||||
|
||||
const res: any = await fetch(verifyURL, {
|
||||
method: 'GET',
|
||||
timeout: 30,
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=utf-8',
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
||||
|
||||
import { ReactionIcon } from '@shared/icons';
|
||||
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
import { useNostr } from '@utils/hooks/useNostr';
|
||||
|
||||
const REACTIONS = [
|
||||
{
|
||||
@@ -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 } = useNostr();
|
||||
|
||||
const getReactionImage = (content: string) => {
|
||||
const reaction: { img: string } = REACTIONS.find((el) => el.content === content);
|
||||
|
||||
@@ -2,16 +2,14 @@ import * as Tooltip from '@radix-ui/react-tooltip';
|
||||
|
||||
import { RepostIcon } from '@shared/icons';
|
||||
|
||||
import { FULL_RELAYS } from '@stores/constants';
|
||||
|
||||
import { usePublish } from '@utils/hooks/usePublish';
|
||||
import { useNostr } from '@utils/hooks/useNostr';
|
||||
|
||||
export function NoteRepost({ id, pubkey }: { id: string; pubkey: string }) {
|
||||
const { publish } = usePublish();
|
||||
const { publish } = useNostr();
|
||||
|
||||
const submit = async () => {
|
||||
const tags = [
|
||||
['e', id, FULL_RELAYS[0], 'root'],
|
||||
['e', id, 'wss://relayable.org', 'root'],
|
||||
['p', pubkey],
|
||||
];
|
||||
await publish({ content: '', kind: 6, tags: tags });
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -5,12 +5,12 @@ import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, FULL_RELAYS } from '@stores/constants';
|
||||
|
||||
import { useNostr } from '@utils/hooks/useNostr';
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
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 } = useNostr();
|
||||
const { status, user } = useProfile(pubkey);
|
||||
|
||||
const [value, setValue] = useState('');
|
||||
|
||||
Reference in New Issue
Block a user