diff --git a/src/lib/sheet-dismiss-guard.ts b/src/lib/sheet-dismiss-guard.ts
index 2669e8c5..85a49f43 100644
--- a/src/lib/sheet-dismiss-guard.ts
+++ b/src/lib/sheet-dismiss-guard.ts
@@ -17,6 +17,17 @@ function eventComposedPath(e: RadixOutsideEvent): EventTarget[] {
return []
}
+function pathIncludesPortaledOverlay(path: EventTarget[]): boolean {
+ return path.some((node) => {
+ if (!(node instanceof HTMLElement)) return false
+ if (node.tagName.toLowerCase() === 'bc-modal') return true
+ if (node.hasAttribute('data-radix-dialog-content')) return true
+ if (node.hasAttribute('data-radix-dialog-overlay')) return true
+ if (node.getAttribute('role') === 'dialog' && node.closest('[data-radix-portal]')) return true
+ return false
+ })
+}
+
export function preventRadixSheetCloseForPortaledOverlay(e: RadixOutsideEvent): void {
if (typeof document === 'undefined') return
if (document.body.classList.contains('yarl__no_scroll')) {
@@ -24,10 +35,11 @@ export function preventRadixSheetCloseForPortaledOverlay(e: RadixOutsideEvent):
return
}
const path = eventComposedPath(e)
- const inBitcoinConnectModal = path.some(
- (node) => node instanceof HTMLElement && node.tagName.toLowerCase() === 'bc-modal'
- )
- if (inBitcoinConnectModal) {
+ if (pathIncludesPortaledOverlay(path)) {
+ e.preventDefault()
+ return
+ }
+ if (document.querySelector('[data-radix-dialog-content][data-state="open"]')) {
e.preventDefault()
}
}
diff --git a/src/pages/secondary/NotFoundPage/index.tsx b/src/pages/secondary/NotFoundPage/index.tsx
index 5f43e95a..5ea8d0e0 100644
--- a/src/pages/secondary/NotFoundPage/index.tsx
+++ b/src/pages/secondary/NotFoundPage/index.tsx
@@ -2,12 +2,20 @@ import NotFound from '@/components/NotFound'
import { RefreshButton } from '@/components/RefreshButton'
import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
import { forwardRef, useCallback, useState } from 'react'
+import { useTranslation } from 'react-i18next'
const NotFoundPage = forwardRef(({ index }: { index?: number }, ref) => {
+ const { t } = useTranslation()
const [contentKey, setContentKey] = useState(0)
const bump = useCallback(() => setContentKey((k) => k + 1), [])
return (
-
}>
+
}
+ >
diff --git a/src/pages/secondary/RelayPage/index.tsx b/src/pages/secondary/RelayPage/index.tsx
index 879fcfe4..f1000829 100644
--- a/src/pages/secondary/RelayPage/index.tsx
+++ b/src/pages/secondary/RelayPage/index.tsx
@@ -35,6 +35,7 @@ const RelayPage = forwardRef(({ url, index, hideTitlebar = false }: { url?: stri
ref={ref}
index={index}
title={hideTitlebar ? undefined : title}
+ hideBackButton={false}
controls={hideTitlebar ? undefined :
}
displayScrollToTopButton
>
diff --git a/src/pages/secondary/RelayReviewsPage/index.tsx b/src/pages/secondary/RelayReviewsPage/index.tsx
index bb20c1d8..064713bf 100644
--- a/src/pages/secondary/RelayReviewsPage/index.tsx
+++ b/src/pages/secondary/RelayReviewsPage/index.tsx
@@ -81,6 +81,7 @@ const RelayReviewsPage = forwardRef(({ url, index, hideTitlebar = false }: { url
ref={ref}
index={index}
title={hideTitlebar ? undefined : title}
+ hideBackButton={false}
controls={hideTitlebar ? undefined :
}
displayScrollToTopButton
>
diff --git a/src/services/navigation.service.ts b/src/services/navigation.service.ts
index 4ce2a645..d8f077f0 100644
--- a/src/services/navigation.service.ts
+++ b/src/services/navigation.service.ts
@@ -119,7 +119,7 @@ export class ComponentFactory {
}
static createRelayPage(relayUrl: string): ReactNode {
- return React.createElement(SecondaryRelayPage, { url: relayUrl, index: 0, hideTitlebar: true })
+ return React.createElement(SecondaryRelayPage, { url: relayUrl, index: 0 })
}
static createProfilePage(profileId: string): ReactNode {