feat: improve highlight source display and navigation
This commit is contained in:
13
src/pages/secondary/NotePage/NotFound.tsx
Normal file
13
src/pages/secondary/NotePage/NotFound.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import ClientSelect from '@/components/ClientSelect'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export default function NotFound({ bech32Id }: { bech32Id?: string }) {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div className="text-muted-foreground w-full h-full flex flex-col items-center justify-center gap-2">
|
||||
<div>{t('Note not found')}</div>
|
||||
<ClientSelect originalNoteId={bech32Id} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import { Ellipsis } from 'lucide-react'
|
||||
import { Event } from 'nostr-tools'
|
||||
import { forwardRef, useMemo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import NotFoundPage from '../NotFoundPage'
|
||||
import NotFound from './NotFound'
|
||||
|
||||
const NotePage = forwardRef(({ id, index }: { id?: string; index?: number }, ref) => {
|
||||
const { t } = useTranslation()
|
||||
@@ -59,7 +59,13 @@ const NotePage = forwardRef(({ id, index }: { id?: string; index?: number }, ref
|
||||
</SecondaryPageLayout>
|
||||
)
|
||||
}
|
||||
if (!event) return <NotFoundPage />
|
||||
if (!event) {
|
||||
return (
|
||||
<SecondaryPageLayout ref={ref} index={index} title={t('Note')} displayScrollToTopButton>
|
||||
<NotFound bech32Id={id} />
|
||||
</SecondaryPageLayout>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<SecondaryPageLayout ref={ref} index={index} title={t('Note')} displayScrollToTopButton>
|
||||
|
||||
Reference in New Issue
Block a user