mirror of
https://github.com/luminous-devs/lume.git
synced 2024-09-19 11:43:30 +00:00
no more default export
This commit is contained in:
parent
763af0da14
commit
8256bc46a7
@ -1,6 +1,4 @@
|
|||||||
import ArrowLeftIcon from "@icons/arrowLeft";
|
import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons";
|
||||||
import ArrowRightIcon from "@icons/arrowRight";
|
|
||||||
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
||||||
const fetcher = async () => {
|
const fetcher = async () => {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import EyeOffIcon from "@icons/eyeOff";
|
import { EyeOffIcon, EyeOnIcon } from "@shared/icons";
|
||||||
import EyeOnIcon from "@icons/eyeOn";
|
|
||||||
import { createAccount } from "@utils/storage";
|
import { createAccount } from "@utils/storage";
|
||||||
import { generatePrivateKey, getPublicKey, nip19 } from "nostr-tools";
|
import { generatePrivateKey, getPublicKey, nip19 } from "nostr-tools";
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { User } from "@app/auth/components/user";
|
import { User } from "@app/auth/components/user";
|
||||||
import CheckCircleIcon from "@icons/checkCircle";
|
import { CheckCircleIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { WRITEONLY_RELAYS } from "@stores/constants";
|
import { WRITEONLY_RELAYS } from "@stores/constants";
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
|
import { ArrowRightIcon } from "@shared/icons";
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
import ArrowRightIcon from "@icons/arrowRight";
|
|
||||||
|
|
||||||
const PLEBS = [
|
const PLEBS = [
|
||||||
"https://133332.xyz/p.jpg",
|
"https://133332.xyz/p.jpg",
|
||||||
"https://void.cat/d/3Bp6jSHURFNQ9u3pK8nwtq.webp",
|
"https://void.cat/d/3Bp6jSHURFNQ9u3pK8nwtq.webp",
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
import MutedItem from "@app/channel/components/mutedItem";
|
import { MutedItem } from "@app/channel/components/mutedItem";
|
||||||
|
|
||||||
import MuteIcon from "@icons/mute";
|
|
||||||
|
|
||||||
import { Popover, Transition } from "@headlessui/react";
|
import { Popover, Transition } from "@headlessui/react";
|
||||||
|
import { MuteIcon } from "@shared/icons";
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
|
|
||||||
export default function ChannelBlackList({ blacklist }: { blacklist: any }) {
|
export function ChannelBlackList({ blacklist }: { blacklist: any }) {
|
||||||
return (
|
return (
|
||||||
<Popover className="relative">
|
<Popover className="relative">
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import CancelIcon from "@icons/cancel";
|
|
||||||
import PlusIcon from "@icons/plus";
|
|
||||||
import { AvatarUploader } from "@shared/avatarUploader";
|
import { AvatarUploader } from "@shared/avatarUploader";
|
||||||
|
import { CancelIcon, PlusIcon } from "@shared/icons";
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
@ -13,7 +12,7 @@ import { Fragment, useContext, useEffect, useState } from "react";
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { navigate } from "vite-plugin-ssr/client/router";
|
import { navigate } from "vite-plugin-ssr/client/router";
|
||||||
|
|
||||||
export default function ChannelCreateModal() {
|
export function ChannelCreateModal() {
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { usePageContext } from "@utils/hooks/usePageContext";
|
|||||||
|
|
||||||
import { twMerge } from "tailwind-merge";
|
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 channel: any = useChannelProfile(data.event_id, data.pubkey);
|
||||||
const pageContext = usePageContext();
|
const pageContext = usePageContext();
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import ChannelCreateModal from "@app/channel/components/createModal";
|
import { ChannelCreateModal } from "@app/channel/components/createModal";
|
||||||
import ChannelsListItem from "@app/channel/components/item";
|
import { ChannelsListItem } from "@app/channel/components/item";
|
||||||
import { useChannels } from "@stores/channels";
|
import { useChannels } from "@stores/channels";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
export default function ChannelsList() {
|
export function ChannelsList() {
|
||||||
const channels = useChannels((state: any) => state.channels);
|
const channels = useChannels((state: any) => state.channels);
|
||||||
const fetchChannels = useChannels((state: any) => state.fetch);
|
const fetchChannels = useChannels((state: any) => state.fetch);
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
|
|
||||||
import { useProfile } from "@utils/hooks/useProfile";
|
import { useProfile } from "@utils/hooks/useProfile";
|
||||||
|
|
||||||
export function Member({ pubkey }: { pubkey: string }) {
|
export function Member({ pubkey }: { pubkey: string }) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import UserReply from "@app/channel/components/messages/userReply";
|
import { UserReply } from "@app/channel/components/messages/userReply";
|
||||||
import CancelIcon from "@icons/cancel";
|
import { CancelIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { useChannelMessages } from "@stores/channels";
|
import { useChannelMessages } from "@stores/channels";
|
||||||
@ -8,9 +8,7 @@ import { dateToUnix } from "@utils/date";
|
|||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
|
|
||||||
export default function ChannelMessageForm({
|
export function ChannelMessageForm({ channelID }: { channelID: string }) {
|
||||||
channelID,
|
|
||||||
}: { channelID: string }) {
|
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import CancelIcon from "@icons/cancel";
|
import { CancelIcon, HideIcon } from "@shared/icons";
|
||||||
import HideIcon from "@icons/hide";
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { Tooltip } from "@shared/tooltip";
|
import { Tooltip } from "@shared/tooltip";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import CancelIcon from "@icons/cancel";
|
import { CancelIcon, MuteIcon } from "@shared/icons";
|
||||||
import MuteIcon from "@icons/mute";
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { Tooltip } from "@shared/tooltip";
|
import { Tooltip } from "@shared/tooltip";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import ReplyMessageIcon from "@icons/replyMessage";
|
import { ReplyMessageIcon } from "@shared/icons";
|
||||||
import { Tooltip } from "@shared/tooltip";
|
import { Tooltip } from "@shared/tooltip";
|
||||||
import { useChannelMessages } from "@stores/channels";
|
import { useChannelMessages } from "@stores/channels";
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { DEFAULT_AVATAR } from "@stores/constants";
|
|||||||
import { useProfile } from "@utils/hooks/useProfile";
|
import { useProfile } from "@utils/hooks/useProfile";
|
||||||
import { shortenKey } from "@utils/shortenKey";
|
import { shortenKey } from "@utils/shortenKey";
|
||||||
|
|
||||||
export default function UserReply({ pubkey }: { pubkey: string }) {
|
export function UserReply({ pubkey }: { pubkey: string }) {
|
||||||
const { user, isError, isLoading } = useProfile(pubkey);
|
const { user, isError, isLoading } = useProfile(pubkey);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
import { useChannelProfile } from "@app/channel/hooks/useChannelProfile";
|
import { useChannelProfile } from "@app/channel/hooks/useChannelProfile";
|
||||||
|
import { CopyIcon } from "@shared/icons";
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
import CopyIcon from "@icons/copy";
|
|
||||||
|
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
|
|
||||||
import { nip19 } from "nostr-tools";
|
import { nip19 } from "nostr-tools";
|
||||||
|
|
||||||
export function ChannelMetadata({
|
export function ChannelMetadata({
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
|
|
||||||
import { useProfile } from "@utils/hooks/useProfile";
|
import { useProfile } from "@utils/hooks/useProfile";
|
||||||
import { shortenKey } from "@utils/shortenKey";
|
import { shortenKey } from "@utils/shortenKey";
|
||||||
|
|
||||||
import { useState } from "react";
|
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 { user, isError, isLoading } = useProfile(data.content);
|
||||||
const [status, setStatus] = useState(data.status);
|
const [status, setStatus] = useState(data.status);
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import CancelIcon from "@icons/cancel";
|
|
||||||
import EditIcon from "@icons/edit";
|
|
||||||
import { AvatarUploader } from "@shared/avatarUploader";
|
import { AvatarUploader } from "@shared/avatarUploader";
|
||||||
|
import { CancelIcon, EditIcon } from "@shared/icons";
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
@ -12,7 +11,7 @@ import { getEventHash, getSignature } from "nostr-tools";
|
|||||||
import { Fragment, useContext, useEffect, useState } from "react";
|
import { Fragment, useContext, useEffect, useState } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
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 pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import AppHeader from "@shared/appHeader";
|
import { AppHeader } from "@shared/appHeader";
|
||||||
import MultiAccounts from "@shared/multiAccounts";
|
import { MultiAccounts } from "@shared/multiAccounts";
|
||||||
import Navigation from "@shared/navigation";
|
import { Navigation } from "@shared/navigation";
|
||||||
|
|
||||||
export function LayoutChannel({ children }: { children: React.ReactNode }) {
|
export function LayoutChannel({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
|
@ -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 { ChannelMembers } from "@app/channel/components/members";
|
||||||
import { ChannelMessageList } from "@app/channel/components/messageList";
|
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 { 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 { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { useChannelMessages } from "@stores/channels";
|
import { useChannelMessages } from "@stores/channels";
|
||||||
|
@ -3,7 +3,7 @@ import { useActiveAccount } from "@stores/accounts";
|
|||||||
import { useChats } from "@stores/chats";
|
import { useChats } from "@stores/chats";
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
export default function ChatsList() {
|
export function ChatsList() {
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
const chats = useChats((state: any) => state.chats);
|
const chats = useChats((state: any) => state.chats);
|
||||||
const fetchChats = useChats((state: any) => state.fetch);
|
const fetchChats = useChats((state: any) => state.fetch);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import MultiAccounts from "@shared/multiAccounts";
|
import { MultiAccounts } from "@shared/multiAccounts";
|
||||||
import Navigation from "@shared/navigation";
|
import { Navigation } from "@shared/navigation";
|
||||||
|
|
||||||
export function LayoutChat({ children }: { children: React.ReactNode }) {
|
export function LayoutChat({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Kind1 } from "@app/note/components/kind1";
|
import { Kind1 } from "@app/note/components/kind1";
|
||||||
import { Kind1063 } from "@app/note/components/kind1063";
|
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 { NoteParent } from "@app/note/components/parent";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
import { NoteWrapper } from "@app/note/components/wrapper";
|
import { NoteWrapper } from "@app/note/components/wrapper";
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { MentionNote } from "@app/note/components/mentions/note";
|
import { MentionNote } from "@app/note/components/mentions/note";
|
||||||
import { MentionUser } from "@app/note/components/mentions/user";
|
import { MentionUser } from "@app/note/components/mentions/user";
|
||||||
import ImagePreview from "@app/note/components/preview/image";
|
import { ImagePreview } from "@app/note/components/preview/image";
|
||||||
import VideoPreview from "@app/note/components/preview/video";
|
import { VideoPreview } from "@app/note/components/preview/video";
|
||||||
|
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
import remarkGfm from "remark-gfm";
|
import remarkGfm from "remark-gfm";
|
||||||
|
|
||||||
|
@ -3,13 +3,9 @@ import { Kind1063 } from "@app/note/components/kind1063";
|
|||||||
import { NoteSkeleton } from "@app/note/components/skeleton";
|
import { NoteSkeleton } from "@app/note/components/skeleton";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
import { NoteWrapper } from "@app/note/components/wrapper";
|
import { NoteWrapper } from "@app/note/components/wrapper";
|
||||||
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { noteParser } from "@utils/parser";
|
import { noteParser } from "@utils/parser";
|
||||||
|
|
||||||
import { memo, useContext } from "react";
|
import { memo, useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import NoteReply from "@app/note/components/metadata/reply";
|
import { NoteReply } from "@app/note/components/metadata/reply";
|
||||||
import NoteRepost from "@app/note/components/metadata/repost";
|
import { NoteRepost } from "@app/note/components/metadata/repost";
|
||||||
import NoteZap from "@app/note/components/metadata/zap";
|
import { NoteZap } from "@app/note/components/metadata/zap";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
import { decode } from "light-bolt11-decoder";
|
import { decode } from "light-bolt11-decoder";
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
export default function NoteMetadata({
|
export function NoteMetadata({
|
||||||
id,
|
id,
|
||||||
eventPubkey,
|
eventPubkey,
|
||||||
}: {
|
}: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import LikeIcon from "@icons/like";
|
import { LikeIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { WRITEONLY_RELAYS } from "@stores/constants";
|
import { WRITEONLY_RELAYS } from "@stores/constants";
|
||||||
@ -6,7 +6,7 @@ import { dateToUnix } from "@utils/date";
|
|||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function NoteLike({
|
export function NoteLike({
|
||||||
id,
|
id,
|
||||||
pubkey,
|
pubkey,
|
||||||
likes,
|
likes,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import ReplyIcon from "@icons/reply";
|
import { ReplyIcon } from "@shared/icons";
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
@ -9,10 +9,7 @@ import { compactNumber } from "@utils/number";
|
|||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { Fragment, useContext, useEffect, useState } from "react";
|
import { Fragment, useContext, useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function NoteReply({
|
export function NoteReply({ id, replies }: { id: string; replies: number }) {
|
||||||
id,
|
|
||||||
replies,
|
|
||||||
}: { id: string; replies: number }) {
|
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import RepostIcon from "@icons/repost";
|
import { RepostIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { WRITEONLY_RELAYS } from "@stores/constants";
|
import { WRITEONLY_RELAYS } from "@stores/constants";
|
||||||
@ -7,7 +7,7 @@ import { compactNumber } from "@utils/number";
|
|||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { useContext, useEffect, useState } from "react";
|
import { useContext, useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function NoteRepost({
|
export function NoteRepost({
|
||||||
id,
|
id,
|
||||||
pubkey,
|
pubkey,
|
||||||
reposts,
|
reposts,
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import ZapIcon from "@shared/icons/zap";
|
|
||||||
import { compactNumber } from "@utils/number";
|
import { compactNumber } from "@utils/number";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function NoteZap({ zaps }: { zaps: number }) {
|
export function NoteZap({ zaps }: { zaps: number }) {
|
||||||
const [count, setCount] = useState(0);
|
const [count, setCount] = useState(0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { Kind1 } from "@app/note/components/kind1";
|
import { Kind1 } from "@app/note/components/kind1";
|
||||||
import { Kind1063 } from "@app/note/components/kind1063";
|
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 { NoteSkeleton } from "@app/note/components/skeleton";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { noteParser } from "@utils/parser";
|
import { noteParser } from "@utils/parser";
|
||||||
|
|
||||||
import { memo, useContext } from "react";
|
import { memo, useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
export default function ImagePreview({ urls }: { urls: string[] }) {
|
export function ImagePreview({ urls }: { urls: string[] }) {
|
||||||
return (
|
return (
|
||||||
<div className="mt-3 grid h-full w-full grid-cols-3">
|
<div className="mt-3 grid h-full w-full grid-cols-3">
|
||||||
<div className="col-span-3">
|
<div className="col-span-3">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { MediaOutlet, MediaPlayer } from "@vidstack/react";
|
import { MediaOutlet, MediaPlayer } from "@vidstack/react";
|
||||||
|
|
||||||
export default function VideoPreview({ urls }: { urls: string[] }) {
|
export function VideoPreview({ urls }: { urls: string[] }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={(e) => e.stopPropagation()}
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { RootNote } from "@app/note/components/rootNote";
|
import { RootNote } from "@app/note/components/rootNote";
|
||||||
import { NoteRepostUser } from "@app/note/components/user/repost";
|
import { NoteRepostUser } from "@app/note/components/user/repost";
|
||||||
import { NoteWrapper } from "@app/note/components/wrapper";
|
import { NoteWrapper } from "@app/note/components/wrapper";
|
||||||
|
|
||||||
import { getQuoteID } from "@utils/transform";
|
import { getQuoteID } from "@utils/transform";
|
||||||
|
|
||||||
export function NoteQuoteRepost({ event }: { event: any }) {
|
export function NoteQuoteRepost({ event }: { event: any }) {
|
||||||
|
@ -6,7 +6,7 @@ import { dateToUnix } from "@utils/date";
|
|||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { useContext, useState } from "react";
|
import { useContext, useState } from "react";
|
||||||
|
|
||||||
export default function NoteReplyForm({ id }: { id: string }) {
|
export function NoteReplyForm({ id }: { id: string }) {
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { Kind1 } from "@app/note/components/kind1";
|
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";
|
import { noteParser } from "@utils/parser";
|
||||||
|
|
||||||
export default function Reply({ data }: { data: any }) {
|
export function Reply({ data }: { data: any }) {
|
||||||
const content = noteParser(data);
|
const content = noteParser(data);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,16 +1,12 @@
|
|||||||
import NoteReplyForm from "@app/note/components/replies/form";
|
import { NoteReplyForm } from "@app/note/components/replies/form";
|
||||||
import Reply from "@app/note/components/replies/item";
|
import { Reply } from "@app/note/components/replies/item";
|
||||||
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { sortEvents } from "@utils/transform";
|
import { sortEvents } from "@utils/transform";
|
||||||
|
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
export default function RepliesList({ id }: { id: string }) {
|
export function RepliesList({ id }: { id: string }) {
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
|
|
||||||
const { data, error } = useSWRSubscription(
|
const { data, error } = useSWRSubscription(
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { Kind1 } from "@app/note/components/kind1";
|
import { Kind1 } from "@app/note/components/kind1";
|
||||||
import { Kind1063 } from "@app/note/components/kind1063";
|
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 { NoteSkeleton } from "@app/note/components/skeleton";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { noteParser } from "@utils/parser";
|
import { noteParser } from "@utils/parser";
|
||||||
|
|
||||||
import { memo, useContext } from "react";
|
import { memo, useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
import { navigate } from "vite-plugin-ssr/client/router";
|
import { navigate } from "vite-plugin-ssr/client/router";
|
||||||
|
@ -7,7 +7,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
|
|||||||
|
|
||||||
dayjs.extend(relativeTime);
|
dayjs.extend(relativeTime);
|
||||||
|
|
||||||
export default function NoteReplyUser({
|
export function NoteReplyUser({
|
||||||
pubkey,
|
pubkey,
|
||||||
time,
|
time,
|
||||||
}: { pubkey: string; time: number }) {
|
}: { pubkey: string; time: number }) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import AppHeader from "@shared/appHeader";
|
import { AppHeader } from "@shared/appHeader";
|
||||||
import MultiAccounts from "@shared/multiAccounts";
|
import { MultiAccounts } from "@shared/multiAccounts";
|
||||||
import Navigation from "@shared/navigation";
|
import { Navigation } from "@shared/navigation";
|
||||||
|
|
||||||
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
|
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
import { Kind1 } from "@app/note/components/kind1";
|
import { Kind1 } from "@app/note/components/kind1";
|
||||||
import NoteMetadata from "@app/note/components/metadata";
|
import { NoteMetadata } from "@app/note/components/metadata";
|
||||||
import RepliesList from "@app/note/components/replies/list";
|
import { RepliesList } from "@app/note/components/replies/list";
|
||||||
import { NoteDefaultUser } from "@app/note/components/user/default";
|
import { NoteDefaultUser } from "@app/note/components/user/default";
|
||||||
|
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { usePageContext } from "@utils/hooks/usePageContext";
|
import { usePageContext } from "@utils/hooks/usePageContext";
|
||||||
import { noteParser } from "@utils/parser";
|
import { noteParser } from "@utils/parser";
|
||||||
|
|
||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import LumeIcon from "@icons/lume";
|
import { LumeIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { BlockImageUploader } from "./imageUploader";
|
import { BlockImageUploader } from "./imageUploader";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import CancelIcon from "@icons/cancel";
|
import { CancelIcon, PlusIcon } from "@shared/icons";
|
||||||
import PlusIcon from "@icons/plus";
|
|
||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import MultiAccounts from "@shared/multiAccounts";
|
import { MultiAccounts } from "@shared/multiAccounts";
|
||||||
import Navigation from "@shared/navigation";
|
import { Navigation } from "@shared/navigation";
|
||||||
|
|
||||||
export function LayoutSpace({ children }: { children: React.ReactNode }) {
|
export function LayoutSpace({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import MultiAccounts from "@shared/multiAccounts";
|
import { MultiAccounts } from "@shared/multiAccounts";
|
||||||
import Navigation from "@shared/navigation";
|
import { Navigation } from "@shared/navigation";
|
||||||
|
|
||||||
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
|
export function LayoutNewsfeed({ children }: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { Image } from "@shared/image";
|
import { Image } from "@shared/image";
|
||||||
|
|
||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
import { useProfile } from "@utils/hooks/useProfile";
|
import { useProfile } from "@utils/hooks/useProfile";
|
||||||
|
|
||||||
export default function ActiveAccount({ data }: { data: any }) {
|
export function ActiveAccount({ data }: { data: any }) {
|
||||||
const { user } = useProfile(data.pubkey);
|
const { user } = useProfile(data.pubkey);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -3,7 +3,7 @@ import { Image } from "@shared/image";
|
|||||||
import { DEFAULT_AVATAR } from "@stores/constants";
|
import { DEFAULT_AVATAR } from "@stores/constants";
|
||||||
import { useProfile } from "@utils/hooks/useProfile";
|
import { useProfile } from "@utils/hooks/useProfile";
|
||||||
|
|
||||||
export default function InactiveAccount({ data }: { data: any }) {
|
export function InactiveAccount({ data }: { data: any }) {
|
||||||
const { user } = useProfile(data.npub);
|
const { user } = useProfile(data.npub);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { usePageContext } from "@utils/hooks/usePageContext";
|
import { usePageContext } from "@utils/hooks/usePageContext";
|
||||||
|
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
export default function ActiveLink({
|
export function ActiveLink({
|
||||||
href,
|
href,
|
||||||
className,
|
className,
|
||||||
activeClassName,
|
activeClassName,
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import ArrowLeftIcon from "@icons/arrowLeft";
|
import { EventCollector } from "@shared/eventCollector";
|
||||||
import ArrowRightIcon from "@icons/arrowRight";
|
import { ArrowLeftIcon, ArrowRightIcon } from "@shared/icons";
|
||||||
import EventCollector from "@shared/eventCollector";
|
|
||||||
|
|
||||||
export function AppHeader() {
|
export function AppHeader() {
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import PlusCircleIcon from "@shared/icons/plusCircle";
|
import { PlusCircleIcon } from "@shared/icons";
|
||||||
|
|
||||||
import { createBlobFromFile } from "@utils/createBlobFromFile";
|
|
||||||
|
|
||||||
import { open } from "@tauri-apps/api/dialog";
|
import { open } from "@tauri-apps/api/dialog";
|
||||||
import { listen } from "@tauri-apps/api/event";
|
import { listen } from "@tauri-apps/api/event";
|
||||||
import { Body, fetch } from "@tauri-apps/api/http";
|
import { Body, fetch } from "@tauri-apps/api/http";
|
||||||
|
import { createBlobFromFile } from "@utils/createBlobFromFile";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { Transforms } from "slate";
|
import { Transforms } from "slate";
|
||||||
import { useSlateStatic } from "slate-react";
|
import { useSlateStatic } from "slate-react";
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
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 { Post } from "@shared/composer/types/post";
|
||||||
import { User } from "@shared/composer/user";
|
import { User } from "@shared/composer/user";
|
||||||
|
import {
|
||||||
|
CancelIcon,
|
||||||
|
ChevronDownIcon,
|
||||||
|
ChevronRightIcon,
|
||||||
|
ComposeIcon,
|
||||||
|
} from "@shared/icons";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { Fragment, useState } from "react";
|
import { Fragment, useState } from "react";
|
||||||
|
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import { ImageUploader } from "@shared/composer/imageUploader";
|
import { ImageUploader } from "@shared/composer/imageUploader";
|
||||||
import TrashIcon from "@shared/icons/trash";
|
import { TrashIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
|
|
||||||
import { WRITEONLY_RELAYS } from "@stores/constants";
|
import { WRITEONLY_RELAYS } from "@stores/constants";
|
||||||
|
|
||||||
import { dateToUnix } from "@utils/date";
|
import { dateToUnix } from "@utils/date";
|
||||||
|
|
||||||
import { getEventHash, getSignature } from "nostr-tools";
|
import { getEventHash, getSignature } from "nostr-tools";
|
||||||
import { useCallback, useContext, useMemo, useState } from "react";
|
import { useCallback, useContext, useMemo, useState } from "react";
|
||||||
import { Node, Transforms, createEditor } from "slate";
|
import { Node, Transforms, createEditor } from "slate";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import HeartBeatIcon from "@icons/heartbeat";
|
import { HeartBeatIcon } from "@shared/icons";
|
||||||
import { RelayContext } from "@shared/relayProvider";
|
import { RelayContext } from "@shared/relayProvider";
|
||||||
import { useActiveAccount } from "@stores/accounts";
|
import { useActiveAccount } from "@stores/accounts";
|
||||||
import { READONLY_RELAYS } from "@stores/constants";
|
import { READONLY_RELAYS } from "@stores/constants";
|
||||||
@ -8,7 +8,7 @@ import { getParentID, nip02ToArray } from "@utils/transform";
|
|||||||
import { useContext } from "react";
|
import { useContext } from "react";
|
||||||
import useSWRSubscription from "swr/subscription";
|
import useSWRSubscription from "swr/subscription";
|
||||||
|
|
||||||
export default function EventCollector() {
|
export function EventCollector() {
|
||||||
const pool: any = useContext(RelayContext);
|
const pool: any = useContext(RelayContext);
|
||||||
const account = useActiveAccount((state: any) => state.account);
|
const account = useActiveAccount((state: any) => state.account);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ArrowLeftIcon(
|
export function ArrowLeftIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ArrowRightIcon(
|
export function ArrowRightIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function BellIcon(
|
export function BellIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function CancelIcon(
|
export function CancelIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function CheckCircleIcon(
|
export function CheckCircleIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ChevronDownIcon(
|
export function ChevronDownIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ChevronRightIcon(
|
export function ChevronRightIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ComposeIcon(
|
export function ComposeIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function CopyIcon(
|
export function CopyIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function EditIcon(
|
export function EditIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function EyeOffIcon(
|
export function EyeOffIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function EyeOnIcon(
|
export function EyeOnIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function HeartBeatIcon(
|
export function HeartBeatIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function HideIcon(
|
export function HideIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
31
src/shared/icons/index.tsx
Normal file
31
src/shared/icons/index.tsx
Normal 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
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function LikeIcon(
|
export function LikeIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export default function LumeIcon({ className }: { className: string }) {
|
export function LumeIcon({ className }: { className: string }) {
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function MuteIcon(
|
export function MuteIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function MyspaceIcon(
|
export function MyspaceIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function NavArrowDownIcon(
|
export function NavArrowDownIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function PlusIcon(
|
export function PlusIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function PlusCircleIcon(
|
export function PlusCircleIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function RefreshIcon(
|
export function RefreshIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ReplyIcon(
|
export function ReplyIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ReplyMessageIcon(
|
export function ReplyMessageIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function RepostIcon(
|
export function RepostIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ThreadsIcon(
|
export function ThreadsIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function TrashIcon(
|
export function TrashIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function WorldIcon(
|
export function WorldIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { SVGProps } from "react";
|
import { SVGProps } from "react";
|
||||||
|
|
||||||
export default function ZapIcon(
|
export function ZapIcon(
|
||||||
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
|
@ -1,19 +1,14 @@
|
|||||||
import ActiveAccount from "@shared/accounts/active";
|
import { ActiveAccount } from "@shared/accounts/active";
|
||||||
import InactiveAccount from "@shared/accounts/inactive";
|
import { InactiveAccount } from "@shared/accounts/inactive";
|
||||||
|
import { BellIcon, PlusIcon } from "@shared/icons";
|
||||||
import BellIcon from "@icons/bell";
|
|
||||||
import PlusIcon from "@icons/plus";
|
|
||||||
|
|
||||||
import { APP_VERSION } from "@stores/constants";
|
import { APP_VERSION } from "@stores/constants";
|
||||||
|
|
||||||
import { getAccounts, getActiveAccount } from "@utils/storage";
|
import { getAccounts, getActiveAccount } from "@utils/storage";
|
||||||
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
|
||||||
const allFetcher = () => getAccounts();
|
const allFetcher = () => getAccounts();
|
||||||
const fetcher = () => getActiveAccount();
|
const fetcher = () => getActiveAccount();
|
||||||
|
|
||||||
export default function MultiAccounts() {
|
export function MultiAccounts() {
|
||||||
const { data: accounts }: any = useSWR("allAccounts", allFetcher);
|
const { data: accounts }: any = useSWR("allAccounts", allFetcher);
|
||||||
const { data: activeAccount }: any = useSWR("activeAccount", fetcher);
|
const { data: activeAccount }: any = useSWR("activeAccount", fetcher);
|
||||||
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
import ChannelsList from "@app/channel/components/list";
|
import { ChannelsList } from "@app/channel/components/list";
|
||||||
import ChatsList from "@app/chat/components/list";
|
import { ChatsList } from "@app/chat/components/list";
|
||||||
import { Disclosure } from "@headlessui/react";
|
import { Disclosure } from "@headlessui/react";
|
||||||
import NavArrowDownIcon from "@icons/navArrowDown";
|
import { ActiveLink } from "@shared/activeLink";
|
||||||
import ThreadsIcon from "@icons/threads";
|
|
||||||
import WorldIcon from "@icons/world";
|
|
||||||
import ActiveLink from "@shared/activeLink";
|
|
||||||
import { AppHeader } from "@shared/appHeader";
|
import { AppHeader } from "@shared/appHeader";
|
||||||
import { ComposerModal } from "@shared/composer/modal";
|
import { ComposerModal } from "@shared/composer/modal";
|
||||||
|
import { NavArrowDownIcon, ThreadsIcon, WorldIcon } from "@shared/icons";
|
||||||
|
|
||||||
export default function Navigation() {
|
export function Navigation() {
|
||||||
return (
|
return (
|
||||||
<div className="flex w-[232px] h-full flex-col gap-3 border-r border-zinc-900">
|
<div className="flex w-[232px] h-full flex-col gap-3 border-r border-zinc-900">
|
||||||
<AppHeader />
|
<AppHeader />
|
||||||
|
@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
@ -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>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
@ -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>
|
|
||||||
);
|
|
||||||
}
|
|
@ -4,7 +4,6 @@
|
|||||||
"paths": {
|
"paths": {
|
||||||
"@app/*": ["src/app/*"],
|
"@app/*": ["src/app/*"],
|
||||||
"@shared/*": ["src/shared/*"],
|
"@shared/*": ["src/shared/*"],
|
||||||
"@icons/*": ["src/shared/icons/*"],
|
|
||||||
"@stores/*": ["src/stores/*"],
|
"@stores/*": ["src/stores/*"],
|
||||||
"@utils/*": ["src/utils/*"]
|
"@utils/*": ["src/utils/*"]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user