feat: refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NDKAppHandlerEvent } from "@nostr-dev-kit/ndk";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useArk } from "../../provider";
|
||||
import { useArk } from "../../hooks/useArk";
|
||||
|
||||
export function AppHandler({ tag }: { tag: string[] }) {
|
||||
const ark = useArk();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { webln } from "@getalby/sdk";
|
||||
import { SendPaymentResponse } from "@getalby/sdk/dist/types";
|
||||
import { CancelIcon, ZapIcon } from "@lume/icons";
|
||||
import { useStorage } from "@lume/storage";
|
||||
import {
|
||||
compactNumber,
|
||||
displayNpub,
|
||||
@@ -13,8 +14,8 @@ import { QRCodeSVG } from "qrcode.react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import CurrencyInput from "react-currency-input-field";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useArk } from "../../../hooks/useArk";
|
||||
import { useProfile } from "../../../hooks/useProfile";
|
||||
import { useArk, useStorage } from "../../../provider";
|
||||
import { useNoteContext } from "../provider";
|
||||
|
||||
export function NoteZap() {
|
||||
@@ -87,7 +88,7 @@ export function NoteZap() {
|
||||
useEffect(() => {
|
||||
async function getWalletConnectURL() {
|
||||
const uri: string = await invoke("secure_load", {
|
||||
key: `${storage.account.pubkey}-nwc`,
|
||||
key: `${ark.account.pubkey}-nwc`,
|
||||
});
|
||||
if (uri) setWalletConnectURL(uri);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export function NoteChild({
|
||||
"\n",
|
||||
);
|
||||
|
||||
const text = parsedContent;
|
||||
const text = parsedContent as string;
|
||||
const words = text.split(/( |\n)/);
|
||||
|
||||
const hashtags = words.filter((word) => word.startsWith("#"));
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useStorage } from "@lume/storage";
|
||||
import {
|
||||
AUDIOS,
|
||||
IMAGES,
|
||||
@@ -15,7 +16,6 @@ import { nip19 } from "nostr-tools";
|
||||
import { ReactNode, useMemo, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import reactStringReplace from "react-string-replace";
|
||||
import { useStorage } from "../../provider";
|
||||
import { Hashtag } from "./mentions/hashtag";
|
||||
import { MentionNote } from "./mentions/note";
|
||||
import { MentionUser } from "./mentions/user";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useArk } from "../../provider";
|
||||
import { useArk } from "../../hooks/useArk";
|
||||
import { AppHandler } from "./appHandler";
|
||||
import { useNoteContext } from "./provider";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NDKEvent, NostrEvent } from "@nostr-dev-kit/ndk";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { Note } from "..";
|
||||
import { useArk } from "../../../provider";
|
||||
import { useArk } from "../../../hooks/useArk";
|
||||
|
||||
export function RepostNote({
|
||||
event,
|
||||
|
||||
Reference in New Issue
Block a user