Skip to content

Commit

Permalink
feat: add eth scan url for metanodes address
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenguyen7411 committed Dec 1, 2023
1 parent 1f7b0df commit 0ef274e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/modules/scenes/Main/Metanodes/MetanodeList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
toggleStatusWord,
} from '../../../../metanodes';
import { StylingConstants } from '../../../../styles';
import { SizeL, TextBlock, TextRoom } from '../../../Common';
import { SizeL, TextBlock, TextRoom, Atag } from '../../../Common';
import { getScanDetailBaseEndpoint } from '../../../../pool';

import {
AddressP,
Expand Down Expand Up @@ -55,6 +56,8 @@ export const MetanodeList = (props: Props) => {
const { media } = StylingConstants;
const xl = useMatchMedia({ query: `(min-width: ${rem(media.xl)})` });

const baseUrl = getScanDetailBaseEndpoint(bridge);

return (
<MetanodeListContainer>
<NodeContainer>
Expand Down Expand Up @@ -108,6 +111,8 @@ export const MetanodeList = (props: Props) => {
const isNoRequiredTooltip =
xl || node.status === 'CHURNED_IN' || node.status === 'MAY_CHURN_IN';

const addressUrl = `${baseUrl}/address/${ethAddress}`;

return (
<Row key={node.id} bg={toggleStatusBg(node.status, i)}>
<ColumnLeft>
Expand Down Expand Up @@ -171,7 +176,9 @@ export const MetanodeList = (props: Props) => {
<TextRoom>:</TextRoom>
</CurrencyColumn>
<ColumnAddress>
<AddressP>{ethAddress}</AddressP>
<Atag href={addressUrl} rel="noopener noreferrer" target="_blank">
<AddressP>{ethAddress}</AddressP>
</Atag>
</ColumnAddress>
</RowAddress>
</BoxAddress>
Expand Down
4 changes: 1 addition & 3 deletions src/modules/scenes/Main/Metanodes/MetanodeList/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ export const TextNodeStatus = styled(TextNodeName)`
}
`;

export const AddressP = styled(AddressLinkP)`
cursor: text;
`;
export const AddressP = styled(AddressLinkP)``;

export const CurrencyBox = styled.div`
width: ${({ theme }) => rem(theme.pulsar.size.state)};
Expand Down

0 comments on commit 0ef274e

Please sign in to comment.