better structure
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import MutedItem from '@lume/app/channel/components/mutedItem';
|
||||
import MuteIcon from '@lume/shared/icons/mute';
|
||||
import MutedItem from '@app/channel/components/mutedItem';
|
||||
|
||||
import MuteIcon from '@icons/mute';
|
||||
|
||||
import { Popover, Transition } from '@headlessui/react';
|
||||
import { Fragment } from 'react';
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { AvatarUploader } from '@lume/shared/avatarUploader';
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import PlusIcon from '@lume/shared/icons/plus';
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { DEFAULT_AVATAR, WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { createChannel } from '@lume/utils/storage';
|
||||
import { AvatarUploader } from '@shared/avatarUploader';
|
||||
import { Image } from '@shared/image';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import CancelIcon from '@icons/cancel';
|
||||
import PlusIcon from '@icons/plus';
|
||||
|
||||
import { DEFAULT_AVATAR, WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { createChannel } from '@utils/storage';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useChannelProfile } from '@lume/utils/hooks/useChannelProfile';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import { useChannelProfile } from '@app/channel/hooks/useChannelProfile';
|
||||
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import ChannelCreateModal from '@lume/app/channel/components/createModal';
|
||||
import ChannelsListItem from '@lume/app/channel/components/item';
|
||||
import { getChannels } from '@lume/utils/storage';
|
||||
import ChannelCreateModal from '@app/channel/components/createModal';
|
||||
import ChannelsListItem from '@app/channel/components/item';
|
||||
|
||||
import { getChannels } from '@utils/storage';
|
||||
|
||||
import useSWR from 'swr';
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import MiniMember from '@lume/app/channel/components/miniMember';
|
||||
import { channelMembersAtom } from '@lume/stores/channel';
|
||||
import MiniMember from '@app/channel/components/miniMember';
|
||||
|
||||
import { channelMembersAtom } from '@stores/channel';
|
||||
|
||||
import { useAtomValue } from 'jotai';
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import ChannelMessageItem from '@lume/app/channel/components/messages/item';
|
||||
import { sortedChannelMessagesAtom } from '@lume/stores/channel';
|
||||
import { hoursAgo } from '@lume/utils/getDate';
|
||||
import ChannelMessageItem from '@app/channel/components/messages/item';
|
||||
|
||||
import { sortedChannelMessagesAtom } from '@stores/channel';
|
||||
|
||||
import { getHourAgo } from '@utils/date';
|
||||
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useCallback, useRef } from 'react';
|
||||
@@ -39,7 +41,7 @@ export default function ChannelMessageList() {
|
||||
</div>
|
||||
<div className="relative flex justify-center">
|
||||
<div className="inline-flex items-center gap-x-1.5 rounded-full bg-zinc-900 px-3 py-1.5 text-xs font-medium text-zinc-400 shadow-sm ring-1 ring-inset ring-zinc-800">
|
||||
{hoursAgo(24, now.current).toLocaleDateString('en-US', {
|
||||
{getHourAgo(24, now.current).toLocaleDateString('en-US', {
|
||||
weekday: 'long',
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import UserReply from '@lume/app/channel/components/messages/userReply';
|
||||
import { ImagePicker } from '@lume/shared/form/imagePicker';
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { channelContentAtom, channelReplyAtom } from '@lume/stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import UserReply from '@app/channel/components/messages/userReply';
|
||||
|
||||
import { ImagePicker } from '@shared/form/imagePicker';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import CancelIcon from '@icons/cancel';
|
||||
|
||||
import { channelContentAtom, channelReplyAtom } from '@stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { useAtom, useAtomValue } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import HideIcon from '@lume/shared/icons/hide';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { Tooltip } from '@lume/shared/tooltip';
|
||||
import { channelMessagesAtom } from '@lume/stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
import { Tooltip } from '@shared/tooltip';
|
||||
|
||||
import CancelIcon from '@icons/cancel';
|
||||
import HideIcon from '@icons/hide';
|
||||
|
||||
import { channelMessagesAtom } from '@stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { useAtom } from 'jotai';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import MessageHideButton from '@lume/app/channel/components/messages/hideButton';
|
||||
import MessageMuteButton from '@lume/app/channel/components/messages/muteButton';
|
||||
import MessageReplyButton from '@lume/app/channel/components/messages/replyButton';
|
||||
import ChannelMessageUser from '@lume/app/channel/components/messages/user';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import MessageHideButton from '@app/channel/components/messages/hideButton';
|
||||
import MessageMuteButton from '@app/channel/components/messages/muteButton';
|
||||
import MessageReplyButton from '@app/channel/components/messages/replyButton';
|
||||
import ChannelMessageUser from '@app/channel/components/messages/user';
|
||||
|
||||
import { noteParser } from '@utils/parser';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import MuteIcon from '@lume/shared/icons/mute';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { Tooltip } from '@lume/shared/tooltip';
|
||||
import { channelMessagesAtom } from '@lume/stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
import { Tooltip } from '@shared/tooltip';
|
||||
|
||||
import CancelIcon from '@icons/cancel';
|
||||
import MuteIcon from '@icons/mute';
|
||||
|
||||
import { channelMessagesAtom } from '@stores/channel';
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { useAtom } from 'jotai';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import ReplyMessageIcon from '@lume/shared/icons/replyMessage';
|
||||
import { Tooltip } from '@lume/shared/tooltip';
|
||||
import { channelReplyAtom } from '@lume/stores/channel';
|
||||
import { Tooltip } from '@shared/tooltip';
|
||||
|
||||
import ReplyMessageIcon from '@icons/replyMessage';
|
||||
|
||||
import { channelReplyAtom } from '@stores/channel';
|
||||
|
||||
import { useSetAtom } from 'jotai';
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
export default function UserReply({ pubkey }: { pubkey: string }) {
|
||||
const { user, isError, isLoading } = useProfile(pubkey);
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import CopyIcon from '@lume/shared/icons/copy';
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
import { useChannelProfile } from '@lume/utils/hooks/useChannelProfile';
|
||||
import { useChannelProfile } from '@app/channel/hooks/useChannelProfile';
|
||||
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import CopyIcon from '@icons/copy';
|
||||
|
||||
import { DEFAULT_AVATAR } from '@stores/constants';
|
||||
|
||||
import { nip19 } from 'nostr-tools';
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
|
||||
export default function MiniMember({ pubkey }: { pubkey: string }) {
|
||||
const { user, isError, isLoading } = useProfile(pubkey);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
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';
|
||||
|
||||
@@ -10,7 +12,7 @@ export default function MutedItem({ data }: { data: any }) {
|
||||
const [status, setStatus] = useState(data.status);
|
||||
|
||||
const unmute = async () => {
|
||||
const { updateItemInBlacklist } = await import('@lume/utils/storage');
|
||||
const { updateItemInBlacklist } = await import('@utils/storage');
|
||||
const res = await updateItemInBlacklist(data.content, 0);
|
||||
if (res) {
|
||||
setStatus(0);
|
||||
@@ -18,7 +20,7 @@ export default function MutedItem({ data }: { data: any }) {
|
||||
};
|
||||
|
||||
const mute = async () => {
|
||||
const { updateItemInBlacklist } = await import('@lume/utils/storage');
|
||||
const { updateItemInBlacklist } = await import('@utils/storage');
|
||||
const res = await updateItemInBlacklist(data.content, 1);
|
||||
if (res) {
|
||||
setStatus(1);
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { AvatarUploader } from '@lume/shared/avatarUploader';
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import EditIcon from '@lume/shared/icons/edit';
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { DEFAULT_AVATAR, WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { getChannel, updateChannelMetadata } from '@lume/utils/storage';
|
||||
import { AvatarUploader } from '@shared/avatarUploader';
|
||||
import { Image } from '@shared/image';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import CancelIcon from '@icons/cancel';
|
||||
import EditIcon from '@icons/edit';
|
||||
|
||||
import { DEFAULT_AVATAR, WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { getChannel, updateChannelMetadata } from '@utils/storage';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
|
||||
58
src/app/channel/hooks/useChannelProfile.tsx
Normal file
58
src/app/channel/hooks/useChannelProfile.tsx
Normal file
@@ -0,0 +1,58 @@
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import { READONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { getChannel } from '@utils/storage';
|
||||
|
||||
import { useContext } from 'react';
|
||||
import useSWR from 'swr';
|
||||
import useSWRSubscription from 'swr/subscription';
|
||||
|
||||
const fetcher = async ([, id]) => {
|
||||
const result = await getChannel(id);
|
||||
if (result) {
|
||||
return JSON.parse(result.metadata);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
export function useChannelProfile(id: string, channelPubkey: string) {
|
||||
const pool: any = useContext(RelayContext);
|
||||
|
||||
const { data: cache, isLoading } = useSWR(['channel-cache-profile', id], fetcher);
|
||||
const { data, error } = useSWRSubscription(
|
||||
!isLoading && cache ? ['channel-profile', id] : null,
|
||||
([, key], { next }) => {
|
||||
// subscribe to channel
|
||||
const unsubscribe = pool.subscribe(
|
||||
[
|
||||
{
|
||||
'#e': [key],
|
||||
authors: [channelPubkey],
|
||||
kinds: [41],
|
||||
},
|
||||
],
|
||||
READONLY_RELAYS,
|
||||
(event: { content: string }) => {
|
||||
next(null, JSON.parse(event.content));
|
||||
},
|
||||
undefined,
|
||||
undefined,
|
||||
{
|
||||
unsubscribeOnEose: true,
|
||||
}
|
||||
);
|
||||
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
if (!data || error) {
|
||||
return cache;
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppHeader from '@lume/shared/appHeader';
|
||||
import MultiAccounts from '@lume/shared/multiAccounts';
|
||||
import Navigation from '@lume/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 (
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import ChannelBlackList from '@lume/app/channel/components/blacklist';
|
||||
import ChannelMembers from '@lume/app/channel/components/members';
|
||||
import ChannelMessageForm from '@lume/app/channel/components/messages/form';
|
||||
import ChannelMetadata from '@lume/app/channel/components/metadata';
|
||||
import ChannelUpdateModal from '@lume/app/channel/components/updateModal';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { channelMessagesAtom, channelReplyAtom } from '@lume/stores/channel';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix, hoursAgo } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import { getActiveBlacklist, getBlacklist } from '@lume/utils/storage';
|
||||
import { arrayObjToPureArr } from '@lume/utils/transform';
|
||||
import ChannelBlackList from '@app/channel/components/blacklist';
|
||||
import ChannelMembers from '@app/channel/components/members';
|
||||
import ChannelMessageForm from '@app/channel/components/messages/form';
|
||||
import ChannelMetadata from '@app/channel/components/metadata';
|
||||
import ChannelUpdateModal from '@app/channel/components/updateModal';
|
||||
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import { channelMessagesAtom, channelReplyAtom } from '@stores/channel';
|
||||
import { READONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix, getHourAgo } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
import { getActiveBlacklist, getBlacklist } from '@utils/storage';
|
||||
import { arrayObjToPureArr } from '@utils/transform';
|
||||
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
@@ -30,7 +33,7 @@ const fetchHided = async ([, id]) => {
|
||||
return array;
|
||||
};
|
||||
|
||||
const ChannelMessageList = lazy(() => import('@lume/app/channel/components/messageList'));
|
||||
const ChannelMessageList = lazy(() => import('@app/channel/components/messageList'));
|
||||
|
||||
export function Page() {
|
||||
const pool: any = useContext(RelayContext);
|
||||
@@ -57,7 +60,7 @@ export function Page() {
|
||||
{
|
||||
'#e': [key],
|
||||
kinds: [42],
|
||||
since: dateToUnix(hoursAgo(24, now.current)),
|
||||
since: dateToUnix(getHourAgo(24, now.current)),
|
||||
limit: 20,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR } from '@stores/constants';
|
||||
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ChatsListItem from '@lume/app/chat/components/item';
|
||||
import ChatsListSelfItem from '@lume/app/chat/components/self';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { getChats } from '@lume/utils/storage';
|
||||
import ChatsListItem from '@app/chat/components/item';
|
||||
import ChatsListSelfItem from '@app/chat/components/self';
|
||||
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { getChats } from '@utils/storage';
|
||||
|
||||
import useSWR from 'swr';
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ChatMessageItem } from '@lume/app/chat/components/messages/item';
|
||||
import { sortedChatMessagesAtom } from '@lume/stores/chat';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { ChatMessageItem } from '@app/chat/components/messages/item';
|
||||
|
||||
import { sortedChatMessagesAtom } from '@stores/chat';
|
||||
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useCallback, useRef } from 'react';
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { ImagePicker } from '@lume/shared/form/imagePicker';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { chatContentAtom } from '@lume/stores/chat';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { ImagePicker } from '@shared/form/imagePicker';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import { chatContentAtom } from '@stores/chat';
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { useAtom } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import ChatMessageUser from '@lume/app/chat/components/messages/user';
|
||||
import ImagePreview from '@lume/app/note/components/preview/image';
|
||||
import VideoPreview from '@lume/app/note/components/preview/video';
|
||||
import { useDecryptMessage } from '@lume/utils/hooks/useDecryptMessage';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import ChatMessageUser from '@app/chat/components/messages/user';
|
||||
import { useDecryptMessage } from '@app/chat/hooks/useDecryptMessage';
|
||||
import ImagePreview from '@app/note/components/preview/image';
|
||||
import VideoPreview from '@app/note/components/preview/video';
|
||||
|
||||
import { noteParser } from '@utils/parser';
|
||||
|
||||
import { memo } from 'react';
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR } from '@lume/stores/constants';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR } from '@stores/constants';
|
||||
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
|
||||
28
src/app/chat/hooks/useDecryptMessage.tsx
Normal file
28
src/app/chat/hooks/useDecryptMessage.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { nip04 } from 'nostr-tools';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
export function useDecryptMessage(userKey: string, userPriv: string, data: any) {
|
||||
const [content, setContent] = useState(null);
|
||||
|
||||
const extractSenderKey = useCallback(() => {
|
||||
const keyInTags = data.tags.find(([k, v]) => k === 'p' && v && v !== '')[1];
|
||||
if (keyInTags === userKey) {
|
||||
return data.pubkey;
|
||||
} else {
|
||||
return keyInTags;
|
||||
}
|
||||
}, [data.pubkey, data.tags, userKey]);
|
||||
|
||||
const decrypt = useCallback(async () => {
|
||||
const senderKey = extractSenderKey();
|
||||
const result = await nip04.decrypt(userPriv, senderKey, data.content);
|
||||
// update state with decrypt content
|
||||
setContent(result);
|
||||
}, [extractSenderKey, userPriv, data.content]);
|
||||
|
||||
useEffect(() => {
|
||||
decrypt().catch(console.error);
|
||||
}, [decrypt]);
|
||||
|
||||
return content ? content : null;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppHeader from '@lume/shared/appHeader';
|
||||
import MultiAccounts from '@lume/shared/multiAccounts';
|
||||
import Navigation from '@lume/shared/navigation';
|
||||
import AppHeader from '@shared/appHeader';
|
||||
import MultiAccounts from '@shared/multiAccounts';
|
||||
import Navigation from '@shared/navigation';
|
||||
|
||||
export function LayoutChat({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
import ChatMessageForm from '@lume/app/chat/components/messages/form';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { chatMessagesAtom } from '@lume/stores/chat';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import ChatMessageForm from '@app/chat/components/messages/form';
|
||||
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import { chatMessagesAtom } from '@stores/chat';
|
||||
import { READONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
import { usePageContext } from '@utils/hooks/usePageContext';
|
||||
|
||||
import { useSetAtom } from 'jotai';
|
||||
import { useResetAtom } from 'jotai/utils';
|
||||
import { Suspense, lazy, useContext, useEffect } from 'react';
|
||||
import useSWRSubscription from 'swr/subscription';
|
||||
|
||||
const ChatMessageList = lazy(() => import('@lume/app/chat/components/messageList'));
|
||||
const ChatMessageList = lazy(() => import('@app/chat/components/messageList'));
|
||||
|
||||
export function Page() {
|
||||
const pool: any = useContext(RelayContext);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getActiveAccount } from '@lume/utils/storage';
|
||||
import { getActiveAccount } from '@utils/storage';
|
||||
|
||||
import useSWR from 'swr';
|
||||
import { navigate } from 'vite-plugin-ssr/client/router';
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import LumeIcon from '@lume/shared/icons/lume';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix, hoursAgo } from '@lume/utils/getDate';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import LumeIcon from '@icons/lume';
|
||||
|
||||
import { READONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix, getHourAgo } from '@utils/date';
|
||||
import {
|
||||
addToBlacklist,
|
||||
countTotalLongNotes,
|
||||
@@ -11,8 +14,8 @@ import {
|
||||
getActiveAccount,
|
||||
getLastLogin,
|
||||
updateLastLogin,
|
||||
} from '@lume/utils/storage';
|
||||
import { getParentID, nip02ToArray } from '@lume/utils/transform';
|
||||
} from '@utils/storage';
|
||||
import { getParentID, nip02ToArray } from '@utils/transform';
|
||||
|
||||
import { useContext, useEffect, useRef } from 'react';
|
||||
import { navigate } from 'vite-plugin-ssr/client/router';
|
||||
@@ -38,12 +41,12 @@ export function Page() {
|
||||
let sinceLongNotes: number;
|
||||
|
||||
if (notes === 0) {
|
||||
sinceNotes = dateToUnix(hoursAgo(48, now.current));
|
||||
sinceNotes = dateToUnix(getHourAgo(48, now.current));
|
||||
} else {
|
||||
if (parseInt(lastLogin) > 0) {
|
||||
sinceNotes = parseInt(lastLogin);
|
||||
} else {
|
||||
sinceNotes = dateToUnix(hoursAgo(48, now.current));
|
||||
sinceNotes = dateToUnix(getHourAgo(48, now.current));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +177,7 @@ export function Page() {
|
||||
() => {
|
||||
updateLastLogin(dateToUnix(now.current));
|
||||
timeout = setTimeout(() => {
|
||||
navigate('/app/daily', { overwriteLastHistoryEntry: true });
|
||||
navigate('/app/radar', { overwriteLastHistoryEntry: true });
|
||||
}, 5000);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import { Kind1063 } from '@lume/app/note/components/kind1063';
|
||||
import NoteMetadata from '@lume/app/note/components/metadata';
|
||||
import { NoteParent } from '@lume/app/note/components/parent';
|
||||
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
|
||||
import { NoteWrapper } from '@lume/app/note/components/wrapper';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { isTagsIncludeID } from '@lume/utils/transform';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
import { Kind1063 } from '@app/note/components/kind1063';
|
||||
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';
|
||||
|
||||
import { noteParser } from '@utils/parser';
|
||||
import { isTagsIncludeID } from '@utils/transform';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MentionNote } from '@lume/app/note/components/mentions/note';
|
||||
import { MentionUser } from '@lume/app/note/components/mentions/user';
|
||||
import ImagePreview from '@lume/app/note/components/preview/image';
|
||||
import VideoPreview from '@lume/app/note/components/preview/video';
|
||||
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 ReactMarkdown from 'react-markdown';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
function isImage(url: string) {
|
||||
return /\.(jpg|jpeg|gif|png|webp|avif)$/.test(url);
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import { Kind1063 } from '@lume/app/note/components/kind1063';
|
||||
import { NoteSkeleton } from '@lume/app/note/components/skeleton';
|
||||
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
|
||||
import { NoteWrapper } from '@lume/app/note/components/wrapper';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
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';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
export function MentionUser(props: { children: any[] }) {
|
||||
const pubkey = props.children[0];
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import NoteLike from '@lume/app/note/components/metadata/like';
|
||||
import NoteReply from '@lume/app/note/components/metadata/reply';
|
||||
import NoteRepost from '@lume/app/note/components/metadata/repost';
|
||||
import ZapIcon from '@lume/shared/icons/zap';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import NoteLike from '@app/note/components/metadata/like';
|
||||
import NoteReply from '@app/note/components/metadata/reply';
|
||||
import NoteRepost from '@app/note/components/metadata/repost';
|
||||
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import ZapIcon from '@icons/zap';
|
||||
|
||||
import { READONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { useContext, useState } from 'react';
|
||||
import useSWRSubscription from 'swr/subscription';
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import LikeIcon from '@lume/shared/icons/like';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import LikeIcon from '@icons/like';
|
||||
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
import ReplyIcon from '@lume/shared/icons/reply';
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { Image } from '@shared/image';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import ReplyIcon from '@icons/reply';
|
||||
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import RepostIcon from '@lume/shared/icons/repost';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import RepostIcon from '@icons/repost';
|
||||
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import { Kind1063 } from '@lume/app/note/components/kind1063';
|
||||
import NoteMetadata from '@lume/app/note/components/metadata';
|
||||
import { NoteSkeleton } from '@lume/app/note/components/skeleton';
|
||||
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
import { Kind1063 } from '@app/note/components/kind1063';
|
||||
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';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
export default function ImagePreview({ urls }: { urls: string[] }) {
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { RootNote } from '@lume/app/note/components/rootNote';
|
||||
import { NoteRepostUser } from '@lume/app/note/components/user/repost';
|
||||
import { NoteWrapper } from '@lume/app/note/components/wrapper';
|
||||
import { getQuoteID } from '@lume/utils/transform';
|
||||
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 }) {
|
||||
const rootID = getQuoteID(event.tags);
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { WRITEONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { dateToUnix } from '@lume/utils/getDate';
|
||||
import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount';
|
||||
import { Image } from '@shared/image';
|
||||
import { RelayContext } from '@shared/relayProvider';
|
||||
|
||||
import { WRITEONLY_RELAYS } from '@stores/constants';
|
||||
|
||||
import { dateToUnix } from '@utils/date';
|
||||
import { useActiveAccount } from '@utils/hooks/useActiveAccount';
|
||||
|
||||
import { getEventHash, signEvent } from 'nostr-tools';
|
||||
import { useContext, useState } from 'react';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import NoteReplyUser from '@lume/app/note/components/user/reply';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
import NoteReplyUser from '@app/note/components/user/reply';
|
||||
|
||||
import { noteParser } from '@utils/parser';
|
||||
|
||||
export default function Reply({ data }: { data: any }) {
|
||||
const content = noteParser(data);
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import NoteReplyForm from '@lume/app/note/components/replies/form';
|
||||
import Reply from '@lume/app/note/components/replies/item';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { sortEvents } from '@lume/utils/transform';
|
||||
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';
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import { Kind1063 } from '@lume/app/note/components/kind1063';
|
||||
import NoteMetadata from '@lume/app/note/components/metadata';
|
||||
import { NoteSkeleton } from '@lume/app/note/components/skeleton';
|
||||
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
import { Kind1063 } from '@app/note/components/kind1063';
|
||||
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';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { shortenKey } from '@lume/utils/shortenKey';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
import { shortenKey } from '@utils/shortenKey';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { Image } from '@lume/shared/image';
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants';
|
||||
import { useProfile } from '@lume/utils/hooks/useProfile';
|
||||
import { Image } from '@shared/image';
|
||||
|
||||
import { DEFAULT_AVATAR, IMGPROXY_URL } from '@stores/constants';
|
||||
|
||||
import { useProfile } from '@utils/hooks/useProfile';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppHeader from '@lume/shared/appHeader';
|
||||
import MultiAccounts from '@lume/shared/multiAccounts';
|
||||
import Navigation from '@lume/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 (
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { Kind1 } from '@lume/app/note/components/kind1';
|
||||
import NoteMetadata from '@lume/app/note/components/metadata';
|
||||
import RepliesList from '@lume/app/note/components/replies/list';
|
||||
import { NoteDefaultUser } from '@lume/app/note/components/user/default';
|
||||
import { RelayContext } from '@lume/shared/relayProvider';
|
||||
import { READONLY_RELAYS } from '@lume/stores/constants';
|
||||
import { usePageContext } from '@lume/utils/hooks/usePageContext';
|
||||
import { noteParser } from '@lume/utils/parser';
|
||||
import { Kind1 } from '@app/note/components/kind1';
|
||||
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';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CreateViewModal } from '@lume/app/daily/components/views/createModal';
|
||||
import { CreateViewModal } from '@app/radar/components/views/createModal';
|
||||
|
||||
export function Header() {
|
||||
return (
|
||||
@@ -1,5 +1,5 @@
|
||||
import CancelIcon from '@lume/shared/icons/cancel';
|
||||
import PlusIcon from '@lume/shared/icons/plus';
|
||||
import CancelIcon from '@icons/cancel';
|
||||
import PlusIcon from '@icons/plus';
|
||||
|
||||
import { Dialog, Transition } from '@headlessui/react';
|
||||
import { Fragment, useState } from 'react';
|
||||
@@ -1,6 +1,6 @@
|
||||
import AppHeader from '@lume/shared/appHeader';
|
||||
import MultiAccounts from '@lume/shared/multiAccounts';
|
||||
import Navigation from '@lume/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 (
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Header } from '@lume/app/daily/components/header';
|
||||
import { NoteBase } from '@lume/app/note/components/base';
|
||||
import { NoteQuoteRepost } from '@lume/app/note/components/quoteRepost';
|
||||
import { NoteSkeleton } from '@lume/app/note/components/skeleton';
|
||||
import { getNotes } from '@lume/utils/storage';
|
||||
import { NoteBase } from '@app/note/components/base';
|
||||
import { NoteQuoteRepost } from '@app/note/components/quoteRepost';
|
||||
import { NoteSkeleton } from '@app/note/components/skeleton';
|
||||
import { Header } from '@app/radar/components/header';
|
||||
|
||||
import { getNotes } from '@utils/storage';
|
||||
|
||||
import { useInfiniteQuery } from '@tanstack/react-query';
|
||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||
@@ -1,7 +1,7 @@
|
||||
export function Page() {
|
||||
return (
|
||||
<div>
|
||||
<p>MySpace</p>
|
||||
<p>Space</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user