feat: update format

This commit is contained in:
2023-12-14 13:11:21 +07:00
parent a93ebd3861
commit d9ab7893e0
120 changed files with 82 additions and 338 deletions

View File

@@ -2,11 +2,10 @@ import { NDKEvent, NostrEvent } from '@nostr-dev-kit/ndk';
import { useQuery } from '@tanstack/react-query';
import { nip19 } from 'nostr-tools';
import { AddressPointer } from 'nostr-tools/lib/types/nip19';
import { useArk } from '@libs/ark';
export function useEvent(id: undefined | string, embed?: undefined | string) {
const { ark } = useArk();
const ark = useArk();
const { status, isFetching, isError, data } = useQuery({
queryKey: ['event', id],
queryFn: async () => {

View File

@@ -1,6 +1,5 @@
import { useQuery } from '@tanstack/react-query';
import { invoke } from '@tauri-apps/api/primitives';
import { Opengraph } from '@utils/types';
export function useOpenGraph(url: string) {

View File

@@ -1,11 +1,10 @@
import { NDKUserProfile } from '@nostr-dev-kit/ndk';
import { useQuery } from '@tanstack/react-query';
import { nip19 } from 'nostr-tools';
import { useArk } from '@libs/ark';
export function useProfile(pubkey: string, embed?: string) {
const { ark } = useArk();
const ark = useArk();
const {
isLoading,
isError,

View File

@@ -1,10 +1,9 @@
import { NDKKind, NDKRelayUrl, NDKTag } from '@nostr-dev-kit/ndk';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useArk } from '@libs/ark';
export function useRelay() {
const { ark } = useArk();
const ark = useArk();
const queryClient = useQueryClient();
const connectRelay = useMutation({

View File

@@ -3,9 +3,7 @@ import { nip19 } from 'nostr-tools';
import { ReactNode } from 'react';
import { Link } from 'react-router-dom';
import reactStringReplace from 'react-string-replace';
import { useArk } from '@libs/ark';
import {
Hashtag,
ImagePreview,
@@ -56,7 +54,7 @@ const VIDEOS = [
];
export function useRichContent(content: string, textmode: boolean = false) {
const { ark } = useArk();
const ark = useArk();
let parsedContent: string | ReactNode[] = content.replace(/\n+/g, '\n');
let linkPreview: string;

View File

@@ -1,13 +1,11 @@
import { MentionOptions } from '@tiptap/extension-mention';
import { ReactRenderer } from '@tiptap/react';
import tippy from 'tippy.js';
import { MentionList } from '@app/new/components';
import { useArk } from '@libs/ark';
export function useSuggestion() {
const { ark } = useArk();
const ark = useArk();
const suggestion: MentionOptions['suggestion'] = {
items: async ({ query }) => {

View File

@@ -1,11 +1,9 @@
import { useMutation, useQueryClient } from '@tanstack/react-query';
import { useArk } from '@libs/ark';
import { Widget } from '@utils/types';
export function useWidget() {
const { ark } = useArk();
const ark = useArk();
const queryClient = useQueryClient();
const addWidget = useMutation({