diff --git a/src/app/note/components/content.tsx b/src/app/note/components/content.tsx index 93dfd9e1..61714f88 100644 --- a/src/app/note/components/content.tsx +++ b/src/app/note/components/content.tsx @@ -12,7 +12,7 @@ export const NoteContent = ({ content }: { content: any }) => { , }} diff --git a/src/renderer/shell.tsx b/src/renderer/shell.tsx index 909ff9cb..38f072f7 100644 --- a/src/renderer/shell.tsx +++ b/src/renderer/shell.tsx @@ -1,7 +1,7 @@ +import { PageContext } from '@lume/renderer/types'; import RelayProvider from '@lume/shared/relayProvider'; import { PageContextProvider } from '@lume/utils/hooks/usePageContext'; -import { PageContext } from '@renderer/types'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { LayoutDefault } from './layoutDefault'; @@ -13,11 +13,11 @@ export function Shell({ children, pageContext }: { children: React.ReactNode; pa return ( - - + + {children} - - + + ); } diff --git a/src/shared/accounts/active.tsx b/src/shared/accounts/active.tsx index 1e579d9a..9d2d0c08 100644 --- a/src/shared/accounts/active.tsx +++ b/src/shared/accounts/active.tsx @@ -5,11 +5,12 @@ export default function ActiveAccount({ user }: { user: any }) { const userData = JSON.parse(user.metadata); return ( - ); diff --git a/src/shared/eventCollector.tsx b/src/shared/eventCollector.tsx index 81cd468b..5a48134c 100644 --- a/src/shared/eventCollector.tsx +++ b/src/shared/eventCollector.tsx @@ -1,4 +1,4 @@ -import { NetworkStatusIndicator } from '@lume/shared/networkStatusIndicator'; +import HeartBeatIcon from '@lume/shared/icons/heartbeat'; import { RelayContext } from '@lume/shared/relayProvider'; import { READONLY_RELAYS } from '@lume/stores/constants'; import { hasNewerNoteAtom } from '@lume/stores/note'; @@ -20,12 +20,13 @@ export default function EventCollector() { const { account, isLoading, isError } = useActiveAccount(); useSWRSubscription(!isLoading && !isError && account ? ['eventCollector', account] : null, ([, key], {}) => { - const follows = nip02ToArray(JSON.parse(key.follows)); + const follows = JSON.parse(key.follows); + const followsAsArray = nip02ToArray(follows); const unsubscribe = pool.subscribe( [ { kinds: [1, 6], - authors: follows, + authors: followsAsArray, since: dateToUnix(now.current), }, { @@ -37,6 +38,10 @@ export default function EventCollector() { '#p': [key.pubkey], since: dateToUnix(now.current), }, + { + kinds: [30023], + since: dateToUnix(now.current), + }, ], READONLY_RELAYS, (event: any) => { @@ -85,6 +90,11 @@ export default function EventCollector() { event.id ); break; + // long post + case 30023: + // insert event to local database + createNote(event.id, account.id, event.pubkey, event.kind, event.tags, event.content, event.created_at, ''); + break; default: break; } @@ -96,5 +106,9 @@ export default function EventCollector() { }; }); - return ; + return ( +
+ +
+ ); } diff --git a/src/shared/icons/compose.tsx b/src/shared/icons/compose.tsx new file mode 100644 index 00000000..c9e64ed6 --- /dev/null +++ b/src/shared/icons/compose.tsx @@ -0,0 +1,12 @@ +import { SVGProps } from 'react'; + +export default function ComposeIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + ); +} diff --git a/src/shared/icons/heartbeat.tsx b/src/shared/icons/heartbeat.tsx new file mode 100644 index 00000000..91ead017 --- /dev/null +++ b/src/shared/icons/heartbeat.tsx @@ -0,0 +1,15 @@ +import { SVGProps } from 'react'; + +export default function HeartBeatIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + ); +} diff --git a/src/shared/multiAccounts.tsx b/src/shared/multiAccounts.tsx index 91bc14b9..92314496 100644 --- a/src/shared/multiAccounts.tsx +++ b/src/shared/multiAccounts.tsx @@ -17,7 +17,7 @@ export default function MultiAccounts() { return (
-
+
<> {!activeAccount ? (
diff --git a/src/shared/navigation.tsx b/src/shared/navigation.tsx index 3faaa39a..27aac42c 100644 --- a/src/shared/navigation.tsx +++ b/src/shared/navigation.tsx @@ -1,6 +1,8 @@ import ChannelsList from '@lume/app/channel/components/list'; import ChatsList from '@lume/app/chat/components/list'; import ActiveLink from '@lume/shared/activeLink'; +import EventCollector from '@lume/shared/eventCollector'; +import ComposeIcon from '@lume/shared/icons/compose'; import MyspaceIcon from '@lume/shared/icons/myspace'; import NavArrowDownIcon from '@lume/shared/icons/navArrowDown'; import ThreadsIcon from '@lume/shared/icons/threads'; @@ -10,7 +12,14 @@ import { Disclosure } from '@headlessui/react'; export default function Navigation() { return ( -
+
+
+ + +
{/* Newsfeed */}
diff --git a/src/utils/hooks/useChannelProfile.tsx b/src/utils/hooks/useChannelProfile.tsx index 6e241fb9..b357402c 100644 --- a/src/utils/hooks/useChannelProfile.tsx +++ b/src/utils/hooks/useChannelProfile.tsx @@ -20,7 +20,7 @@ export const useChannelProfile = (id: string, channelPubkey: string) => { const { data: cache, isLoading } = useSWR(['channel-cache-profile', id], fetcher); const { data, error } = useSWRSubscription( - !isLoading && !cache ? ['channel-profile', id] : null, + !isLoading && cache ? ['channel-profile', id] : null, ([, key], { next }) => { // subscribe to channel const unsubscribe = pool.subscribe( diff --git a/src/utils/parser.tsx b/src/utils/parser.tsx index 163374e9..dd7fa449 100644 --- a/src/utils/parser.tsx +++ b/src/utils/parser.tsx @@ -35,7 +35,7 @@ export const noteParser = (event: Event) => { // map hashtag to em content.original.match(/#(\w+)(?!:\/\/)/g)?.forEach((item) => { - content.parsed = content.parsed.replace(item, `[${item}](https://primal.net/search/${item})`); + content.parsed = content.parsed.replace(item, ` [${item}](https://primal.net/search/${item})`); }); // handle nostr mention diff --git a/tailwind.config.js b/tailwind.config.js index 49e92342..2a8938c3 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -31,9 +31,9 @@ module.exports = { 0 8px 24px rgb(4 4 7 / 60%) `, button: ` - rgba(112, 26, 117, 0.5) 0px 2px 8px, - rgb(112, 26, 117) 0px 2px 4px, - rgb(112, 26, 117) 0px 0px 0px 1px, + rgba(74, 4, 78, 0.5) 0px 2px 8px, + rgb(74, 4, 78) 0px 2px 4px, + rgb(74, 4, 78) 0px 0px 0px 1px, rgba(255, 255, 255, 0.2) 0px 0px 0px 1px inset `, },