From b64ed8b58790e1cedb3800fe231c99014eb70f3d Mon Sep 17 00:00:00 2001 From: Ren Amamiya <123083837+reyamir@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:41:04 +0700 Subject: [PATCH] fixed nextjs ssg build issue --- .../nostr/{channels/[id] => channel}/page.tsx | 12 ++++-- .../nostr/{chats/[pubkey] => chat}/page.tsx | 14 ++++--- src/app/nostr/newsfeed/[id]/page.tsx | 5 --- src/app/nostr/newsfeed/note/page.tsx | 10 +++++ src/app/nostr/{users/[id] => user}/page.tsx | 14 ++++--- src/app/onboarding/create/page.tsx | 2 +- .../create/{[...slug] => step-2}/page.tsx | 9 +++-- src/app/onboarding/login/page.tsx | 2 +- .../login/{[privkey] => step-2}/page.tsx | 13 +++--- src/components/channels/browseChannelItem.tsx | 40 ------------------- src/components/channels/channelListItem.tsx | 2 +- src/components/chats/chatList.tsx | 2 +- src/components/chats/chatListItem.tsx | 2 +- src/components/note/base.tsx | 6 +-- src/components/note/parent.tsx | 23 ++++++----- src/components/note/quote.tsx | 23 ++++++----- src/components/note/quoteRepost.tsx | 2 +- src/components/note/rootNote.tsx | 32 ++++++++++----- 18 files changed, 107 insertions(+), 106 deletions(-) rename src/app/nostr/{channels/[id] => channel}/page.tsx (87%) rename src/app/nostr/{chats/[pubkey] => chat}/page.tsx (80%) delete mode 100644 src/app/nostr/newsfeed/[id]/page.tsx create mode 100644 src/app/nostr/newsfeed/note/page.tsx rename src/app/nostr/{users/[id] => user}/page.tsx (85%) rename src/app/onboarding/create/{[...slug] => step-2}/page.tsx (97%) rename src/app/onboarding/login/{[privkey] => step-2}/page.tsx (93%) delete mode 100644 src/components/channels/browseChannelItem.tsx diff --git a/src/app/nostr/channels/[id]/page.tsx b/src/app/nostr/channel/page.tsx similarity index 87% rename from src/app/nostr/channels/[id]/page.tsx rename to src/app/nostr/channel/page.tsx index a1711cff..ce87d1af 100644 --- a/src/app/nostr/channels/[id]/page.tsx +++ b/src/app/nostr/channel/page.tsx @@ -12,9 +12,13 @@ import { dateToUnix, hoursAgo } from '@utils/getDate'; import useLocalStorage from '@rehooks/local-storage'; import { useSetAtom } from 'jotai'; import { useResetAtom } from 'jotai/utils'; +import { useSearchParams } from 'next/navigation'; import { useContext, useEffect, useRef } from 'react'; -export default function Page({ params }: { params: { id: string } }) { +export default function Page() { + const searchParams = useSearchParams(); + const id = searchParams.get('channel-id'); + const [pool]: any = useContext(RelayContext); const [activeAccount]: any = useLocalStorage('account', {}); @@ -40,7 +44,7 @@ export default function Page({ params }: { params: { id: string } }) { since: dateToUnix(hoursAgo(24, now.current)), }, { - '#e': [params.id], + '#e': [id], kinds: [42], since: dateToUnix(hoursAgo(24, now.current)), }, @@ -66,13 +70,13 @@ export default function Page({ params }: { params: { id: string } }) { return () => { unsubscribe(); }; - }, [pool, activeAccount.pubkey, params.id, setChannelMessages, resetChannelReply, resetChannelMessages]); + }, [pool, id, activeAccount.pubkey, setChannelMessages, resetChannelReply, resetChannelMessages]); return (