diff --git a/src/pages/primary/DiscussionsPage/index.tsx b/src/pages/primary/DiscussionsPage/index.tsx index 80b4e8a..e8ffb24 100644 --- a/src/pages/primary/DiscussionsPage/index.tsx +++ b/src/pages/primary/DiscussionsPage/index.tsx @@ -19,7 +19,7 @@ import SubtopicFilter from '@/pages/primary/DiscussionsPage/SubtopicFilter' import TopicSubscribeButton from '@/components/TopicSubscribeButton' import { NostrEvent } from 'nostr-tools' import client from '@/services/client.service' -import { useSecondaryPage } from '@/PageManager' +import { useSmartNoteNavigation } from '@/PageManager' import { toNote } from '@/lib/link' import { kinds } from 'nostr-tools' @@ -107,7 +107,7 @@ const DiscussionsPage = forwardRef((_, ref) => { const { t } = useTranslation() const { favoriteRelays } = useFavoriteRelays() const { pubkey } = useNostr() - const { push } = useSecondaryPage() + const { navigateToNote } = useSmartNoteNavigation() // State management const [selectedTopic, setSelectedTopic] = useState('all') @@ -718,7 +718,7 @@ const DiscussionsPage = forwardRef((_, ref) => { thread={event} subtopics={availableSubtopics} onThreadClick={() => { - push(toNote(event)) + navigateToNote(toNote(event)) }} /> ))} @@ -760,7 +760,7 @@ const DiscussionsPage = forwardRef((_, ref) => { thread={event} subtopics={availableSubtopics} onThreadClick={() => { - push(toNote(event)) + navigateToNote(toNote(event)) }} /> ))} @@ -841,7 +841,7 @@ const DiscussionsPage = forwardRef((_, ref) => { subtopics={threadSubtopics} primaryTopic={entry?.categorizedTopic} onThreadClick={() => { - push(toNote(event)) + navigateToNote(toNote(event)) }} /> ) @@ -866,7 +866,7 @@ const DiscussionsPage = forwardRef((_, ref) => { subtopics={threadSubtopics} primaryTopic={entry?.categorizedTopic} onThreadClick={() => { - push(toNote(event)) + navigateToNote(toNote(event)) }} /> ) diff --git a/src/pages/secondary/NoteListPage/index.tsx b/src/pages/secondary/NoteListPage/index.tsx index 33fe62f..30e614c 100644 --- a/src/pages/secondary/NoteListPage/index.tsx +++ b/src/pages/secondary/NoteListPage/index.tsx @@ -14,7 +14,7 @@ import { UserRound } from 'lucide-react' import React, { forwardRef, useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' -const NoteListPage = forwardRef(({ index }: { index?: number }, ref) => { +const NoteListPage = forwardRef(({ index, hideTitlebar = false }: { index?: number; hideTitlebar?: boolean }, ref) => { const { t } = useTranslation() const { push } = useSecondaryPage() const { relayList, pubkey } = useNostr() @@ -130,7 +130,7 @@ const NoteListPage = forwardRef(({ index }: { index?: number }, ref) => { diff --git a/src/pages/secondary/ProfilePage/index.tsx b/src/pages/secondary/ProfilePage/index.tsx index 98d800f..ad4b816 100644 --- a/src/pages/secondary/ProfilePage/index.tsx +++ b/src/pages/secondary/ProfilePage/index.tsx @@ -3,11 +3,11 @@ import { useFetchProfile } from '@/hooks' import SecondaryPageLayout from '@/layouts/SecondaryPageLayout' import { forwardRef } from 'react' -const ProfilePage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => { +const ProfilePage = forwardRef(({ id, index, hideTitlebar = false }: { id?: string; index?: number; hideTitlebar?: boolean }, ref) => { const { profile } = useFetchProfile(id) return ( - + ) diff --git a/src/pages/secondary/RelayPage/index.tsx b/src/pages/secondary/RelayPage/index.tsx index 6c01240..d725ed5 100644 --- a/src/pages/secondary/RelayPage/index.tsx +++ b/src/pages/secondary/RelayPage/index.tsx @@ -4,7 +4,7 @@ import { normalizeUrl, simplifyUrl } from '@/lib/url' import { forwardRef, useMemo } from 'react' import NotFoundPage from '../NotFoundPage' -const RelayPage = forwardRef(({ url, index }: { url?: string; index?: number }, ref) => { +const RelayPage = forwardRef(({ url, index, hideTitlebar = false }: { url?: string; index?: number; hideTitlebar?: boolean }, ref) => { const normalizedUrl = useMemo(() => (url ? normalizeUrl(url) : undefined), [url]) const title = useMemo(() => (url ? simplifyUrl(url) : undefined), [url]) @@ -13,7 +13,7 @@ const RelayPage = forwardRef(({ url, index }: { url?: string; index?: number }, } return ( - + ) diff --git a/src/pages/secondary/RelayReviewsPage/index.tsx b/src/pages/secondary/RelayReviewsPage/index.tsx index 10810de..390ff94 100644 --- a/src/pages/secondary/RelayReviewsPage/index.tsx +++ b/src/pages/secondary/RelayReviewsPage/index.tsx @@ -6,7 +6,7 @@ import { forwardRef, useMemo } from 'react' import { useTranslation } from 'react-i18next' import NotFoundPage from '../NotFoundPage' -const RelayReviewsPage = forwardRef(({ url, index }: { url?: string; index?: number }, ref) => { +const RelayReviewsPage = forwardRef(({ url, index, hideTitlebar = false }: { url?: string; index?: number; hideTitlebar?: boolean }, ref) => { const { t } = useTranslation() const normalizedUrl = useMemo(() => (url ? normalizeUrl(url) : undefined), [url]) const title = useMemo( @@ -19,7 +19,7 @@ const RelayReviewsPage = forwardRef(({ url, index }: { url?: string; index?: num } return ( - + { +const SearchPage = forwardRef(({ index, hideTitlebar = false }: { index?: number; hideTitlebar?: boolean }, ref) => { const { push, pop } = useSecondaryPage() const [input, setInput] = useState('') const searchBarRef = useRef(null) @@ -49,14 +49,14 @@ const SearchPage = forwardRef(({ index }: { index?: number }, ref) => { - } + )} displayScrollToTopButton >