chore: fixed circular import

This commit is contained in:
2024-01-12 14:46:50 +07:00
parent a9d10ff93b
commit ad6ae6745d
16 changed files with 509 additions and 906 deletions

View File

@@ -11,5 +11,3 @@ export const Column = {
Content: ColumnContent,
Route: Route,
};
export * from "./provider";

View File

@@ -1,8 +1,8 @@
import { PinIcon } from "@lume/icons";
import { COL_TYPES } from "@lume/utils";
import * as Tooltip from "@radix-ui/react-tooltip";
import { useNoteContext } from "..";
import { useColumnContext } from "../../column";
import { useColumnContext } from "../../column/provider";
import { useNoteContext } from "../provider";
export function NotePin() {
const event = useNoteContext();

View File

@@ -15,17 +15,15 @@ import { nip19 } from "nostr-tools";
import { ReactNode, useMemo, useState } from "react";
import { Link } from "react-router-dom";
import reactStringReplace from "react-string-replace";
import {
Hashtag,
ImagePreview,
LinkPreview,
MentionNote,
MentionUser,
VideoPreview,
useNoteContext,
useStorage,
} from "../..";
import { useStorage } from "../../provider";
import { Hashtag } from "./mentions/hashtag";
import { MentionNote } from "./mentions/note";
import { MentionUser } from "./mentions/user";
import { NIP89 } from "./nip89";
import { ImagePreview } from "./preview/image";
import { LinkPreview } from "./preview/link";
import { VideoPreview } from "./preview/video";
import { useNoteContext } from "./provider";
export function NoteContent({
className,
@@ -229,7 +227,7 @@ export function NoteContent({
return parsedContent;
} catch (e) {
console.warn("[parser] parse failed: ", e);
console.warn(event.id, `[parser] parse failed: ${e}`);
return parsedContent;
}
}, [content]);
@@ -251,7 +249,7 @@ export function NoteContent({
setContent(data.translatedText);
setTranslated(true);
} catch (e) {
console.error(String(e));
console.error(event.id, String(e));
}
};
@@ -260,7 +258,7 @@ export function NoteContent({
}
return (
<div className={cn("", className)}>
<div className={cn(className)}>
<div className="break-p select-text whitespace-pre-line text-balance leading-normal">
{richContent}
</div>

View File

@@ -25,17 +25,3 @@ export const Note = {
Child: NoteChild,
Thread: NoteThread,
};
export * from "./provider";
export * from "./primitives/text";
export * from "./primitives/repost";
export * from "./primitives/skeleton";
export * from "./primitives/thread";
export * from "./primitives/reply";
export * from "./preview/image";
export * from "./preview/link";
export * from "./preview/video";
export * from "./mentions/note";
export * from "./mentions/user";
export * from "./mentions/hashtag";
export * from "./mentions/invoice";

View File

@@ -1,5 +1,5 @@
import { COL_TYPES } from "@lume/utils";
import { useColumnContext } from "../../column";
import { useColumnContext } from "../../column/provider";
export function Hashtag({ tag }: { tag: string }) {
const { addColumn } = useColumnContext();

View File

@@ -3,7 +3,7 @@ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { memo } from "react";
import { Link } from "react-router-dom";
import { useProfile } from "../../../hooks/useProfile";
import { useColumnContext } from "../../column";
import { useColumnContext } from "../../column/provider";
export const MentionUser = memo(function MentionUser({
pubkey,

View File

@@ -1,8 +1,8 @@
import { HorizontalDotsIcon, ShareIcon } from "@lume/icons";
import { HorizontalDotsIcon } from "@lume/icons";
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
import { nip19 } from "nostr-tools";
import { EventPointer } from "nostr-tools/lib/types/nip19";
import { type EventPointer } from "nostr-tools/lib/types/nip19";
import { useState } from "react";
import { Link } from "react-router-dom";
import { useNoteContext } from "./provider";

View File

@@ -2,9 +2,8 @@ import { PinIcon } from "@lume/icons";
import { COL_TYPES } from "@lume/utils";
import { Link } from "react-router-dom";
import { twMerge } from "tailwind-merge";
import { Note, useNoteContext } from ".";
import { useArk } from "../..";
import { useColumnContext } from "../column";
import { Note } from ".";
import { useArk, useColumnContext, useNoteContext } from "../..";
export function NoteThread({
className,

View File

@@ -67,7 +67,7 @@ export function NoteUser({
decoding="async"
className="h-6 w-6 shrink-0 object-cover rounded-md"
/>
<Avatar.Fallback delayMs={300}>
<Avatar.Fallback delayMs={150}>
<img
src={fallbackAvatar}
alt={event.pubkey}
@@ -120,7 +120,7 @@ export function NoteUser({
decoding="async"
className="h-6 w-6 rounded object-cover"
/>
<Avatar.Fallback delayMs={300}>
<Avatar.Fallback delayMs={150}>
<img
src={fallbackAvatar}
alt={event.pubkey}
@@ -165,7 +165,7 @@ export function NoteUser({
decoding="async"
className="h-10 w-10 rounded-lg object-cover ring-1 ring-neutral-200/50 dark:ring-neutral-800/50"
/>
<Avatar.Fallback delayMs={300}>
<Avatar.Fallback delayMs={150}>
<img
src={fallbackAvatar}
alt={event.pubkey}
@@ -216,7 +216,7 @@ export function NoteUser({
decoding="async"
className="h-9 w-9 rounded-lg bg-white object-cover ring-1 ring-neutral-200/50 dark:ring-neutral-800/50"
/>
<Avatar.Fallback delayMs={300}>
<Avatar.Fallback delayMs={150}>
<img
src={fallbackAvatar}
alt={event.pubkey}