From 9fb13dbcc0545d9640e5c7a4ebc20c5840ed4b71 Mon Sep 17 00:00:00 2001 From: Kristof Csillag Date: Fri, 1 Dec 2023 00:36:55 +0100 Subject: [PATCH] Use a link for opening TX in explorer --- src/pages/Transaction/index.tsx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/pages/Transaction/index.tsx b/src/pages/Transaction/index.tsx index 22dc51d..a6f46e8 100644 --- a/src/pages/Transaction/index.tsx +++ b/src/pages/Transaction/index.tsx @@ -56,12 +56,7 @@ export const Transaction: FC = () => { init() }, [getTransaction, navigate, txHash]) - const handleNavigateToExplorer = () => { - if (explorerBaseUrl && txHash) { - const txUrl = StringUtils.getTransactionUrl(explorerBaseUrl, txHash) - window.open(txUrl, '_blank', 'noopener,noreferrer') - } - } + const txUrl = explorerBaseUrl && txHash ? StringUtils.getTransactionUrl(explorerBaseUrl, txHash) : undefined const handleNavigateBack = () => { navigate('/wrapper') @@ -92,11 +87,13 @@ export const Transaction: FC = () => { {type === TransactionType.Rose &&  {amount} ROSE} - {explorerBaseUrl && txHash && ( - + {txUrl && ( + + + )}