no more default export

This commit is contained in:
Ren Amamiya 2023-05-30 10:33:00 +07:00
parent 763af0da14
commit 8256bc46a7
89 changed files with 154 additions and 325 deletions

View File

@ -1,6 +1,4 @@
import ArrowLeftIcon from "@icons/arrowLeft";
import ArrowRightIcon from "@icons/arrowRight";
import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons";
import useSWR from "swr";
const fetcher = async () => {

View File

@ -1,5 +1,4 @@
import EyeOffIcon from "@icons/eyeOff";
import EyeOnIcon from "@icons/eyeOn";
import { EyeOffIcon, EyeOnIcon } from "@shared/icons";
import { createAccount } from "@utils/storage";
import { generatePrivateKey, getPublicKey, nip19 } from "nostr-tools";
import { useMemo, useState } from "react";

View File

@ -1,5 +1,5 @@
import { User } from "@app/auth/components/user";
import CheckCircleIcon from "@icons/checkCircle";
import { CheckCircleIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { WRITEONLY_RELAYS } from "@stores/constants";

View File

@ -1,7 +1,6 @@
import { ArrowRightIcon } from "@shared/icons";
import { Image } from "@shared/image";
import ArrowRightIcon from "@icons/arrowRight";
const PLEBS = [
"https://133332.xyz/p.jpg",
"https://void.cat/d/3Bp6jSHURFNQ9u3pK8nwtq.webp",

View File

@ -1,11 +1,9 @@
import MutedItem from "@app/channel/components/mutedItem";
import MuteIcon from "@icons/mute";
import { MutedItem } from "@app/channel/components/mutedItem";
import { Popover, Transition } from "@headlessui/react";
import { MuteIcon } from "@shared/icons";
import { Fragment } from "react";
export default function ChannelBlackList({ blacklist }: { blacklist: any }) {
export function ChannelBlackList({ blacklist }: { blacklist: any }) {
return (
<Popover className="relative">
{({ open }) => (

View File

@ -1,7 +1,6 @@
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import PlusIcon from "@icons/plus";
import { AvatarUploader } from "@shared/avatarUploader";
import { CancelIcon, PlusIcon } from "@shared/icons";
import { Image } from "@shared/image";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
@ -13,7 +12,7 @@ import { Fragment, useContext, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { navigate } from "vite-plugin-ssr/client/router";
export default function ChannelCreateModal() {
export function ChannelCreateModal() {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -4,7 +4,7 @@ import { usePageContext } from "@utils/hooks/usePageContext";
import { twMerge } from "tailwind-merge";
export default function ChannelsListItem({ data }: { data: any }) {
export function ChannelsListItem({ data }: { data: any }) {
const channel: any = useChannelProfile(data.event_id, data.pubkey);
const pageContext = usePageContext();

View File

@ -1,9 +1,9 @@
import ChannelCreateModal from "@app/channel/components/createModal";
import ChannelsListItem from "@app/channel/components/item";
import { ChannelCreateModal } from "@app/channel/components/createModal";
import { ChannelsListItem } from "@app/channel/components/item";
import { useChannels } from "@stores/channels";
import { useEffect } from "react";
export default function ChannelsList() {
export function ChannelsList() {
const channels = useChannels((state: any) => state.channels);
const fetchChannels = useChannels((state: any) => state.fetch);

View File

@ -1,7 +1,5 @@
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
export function Member({ pubkey }: { pubkey: string }) {

View File

@ -1,5 +1,5 @@
import UserReply from "@app/channel/components/messages/userReply";
import CancelIcon from "@icons/cancel";
import { UserReply } from "@app/channel/components/messages/userReply";
import { CancelIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { useChannelMessages } from "@stores/channels";
@ -8,9 +8,7 @@ import { dateToUnix } from "@utils/date";
import { getEventHash, getSignature } from "nostr-tools";
import { useContext, useState } from "react";
export default function ChannelMessageForm({
channelID,
}: { channelID: string }) {
export function ChannelMessageForm({ channelID }: { channelID: string }) {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -1,6 +1,5 @@
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import HideIcon from "@icons/hide";
import { CancelIcon, HideIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { Tooltip } from "@shared/tooltip";
import { useActiveAccount } from "@stores/accounts";

View File

@ -1,6 +1,5 @@
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import MuteIcon from "@icons/mute";
import { CancelIcon, MuteIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { Tooltip } from "@shared/tooltip";
import { useActiveAccount } from "@stores/accounts";

View File

@ -1,4 +1,4 @@
import ReplyMessageIcon from "@icons/replyMessage";
import { ReplyMessageIcon } from "@shared/icons";
import { Tooltip } from "@shared/tooltip";
import { useChannelMessages } from "@stores/channels";

View File

@ -3,7 +3,7 @@ import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
import { shortenKey } from "@utils/shortenKey";
export default function UserReply({ pubkey }: { pubkey: string }) {
export function UserReply({ pubkey }: { pubkey: string }) {
const { user, isError, isLoading } = useProfile(pubkey);
return (

View File

@ -1,11 +1,7 @@
import { useChannelProfile } from "@app/channel/hooks/useChannelProfile";
import { CopyIcon } from "@shared/icons";
import { Image } from "@shared/image";
import CopyIcon from "@icons/copy";
import { DEFAULT_AVATAR } from "@stores/constants";
import { nip19 } from "nostr-tools";
export function ChannelMetadata({

View File

@ -1,13 +1,10 @@
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
import { shortenKey } from "@utils/shortenKey";
import { useState } from "react";
export default function MutedItem({ data }: { data: any }) {
export function MutedItem({ data }: { data: any }) {
const { user, isError, isLoading } = useProfile(data.content);
const [status, setStatus] = useState(data.status);

View File

@ -1,7 +1,6 @@
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import EditIcon from "@icons/edit";
import { AvatarUploader } from "@shared/avatarUploader";
import { CancelIcon, EditIcon } from "@shared/icons";
import { Image } from "@shared/image";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
@ -12,7 +11,7 @@ import { getEventHash, getSignature } from "nostr-tools";
import { Fragment, useContext, useEffect, useState } from "react";
import { useForm } from "react-hook-form";
export default function ChannelUpdateModal({ id }: { id: string }) {
export function ChannelUpdateModal({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -1,6 +1,6 @@
import AppHeader from "@shared/appHeader";
import MultiAccounts from "@shared/multiAccounts";
import Navigation from "@shared/navigation";
import { AppHeader } from "@shared/appHeader";
import { MultiAccounts } from "@shared/multiAccounts";
import { Navigation } from "@shared/navigation";
export function LayoutChannel({ children }: { children: React.ReactNode }) {
return (

View File

@ -1,9 +1,9 @@
import ChannelBlackList from "@app/channel/components/blacklist";
import { ChannelBlackList } from "@app/channel/components/blacklist";
import { ChannelMembers } from "@app/channel/components/members";
import { ChannelMessageList } from "@app/channel/components/messageList";
import ChannelMessageForm from "@app/channel/components/messages/form";
import { ChannelMessageForm } from "@app/channel/components/messages/form";
import { ChannelMetadata } from "@app/channel/components/metadata";
import ChannelUpdateModal from "@app/channel/components/updateModal";
import { ChannelUpdateModal } from "@app/channel/components/updateModal";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { useChannelMessages } from "@stores/channels";

View File

@ -3,7 +3,7 @@ import { useActiveAccount } from "@stores/accounts";
import { useChats } from "@stores/chats";
import { useEffect } from "react";
export default function ChatsList() {
export function ChatsList() {
const account = useActiveAccount((state: any) => state.account);
const chats = useChats((state: any) => state.chats);
const fetchChats = useChats((state: any) => state.fetch);

View File

@ -1,5 +1,5 @@
import MultiAccounts from "@shared/multiAccounts";
import Navigation from "@shared/navigation";
import { MultiAccounts } from "@shared/multiAccounts";
import { Navigation } from "@shared/navigation";
export function LayoutChat({ children }: { children: React.ReactNode }) {
return (

View File

@ -1,6 +1,6 @@
import { Kind1 } from "@app/note/components/kind1";
import { Kind1063 } from "@app/note/components/kind1063";
import NoteMetadata from "@app/note/components/metadata";
import { NoteMetadata } from "@app/note/components/metadata";
import { NoteParent } from "@app/note/components/parent";
import { NoteDefaultUser } from "@app/note/components/user/default";
import { NoteWrapper } from "@app/note/components/wrapper";

View File

@ -1,8 +1,7 @@
import { MentionNote } from "@app/note/components/mentions/note";
import { MentionUser } from "@app/note/components/mentions/user";
import ImagePreview from "@app/note/components/preview/image";
import VideoPreview from "@app/note/components/preview/video";
import { ImagePreview } from "@app/note/components/preview/image";
import { VideoPreview } from "@app/note/components/preview/video";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";

View File

@ -3,13 +3,9 @@ import { Kind1063 } from "@app/note/components/kind1063";
import { NoteSkeleton } from "@app/note/components/skeleton";
import { NoteDefaultUser } from "@app/note/components/user/default";
import { NoteWrapper } from "@app/note/components/wrapper";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { noteParser } from "@utils/parser";
import { memo, useContext } from "react";
import useSWRSubscription from "swr/subscription";

View File

@ -1,13 +1,13 @@
import NoteReply from "@app/note/components/metadata/reply";
import NoteRepost from "@app/note/components/metadata/repost";
import NoteZap from "@app/note/components/metadata/zap";
import { NoteReply } from "@app/note/components/metadata/reply";
import { NoteRepost } from "@app/note/components/metadata/repost";
import { NoteZap } from "@app/note/components/metadata/zap";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { decode } from "light-bolt11-decoder";
import { useContext, useState } from "react";
import useSWRSubscription from "swr/subscription";
export default function NoteMetadata({
export function NoteMetadata({
id,
eventPubkey,
}: {

View File

@ -1,4 +1,4 @@
import LikeIcon from "@icons/like";
import { LikeIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { WRITEONLY_RELAYS } from "@stores/constants";
@ -6,7 +6,7 @@ import { dateToUnix } from "@utils/date";
import { getEventHash, getSignature } from "nostr-tools";
import { useContext, useEffect, useState } from "react";
export default function NoteLike({
export function NoteLike({
id,
pubkey,
likes,

View File

@ -1,5 +1,5 @@
import { Dialog, Transition } from "@headlessui/react";
import ReplyIcon from "@icons/reply";
import { ReplyIcon } from "@shared/icons";
import { Image } from "@shared/image";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
@ -9,10 +9,7 @@ import { compactNumber } from "@utils/number";
import { getEventHash, getSignature } from "nostr-tools";
import { Fragment, useContext, useEffect, useState } from "react";
export default function NoteReply({
id,
replies,
}: { id: string; replies: number }) {
export function NoteReply({ id, replies }: { id: string; replies: number }) {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -1,4 +1,4 @@
import RepostIcon from "@icons/repost";
import { RepostIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { WRITEONLY_RELAYS } from "@stores/constants";
@ -7,7 +7,7 @@ import { compactNumber } from "@utils/number";
import { getEventHash, getSignature } from "nostr-tools";
import { useContext, useEffect, useState } from "react";
export default function NoteRepost({
export function NoteRepost({
id,
pubkey,
reposts,

View File

@ -1,8 +1,7 @@
import ZapIcon from "@shared/icons/zap";
import { compactNumber } from "@utils/number";
import { useEffect, useState } from "react";
export default function NoteZap({ zaps }: { zaps: number }) {
export function NoteZap({ zaps }: { zaps: number }) {
const [count, setCount] = useState(0);
useEffect(() => {

View File

@ -1,15 +1,11 @@
import { Kind1 } from "@app/note/components/kind1";
import { Kind1063 } from "@app/note/components/kind1063";
import NoteMetadata from "@app/note/components/metadata";
import { NoteMetadata } from "@app/note/components/metadata";
import { NoteSkeleton } from "@app/note/components/skeleton";
import { NoteDefaultUser } from "@app/note/components/user/default";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { noteParser } from "@utils/parser";
import { memo, useContext } from "react";
import useSWRSubscription from "swr/subscription";

View File

@ -1,6 +1,6 @@
import { Image } from "@shared/image";
export default function ImagePreview({ urls }: { urls: string[] }) {
export function ImagePreview({ urls }: { urls: string[] }) {
return (
<div className="mt-3 grid h-full w-full grid-cols-3">
<div className="col-span-3">

View File

@ -1,6 +1,6 @@
import { MediaOutlet, MediaPlayer } from "@vidstack/react";
export default function VideoPreview({ urls }: { urls: string[] }) {
export function VideoPreview({ urls }: { urls: string[] }) {
return (
<div
onClick={(e) => e.stopPropagation()}

View File

@ -1,7 +1,6 @@
import { RootNote } from "@app/note/components/rootNote";
import { NoteRepostUser } from "@app/note/components/user/repost";
import { NoteWrapper } from "@app/note/components/wrapper";
import { getQuoteID } from "@utils/transform";
export function NoteQuoteRepost({ event }: { event: any }) {

View File

@ -6,7 +6,7 @@ import { dateToUnix } from "@utils/date";
import { getEventHash, getSignature } from "nostr-tools";
import { useContext, useState } from "react";
export default function NoteReplyForm({ id }: { id: string }) {
export function NoteReplyForm({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -1,9 +1,8 @@
import { Kind1 } from "@app/note/components/kind1";
import NoteReplyUser from "@app/note/components/user/reply";
import { NoteReplyUser } from "@app/note/components/user/reply";
import { noteParser } from "@utils/parser";
export default function Reply({ data }: { data: any }) {
export function Reply({ data }: { data: any }) {
const content = noteParser(data);
return (

View File

@ -1,16 +1,12 @@
import NoteReplyForm from "@app/note/components/replies/form";
import Reply from "@app/note/components/replies/item";
import { NoteReplyForm } from "@app/note/components/replies/form";
import { Reply } from "@app/note/components/replies/item";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { sortEvents } from "@utils/transform";
import { useContext } from "react";
import useSWRSubscription from "swr/subscription";
export default function RepliesList({ id }: { id: string }) {
export function RepliesList({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const { data, error } = useSWRSubscription(

View File

@ -1,15 +1,11 @@
import { Kind1 } from "@app/note/components/kind1";
import { Kind1063 } from "@app/note/components/kind1063";
import NoteMetadata from "@app/note/components/metadata";
import { NoteMetadata } from "@app/note/components/metadata";
import { NoteSkeleton } from "@app/note/components/skeleton";
import { NoteDefaultUser } from "@app/note/components/user/default";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { noteParser } from "@utils/parser";
import { memo, useContext } from "react";
import useSWRSubscription from "swr/subscription";
import { navigate } from "vite-plugin-ssr/client/router";

View File

@ -7,7 +7,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
dayjs.extend(relativeTime);
export default function NoteReplyUser({
export function NoteReplyUser({
pubkey,
time,
}: { pubkey: string; time: number }) {

View File

@ -1,6 +1,6 @@
import AppHeader from "@shared/appHeader";
import MultiAccounts from "@shared/multiAccounts";
import Navigation from "@shared/navigation";
import { AppHeader } from "@shared/appHeader";
import { MultiAccounts } from "@shared/multiAccounts";
import { Navigation } from "@shared/navigation";
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
return (

View File

@ -1,15 +1,11 @@
import { Kind1 } from "@app/note/components/kind1";
import NoteMetadata from "@app/note/components/metadata";
import RepliesList from "@app/note/components/replies/list";
import { NoteMetadata } from "@app/note/components/metadata";
import { RepliesList } from "@app/note/components/replies/list";
import { NoteDefaultUser } from "@app/note/components/user/default";
import { RelayContext } from "@shared/relayProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { usePageContext } from "@utils/hooks/usePageContext";
import { noteParser } from "@utils/parser";
import { useContext } from "react";
import useSWRSubscription from "swr/subscription";

View File

@ -1,4 +1,4 @@
import LumeIcon from "@icons/lume";
import { LumeIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { READONLY_RELAYS } from "@stores/constants";

View File

@ -1,7 +1,6 @@
import { BlockImageUploader } from "./imageUploader";
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import PlusIcon from "@icons/plus";
import { CancelIcon, PlusIcon } from "@shared/icons";
import { Image } from "@shared/image";
import { useActiveAccount } from "@stores/accounts";
import { DEFAULT_AVATAR } from "@stores/constants";

View File

@ -1,5 +1,5 @@
import MultiAccounts from "@shared/multiAccounts";
import Navigation from "@shared/navigation";
import { MultiAccounts } from "@shared/multiAccounts";
import { Navigation } from "@shared/navigation";
export function LayoutSpace({ children }: { children: React.ReactNode }) {
return (

View File

@ -1,5 +1,5 @@
import MultiAccounts from "@shared/multiAccounts";
import Navigation from "@shared/navigation";
import { MultiAccounts } from "@shared/multiAccounts";
import { Navigation } from "@shared/navigation";
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
return (

View File

@ -1,9 +1,8 @@
import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
export default function ActiveAccount({ data }: { data: any }) {
export function ActiveAccount({ data }: { data: any }) {
const { user } = useProfile(data.pubkey);
return (

View File

@ -3,7 +3,7 @@ import { Image } from "@shared/image";
import { DEFAULT_AVATAR } from "@stores/constants";
import { useProfile } from "@utils/hooks/useProfile";
export default function InactiveAccount({ data }: { data: any }) {
export function InactiveAccount({ data }: { data: any }) {
const { user } = useProfile(data.npub);
return (

View File

@ -1,8 +1,7 @@
import { usePageContext } from "@utils/hooks/usePageContext";
import { twMerge } from "tailwind-merge";
export default function ActiveLink({
export function ActiveLink({
href,
className,
activeClassName,

View File

@ -1,6 +1,5 @@
import ArrowLeftIcon from "@icons/arrowLeft";
import ArrowRightIcon from "@icons/arrowRight";
import EventCollector from "@shared/eventCollector";
import { EventCollector } from "@shared/eventCollector";
import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons";
export function AppHeader() {
const goBack = () => {

View File

@ -1,10 +1,8 @@
import PlusCircleIcon from "@shared/icons/plusCircle";
import { createBlobFromFile } from "@utils/createBlobFromFile";
import { PlusCircleIcon } from "@shared/icons";
import { open } from "@tauri-apps/api/dialog";
import { listen } from "@tauri-apps/api/event";
import { Body, fetch } from "@tauri-apps/api/http";
import { createBlobFromFile } from "@utils/createBlobFromFile";
import { useCallback, useEffect, useState } from "react";
import { Transforms } from "slate";
import { useSlateStatic } from "slate-react";

View File

@ -1,10 +1,12 @@
import { Dialog, Transition } from "@headlessui/react";
import CancelIcon from "@icons/cancel";
import ChevronDownIcon from "@icons/chevronDown";
import ChevronRightIcon from "@icons/chevronRight";
import ComposeIcon from "@icons/compose";
import { Post } from "@shared/composer/types/post";
import { User } from "@shared/composer/user";
import {
CancelIcon,
ChevronDownIcon,
ChevronRightIcon,
ComposeIcon,
} from "@shared/icons";
import { useActiveAccount } from "@stores/accounts";
import { Fragment, useState } from "react";

View File

@ -1,11 +1,8 @@
import { ImageUploader } from "@shared/composer/imageUploader";
import TrashIcon from "@shared/icons/trash";
import { TrashIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { WRITEONLY_RELAYS } from "@stores/constants";
import { dateToUnix } from "@utils/date";
import { getEventHash, getSignature } from "nostr-tools";
import { useCallback, useContext, useMemo, useState } from "react";
import { Node, Transforms, createEditor } from "slate";

View File

@ -1,4 +1,4 @@
import HeartBeatIcon from "@icons/heartbeat";
import { HeartBeatIcon } from "@shared/icons";
import { RelayContext } from "@shared/relayProvider";
import { useActiveAccount } from "@stores/accounts";
import { READONLY_RELAYS } from "@stores/constants";
@ -8,7 +8,7 @@ import { getParentID, nip02ToArray } from "@utils/transform";
import { useContext } from "react";
import useSWRSubscription from "swr/subscription";
export default function EventCollector() {
export function EventCollector() {
const pool: any = useContext(RelayContext);
const account = useActiveAccount((state: any) => state.account);

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ArrowLeftIcon(
export function ArrowLeftIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ArrowRightIcon(
export function ArrowRightIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function BellIcon(
export function BellIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function CancelIcon(
export function CancelIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function CheckCircleIcon(
export function CheckCircleIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ChevronDownIcon(
export function ChevronDownIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ChevronRightIcon(
export function ChevronRightIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ComposeIcon(
export function ComposeIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function CopyIcon(
export function CopyIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function EditIcon(
export function EditIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function EyeOffIcon(
export function EyeOffIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function EyeOnIcon(
export function EyeOnIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function HeartBeatIcon(
export function HeartBeatIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function HideIcon(
export function HideIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -0,0 +1,31 @@
// @index('./*.tsx', f => `export * from '${f.path}'`)
export * from "./arrowLeft";
export * from "./arrowRight";
export * from "./bell";
export * from "./cancel";
export * from "./checkCircle";
export * from "./chevronDown";
export * from "./chevronRight";
export * from "./compose";
export * from "./copy";
export * from "./edit";
export * from "./eyeOff";
export * from "./eyeOn";
export * from "./heartbeat";
export * from "./hide";
export * from "./like";
export * from "./lume";
export * from "./mute";
export * from "./myspace";
export * from "./navArrowDown";
export * from "./plus";
export * from "./plusCircle";
export * from "./refresh";
export * from "./reply";
export * from "./replyMessage";
export * from "./repost";
export * from "./threads";
export * from "./trash";
export * from "./world";
export * from "./zap";
// @endindex

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function LikeIcon(
export function LikeIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,4 +1,4 @@
export default function LumeIcon({ className }: { className: string }) {
export function LumeIcon({ className }: { className: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function MuteIcon(
export function MuteIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function MyspaceIcon(
export function MyspaceIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function NavArrowDownIcon(
export function NavArrowDownIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function PlusIcon(
export function PlusIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function PlusCircleIcon(
export function PlusCircleIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function RefreshIcon(
export function RefreshIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ReplyIcon(
export function ReplyIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ReplyMessageIcon(
export function ReplyMessageIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function RepostIcon(
export function RepostIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ThreadsIcon(
export function ThreadsIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function TrashIcon(
export function TrashIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function WorldIcon(
export function WorldIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,6 +1,6 @@
import { SVGProps } from "react";
export default function ZapIcon(
export function ZapIcon(
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
) {
return (

View File

@ -1,19 +1,14 @@
import ActiveAccount from "@shared/accounts/active";
import InactiveAccount from "@shared/accounts/inactive";
import BellIcon from "@icons/bell";
import PlusIcon from "@icons/plus";
import { ActiveAccount } from "@shared/accounts/active";
import { InactiveAccount } from "@shared/accounts/inactive";
import { BellIcon, PlusIcon } from "@shared/icons";
import { APP_VERSION } from "@stores/constants";
import { getAccounts, getActiveAccount } from "@utils/storage";
import useSWR from "swr";
const allFetcher = () => getAccounts();
const fetcher = () => getActiveAccount();
export default function MultiAccounts() {
export function MultiAccounts() {
const { data: accounts }: any = useSWR("allAccounts", allFetcher);
const { data: activeAccount }: any = useSWR("activeAccount", fetcher);

View File

@ -1,14 +1,12 @@
import ChannelsList from "@app/channel/components/list";
import ChatsList from "@app/chat/components/list";
import { ChannelsList } from "@app/channel/components/list";
import { ChatsList } from "@app/chat/components/list";
import { Disclosure } from "@headlessui/react";
import NavArrowDownIcon from "@icons/navArrowDown";
import ThreadsIcon from "@icons/threads";
import WorldIcon from "@icons/world";
import ActiveLink from "@shared/activeLink";
import { ActiveLink } from "@shared/activeLink";
import { AppHeader } from "@shared/appHeader";
import { ComposerModal } from "@shared/composer/modal";
import { NavArrowDownIcon, ThreadsIcon, WorldIcon } from "@shared/icons";
export default function Navigation() {
export function Navigation() {
return (
<div className="flex w-[232px] h-full flex-col gap-3 border-r border-zinc-900">
<AppHeader />

View File

@ -1,26 +0,0 @@
import { RelayContext } from "@shared/relaysProvider";
import { UserFollow } from "@shared/user/follow";
import { READONLY_RELAYS } from "@stores/constants";
import destr from "destr";
import { Author } from "nostr-relaypool";
import { useContext, useEffect, useState } from "react";
export default function ProfileFollowers({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const [followers, setFollowers] = useState(null);
useEffect(() => {
const user = new Author(pool, READONLY_RELAYS, id);
user.followers((res) => setFollowers(destr(res.tags)), 0, 100);
}, [id, pool]);
return (
<div className="flex flex-col gap-3 px-3 py-5">
{followers?.map((follower) => (
<UserFollow key={follower[1]} pubkey={follower[1]} />
))}
</div>
);
}

View File

@ -1,25 +0,0 @@
import { RelayContext } from "@shared/relaysProvider";
import { UserFollow } from "@shared/user/follow";
import { READONLY_RELAYS } from "@stores/constants";
import { Author } from "nostr-relaypool";
import { useContext, useEffect, useState } from "react";
export default function ProfileFollows({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const [follows, setFollows] = useState(null);
useEffect(() => {
const user = new Author(pool, READONLY_RELAYS, id);
user.follows((res) => setFollows(res), 0);
}, [id, pool]);
return (
<div className="flex flex-col gap-3 px-3 py-5">
{follows?.map((follow) => (
<UserFollow key={follow.pubkey} pubkey={follow.pubkey} />
))}
</div>
);
}

View File

@ -1,61 +0,0 @@
import { Image } from "@shared/image";
import { RelayContext } from "@shared/relayProvider";
import { DEFAULT_AVATAR, READONLY_RELAYS } from "@stores/constants";
import { shortenKey } from "@utils/shortenKey";
import destr from "destr";
import { Author } from "nostr-relaypool";
import { useContext, useEffect, useState } from "react";
const DEFAULT_BANNER =
"https://bafybeiacwit7hjmdefqggxqtgh6ht5dhth7ndptwn2msl5kpkodudsr7py.ipfs.w3s.link/banner-1.jpg";
export default function ProfileMetadata({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const [profile, setProfile] = useState(null);
useEffect(() => {
const user = new Author(pool, READONLY_RELAYS, id);
user.metaData((res) => setProfile(destr(res.content)), 0);
}, [id, pool]);
return (
<>
<div className="relative">
<div className="relative h-56 w-full rounded-t-lg bg-zinc-800">
<Image
src={profile?.banner || DEFAULT_BANNER}
alt="user's banner"
className="h-58 w-full object-cover"
/>
</div>
<div className="relative -top-8 z-10 px-4">
<div className="relative h-16 w-16 rounded-lg bg-zinc-900 ring-2 ring-zinc-900">
<Image
src={profile?.picture || DEFAULT_AVATAR}
alt={id}
className="h-16 w-16 rounded-lg object-cover"
/>
</div>
</div>
</div>
<div className="-mt-4 mb-8 px-4">
<div>
<div className="mb-3 flex flex-col">
<h3 className="text-lg font-semibold leading-tight text-white">
{profile?.display_name || profile?.name}
</h3>
<span className="text-base leading-tight text-zinc-500">
{profile?.username || (id && shortenKey(id))}
</span>
</div>
<div className="prose-sm prose-zinc leading-tight dark:prose-invert">
{profile?.about}
</div>
</div>
</div>
</>
);
}

View File

@ -1,27 +0,0 @@
import { NoteBase } from "@shared/note/base";
import { RelayContext } from "@shared/relaysProvider";
import { READONLY_RELAYS } from "@stores/constants";
import { Author } from "nostr-relaypool";
import { useContext, useEffect, useState } from "react";
export default function ProfileNotes({ id }: { id: string }) {
const pool: any = useContext(RelayContext);
const [data, setData] = useState([]);
useEffect(() => {
const user = new Author(pool, READONLY_RELAYS, id);
user.text((res) => setData((data) => [...data, res]), 100, 0);
}, [id, pool]);
return (
<div className="flex flex-col">
{data.map((item) => (
<div key={item.id}>
<NoteBase event={item} />
</div>
))}
</div>
);
}

View File

@ -4,7 +4,6 @@
"paths": {
"@app/*": ["src/app/*"],
"@shared/*": ["src/shared/*"],
"@icons/*": ["src/shared/icons/*"],
"@stores/*": ["src/stores/*"],
"@utils/*": ["src/utils/*"]
},