Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix block explorer links #411

Merged
merged 10 commits into from Nov 21, 2022
Expand Up @@ -25,6 +25,7 @@ jest.mock('utils', () => ({
},
}),
preventEmptyString: () => mockBigNumber,
shortenAddress: () => {},
}));

jest.mock('wagmi', () => ({
Expand Down
11 changes: 2 additions & 9 deletions src/components/ActionsBuilder/CallDetails/CallDetails.tsx
Expand Up @@ -4,8 +4,6 @@ import { BigNumber } from 'ethers';
import { Button } from 'components/primitives/Button';
import { Box } from 'components/primitives/Layout/Box';
import { Flex } from 'components/primitives/Layout/Flex';
import { UnstyledLink } from 'components/primitives/Links';
import { FiExternalLink } from 'react-icons/fi';
import { useTheme } from 'styled-components';
import { Divider } from 'components/Divider';
import { getSummaryView } from '../SupportedActions';
Expand All @@ -23,6 +21,7 @@ import { useTranslation } from 'react-i18next';
import { FunctionParamWithValue } from 'components/ActionsBuilder/SupportedActions/GenericCall/GenericCallInfoLine';
import { SupportedAction } from 'components/ActionsBuilder/types';
import { renderGenericCallParamValue } from 'components/ActionsBuilder/SupportedActions/GenericCall/GenericCallParamsMatcher';
import { BlockExplorerLink } from 'components/primitives/Links/BlockExplorerLink';

type Param = Partial<FunctionParamWithValue>;

Expand All @@ -39,13 +38,7 @@ function renderDefaultParamValue(param: Param) {
if (!param) return null;

if (param.type === 'address') {
return (
<UnstyledLink to="#">
<ParamDetail>
{param.value} <FiExternalLink size={16} />
</ParamDetail>
</UnstyledLink>
);
return <BlockExplorerLink address={param.value} unstyled />;
}

if (param.type.startsWith('uint') || param.type.startsWith('int')) {
Expand Down