From b4424e7c35ec14861a9f2981afa75ffc2d3e9f23 Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Thu, 2 Mar 2023 16:10:59 +0700 Subject: [PATCH] disabled global newsfeed and reply, reaction count --- src/components/note/atoms/reaction.tsx | 4 ++- src/components/note/atoms/reply.tsx | 3 +- src/pages/feed/global.tsx | 38 ++------------------------ 3 files changed, 7 insertions(+), 38 deletions(-) diff --git a/src/components/note/atoms/reaction.tsx b/src/components/note/atoms/reaction.tsx index b2b6a619..ac6e49f3 100644 --- a/src/components/note/atoms/reaction.tsx +++ b/src/components/note/atoms/reaction.tsx @@ -19,6 +19,7 @@ export default function Reaction({ eventID, eventPubkey }: { eventID: string; ev const pubkey = currentUser.pubkey; const privkey = currentUser.privkey; + /* relayPool.subscribe( [ { @@ -31,7 +32,7 @@ export default function Reaction({ eventID, eventPubkey }: { eventID: string; ev relays, (event: any) => { if (event.content === '🤙' || event.content === '+') { - //setReaction(reaction + 1); + setReaction(reaction + 1); } }, undefined, @@ -39,6 +40,7 @@ export default function Reaction({ eventID, eventPubkey }: { eventID: string; ev console.log(events, relayURL); } ); + */ const handleReaction = (e: any) => { e.stopPropagation(); diff --git a/src/components/note/atoms/reply.tsx b/src/components/note/atoms/reply.tsx index 88d97844..cde060c0 100644 --- a/src/components/note/atoms/reply.tsx +++ b/src/components/note/atoms/reply.tsx @@ -2,8 +2,7 @@ import { ChatBubbleIcon } from '@radix-ui/react-icons'; import { useState } from 'react'; -export default function Reply({ eventID }: { eventID: string }) { - console.log(eventID); +export default function Reply() { const [count] = useState(0); return ( diff --git a/src/pages/feed/global.tsx b/src/pages/feed/global.tsx index c8ce0a63..204bd2fc 100644 --- a/src/pages/feed/global.tsx +++ b/src/pages/feed/global.tsx @@ -1,50 +1,18 @@ import BaseLayout from '@layouts/baseLayout'; import NewsFeedLayout from '@layouts/newsfeedLayout'; -import { Placeholder } from '@components/note/placeholder'; -import { Thread } from '@components/thread'; - -import { hoursAgo } from '@utils/getDate'; - -import { dateToUnix, useNostrEvents } from 'nostr-react'; -import { - JSXElementConstructor, - ReactElement, - ReactFragment, - ReactPortal, - Suspense, - useRef, -} from 'react'; +import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; export default function Page() { - const now = useRef(new Date()); - - const { events } = useNostrEvents({ - filter: { - until: dateToUnix(now.current), - since: dateToUnix(hoursAgo(1, now.current)), - kinds: [1], - limit: 10, - }, - }); - return (
- }> - - +

Global

); } Page.getLayout = function getLayout( - page: - | string - | number - | boolean - | ReactElement> - | ReactFragment - | ReactPortal + page: string | number | boolean | ReactElement> | ReactFragment | ReactPortal ) { return (