From 90294214383dc015a26eed999b4345231c60ecac Mon Sep 17 00:00:00 2001 From: Rashmi-278 Date: Tue, 6 Aug 2024 13:53:49 +0530 Subject: [PATCH] update etherscan links for other networks --- .../DisplayRegistration.js | 2 +- .../EtherscanLink/EtherscanLink.js | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js index edc32608..45342958 100644 --- a/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js +++ b/daostar-website/src/components/RegistrationCard/DisplayRegistration/DisplayRegistration.js @@ -57,7 +57,7 @@ const DisplayRegistration = ({ case "Stargaze": return ; default: - return ; + return ; } }; diff --git a/daostar-website/src/components/RegistrationCard/DisplayRegistration/EtherscanLink/EtherscanLink.js b/daostar-website/src/components/RegistrationCard/DisplayRegistration/EtherscanLink/EtherscanLink.js index db345bf0..149e2d70 100644 --- a/daostar-website/src/components/RegistrationCard/DisplayRegistration/EtherscanLink/EtherscanLink.js +++ b/daostar-website/src/components/RegistrationCard/DisplayRegistration/EtherscanLink/EtherscanLink.js @@ -4,10 +4,23 @@ import { Tooltip2 } from '@blueprintjs/popover2'; import './EtherscanLink.css'; const EtherscanLink = ({ - address + address, + network = 'ethereum' // default network is ethereum }) => { - const url = `https://etherscan.io/address/${address}`; + const getUrl = (network, address) => { + switch (network) { + case 'optimism': + return `https://optimistic.etherscan.io/address/${address}`; + case 'arbitrum': + return `https://arbiscan.io/address/${address}`; + case 'ethereum': + default: + return `https://etherscan.io/address/${address}`; + } + }; + + const url = getUrl(network, address); return (
@@ -15,10 +28,11 @@ const EtherscanLink = ({ href={url} className='no-underline' target="_blank" + rel="noopener noreferrer" > {address}
- ) -} + ); +}; -export default EtherscanLink; \ No newline at end of file +export default EtherscanLink;