diff --git a/src/app/pages/send/broadcast-error/broadcast-error.tsx b/src/app/pages/send/broadcast-error/broadcast-error.tsx index 7d73123c5e0..2536c2cc68b 100644 --- a/src/app/pages/send/broadcast-error/broadcast-error.tsx +++ b/src/app/pages/send/broadcast-error/broadcast-error.tsx @@ -1,15 +1,24 @@ -import { useLocation } from 'react-router-dom'; +import { useLocation, useNavigate } from 'react-router-dom'; import get from 'lodash.get'; +import { Dialog } from '@leather.io/ui'; + +import { RouteUrls } from '@shared/route-urls'; import { analytics } from '@shared/utils/analytics'; import { useOnMount } from '@app/common/hooks/use-on-mount'; +import { DialogHeader } from '@app/ui/components/containers/headers/dialog-header'; import { BroadcastErrorLayout } from './components/broadcast-error.layout'; -export function BroadcastError() { +interface Props { + showInDialog?: boolean; +} + +export function BroadcastError({ showInDialog = false }: Props) { const { state } = useLocation(); + const navigate = useNavigate(); const msg = get(state, 'error.message', 'Unknown error response'); const title = get(state, 'title', 'There was an error broadcasting your transaction'); @@ -17,7 +26,7 @@ export function BroadcastError() { useOnMount(() => void analytics.track('bitcoin_contract_error', { msg })); - return ( + const layout = ( ); + + if (showInDialog) { + return ( + } + isShowing + onClose={() => navigate(RouteUrls.Home)} + > + {layout} + + ); + } + + return layout; } diff --git a/src/app/pages/send/ordinal-inscription/ordinal-routes.tsx b/src/app/pages/send/ordinal-inscription/ordinal-routes.tsx index 684b67619e5..66ffab73312 100644 --- a/src/app/pages/send/ordinal-inscription/ordinal-routes.tsx +++ b/src/app/pages/send/ordinal-inscription/ordinal-routes.tsx @@ -21,6 +21,6 @@ export const sendOrdinalRoutes = ( } /> } /> - } /> + } /> );