From 3fa0b741376c4f480f06edbec6a26c9ed63d8ab6 Mon Sep 17 00:00:00 2001 From: Agustin Pane Date: Fri, 30 Oct 2020 16:25:04 -0300 Subject: [PATCH] (Feature) - #1541 etherscan on ewc (#1544) * Replaces old EtherscanBtn with ExplorerButton from safe components * Remove default exports Fix typo un etherscanLink name import * Replaces EtherscanBtn with ExplorerButton * Remove etherscanButton component --- src/components/AddressInfo/index.tsx | 6 +- src/components/App/ReceiveModal.tsx | 6 +- .../EtherscanBtn/img/etherscan-open.svg | 6 -- src/components/EtherscanBtn/index.tsx | 59 ------------------- src/components/EtherscanLink/index.tsx | 9 ++- .../load/components/OwnerList/index.tsx | 5 +- .../components/ReviewInformation/index.tsx | 7 ++- .../components/ReviewInformation/index.tsx | 6 +- .../ReviewCustomTx/index.tsx | 6 +- .../SendCustomTx/index.tsx | 6 +- .../screens/ReviewCollectible/index.tsx | 6 +- .../SendModal/screens/ReviewTx/index.tsx | 6 +- .../screens/SendCollectible/index.tsx | 5 +- .../SendModal/screens/SendFunds/index.tsx | 6 +- .../AddOwnerModal/screens/Review/index.tsx | 8 +-- .../ManageOwners/EditOwnerModal/index.tsx | 5 +- .../OwnerAddressTableCell/index.tsx | 4 +- .../screens/CheckOwner/index.tsx | 5 +- .../RemoveOwnerModal/screens/Review/index.tsx | 8 +-- .../screens/OwnerForm/index.tsx | 5 +- .../screens/Review/index.tsx | 10 ++-- .../IncomingTxDescription/index.tsx | 2 +- .../TxDescription/SettingsDescription.tsx | 2 +- .../TxDescription/TransferDescription.tsx | 2 +- 24 files changed, 65 insertions(+), 125 deletions(-) delete mode 100644 src/components/EtherscanBtn/img/etherscan-open.svg delete mode 100644 src/components/EtherscanBtn/index.tsx diff --git a/src/components/AddressInfo/index.tsx b/src/components/AddressInfo/index.tsx index 0e618a2a..8e08f2b7 100644 --- a/src/components/AddressInfo/index.tsx +++ b/src/components/AddressInfo/index.tsx @@ -1,13 +1,13 @@ import React from 'react' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Bold from 'src/components/layout/Bold' import Paragraph from 'src/components/layout/Paragraph' import { border, xs } from 'src/theme/variables' import styled from 'styled-components' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const Wrapper = styled.div` display: flex; @@ -61,7 +61,7 @@ const AddressInfo = ({ ethBalance, safeAddress, safeName }: Props): React.ReactE {safeAddress} - + {ethBalance && ( diff --git a/src/components/App/ReceiveModal.tsx b/src/components/App/ReceiveModal.tsx index 143b05ba..0574c485 100644 --- a/src/components/App/ReceiveModal.tsx +++ b/src/components/App/ReceiveModal.tsx @@ -5,7 +5,6 @@ import QRCode from 'qrcode.react' import React, { ReactElement } from 'react' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -15,7 +14,8 @@ import Paragraph from 'src/components/layout/Paragraph' import Row from 'src/components/layout/Row' import { border, fontColor, lg, md, screenSm, secondaryText, sm } from 'src/theme/variables' import { copyToClipboard } from 'src/utils/clipboard' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const networkInfo = getNetworkInfo() const useStyles = makeStyles( @@ -126,7 +126,7 @@ const ReceiveModal = ({ onClose, safeAddress, safeName }: Props): ReactElement = {safeAddress} - + diff --git a/src/components/EtherscanBtn/img/etherscan-open.svg b/src/components/EtherscanBtn/img/etherscan-open.svg deleted file mode 100644 index 8ead5fe1..00000000 --- a/src/components/EtherscanBtn/img/etherscan-open.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/components/EtherscanBtn/index.tsx b/src/components/EtherscanBtn/index.tsx deleted file mode 100644 index f7609489..00000000 --- a/src/components/EtherscanBtn/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import Tooltip from '@material-ui/core/Tooltip' -import { makeStyles } from '@material-ui/core/styles' -import cn from 'classnames' -import React from 'react' - -import EtherscanOpenIcon from './img/etherscan-open.svg' - -import Img from 'src/components/layout/Img' -import { xs } from 'src/theme/variables' -import { getExplorerInfo } from 'src/config' - -const useStyles = makeStyles({ - container: { - alignItems: 'center', - borderRadius: '50%', - display: 'flex', - justifyContent: 'center', - margin: `0 ${xs}`, - padding: '0', - transition: 'background-color .2s ease-in-out', - '&:hover': { - backgroundColor: '#F0EFEE', - }, - }, - increasedPopperZindex: { - zIndex: 2001, - }, -}) - -interface EtherscanBtnProps { - className?: string - increaseZindex?: boolean - value: string -} - -const EtherscanBtn = ({ className = '', increaseZindex = false, value }: EtherscanBtnProps): React.ReactElement => { - const classes = useStyles() - const customClasses = increaseZindex ? { popper: classes.increasedPopperZindex } : {} - - const explorerInfo = getExplorerInfo(value) - const { url } = explorerInfo() - - return ( - - event.stopPropagation()} - href={url} - rel="noopener noreferrer" - target="_blank" - > - Show on Etherscan - - - ) -} - -export default EtherscanBtn diff --git a/src/components/EtherscanLink/index.tsx b/src/components/EtherscanLink/index.tsx index e37beeef..ea4dec04 100644 --- a/src/components/EtherscanLink/index.tsx +++ b/src/components/EtherscanLink/index.tsx @@ -5,11 +5,12 @@ import React from 'react' import { styles } from './style' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Block from 'src/components/layout/Block' import Span from 'src/components/layout/Span' import { shortVersionOf } from 'src/logic/wallets/ethAddresses' import EllipsisTransactionDetails from 'src/routes/safe/components/AddressBook/EllipsisTransactionDetails' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' +import { getExplorerInfo } from 'src/config' const useStyles = makeStyles(styles) @@ -20,7 +21,7 @@ interface EtherscanLinkProps { value: string } -const EtherscanLink = ({ className, cut, knownAddress, value }: EtherscanLinkProps): React.ReactElement => { +export const EtherscanLink = ({ className, cut, knownAddress, value }: EtherscanLinkProps): React.ReactElement => { const classes = useStyles() return ( @@ -29,10 +30,8 @@ const EtherscanLink = ({ className, cut, knownAddress, value }: EtherscanLinkPro {cut ? shortVersionOf(value, cut) : value} - + {knownAddress !== undefined ? : null} ) } - -export default EtherscanLink diff --git a/src/routes/load/components/OwnerList/index.tsx b/src/routes/load/components/OwnerList/index.tsx index ab34fa7d..d6f6fc74 100644 --- a/src/routes/load/components/OwnerList/index.tsx +++ b/src/routes/load/components/OwnerList/index.tsx @@ -5,7 +5,6 @@ import React, { useEffect, useState } from 'react' import { useSelector } from 'react-redux' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Field from 'src/components/forms/Field' import TextField from 'src/components/forms/TextField' import { composeValidators, minMaxLength, required } from 'src/components/forms/validator' @@ -24,6 +23,8 @@ import { getGnosisSafeInstanceAt } from 'src/logic/contracts/safeContracts' import { FIELD_LOAD_ADDRESS, THRESHOLD } from 'src/routes/load/components/fields' import { getOwnerAddressBy, getOwnerNameBy } from 'src/routes/open/components/fields' import { styles } from './styles' +import { getExplorerInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const calculateSafeValues = (owners, threshold, values) => { const initialValues = { ...values } @@ -112,7 +113,7 @@ const OwnerListComponent = (props) => { {address} - + diff --git a/src/routes/load/components/ReviewInformation/index.tsx b/src/routes/load/components/ReviewInformation/index.tsx index 2c5ba075..edf41823 100644 --- a/src/routes/load/components/ReviewInformation/index.tsx +++ b/src/routes/load/components/ReviewInformation/index.tsx @@ -3,7 +3,6 @@ import classNames from 'classnames' import React from 'react' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Col from 'src/components/layout/Col' @@ -16,6 +15,8 @@ import { FIELD_LOAD_ADDRESS, FIELD_LOAD_NAME, THRESHOLD } from 'src/routes/load/ import { getNumOwnersFrom, getOwnerAddressBy, getOwnerNameBy } from 'src/routes/open/components/fields' import { getAccountsFrom } from 'src/routes/open/utils/safeDataExtractor' import { useStyles } from './styles' +import { getExplorerInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const checkIfUserAddressIsAnOwner = (values: Record, userAddress: string): boolean => { let isOwner = false @@ -76,7 +77,7 @@ const ReviewComponent = ({ userAddress, values }: Props): React.ReactElement => {shortVersionOf(safeAddress, 4)} - + @@ -121,7 +122,7 @@ const ReviewComponent = ({ userAddress, values }: Props): React.ReactElement => {address} - + diff --git a/src/routes/open/components/ReviewInformation/index.tsx b/src/routes/open/components/ReviewInformation/index.tsx index 4c901b40..1efc0057 100644 --- a/src/routes/open/components/ReviewInformation/index.tsx +++ b/src/routes/open/components/ReviewInformation/index.tsx @@ -2,9 +2,8 @@ import TableContainer from '@material-ui/core/TableContainer' import classNames from 'classnames' import React, { useEffect, useState } from 'react' import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Col from 'src/components/layout/Col' @@ -18,6 +17,7 @@ import { getAccountsFrom, getNamesFrom } from 'src/routes/open/utils/safeDataExt import { FIELD_CONFIRMATIONS, FIELD_NAME, getNumOwnersFrom } from '../fields' import { useStyles } from './styles' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' type ReviewComponentProps = { userAccount: string @@ -118,7 +118,7 @@ const ReviewComponent = ({ userAccount, values }: ReviewComponentProps) => { {addresses[index]} - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx index bbe1d84c..2512c69e 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/ReviewCustomTx/index.tsx @@ -4,10 +4,9 @@ import IconButton from '@material-ui/core/IconButton' import { makeStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import { fromTokenUnit, toTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -29,6 +28,7 @@ import { sm } from 'src/theme/variables' import ArrowDown from '../../assets/arrow-down.svg' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export type CustomTx = { contractAddress?: string @@ -132,7 +132,7 @@ const ReviewCustomTx = ({ onClose, onPrev, tx }: Props): React.ReactElement => { {tx.contractAddress} - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx index 9b96d130..0a2751c0 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/SendCustomTx/index.tsx @@ -8,7 +8,6 @@ import Close from '@material-ui/icons/Close' import QRIcon from 'src/assets/icons/qrcode.svg' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Field from 'src/components/forms/Field' import GnoForm from 'src/components/forms/GnoForm' import TextareaField from 'src/components/forms/TextareaField' @@ -32,7 +31,8 @@ import { sm } from 'src/theme/variables' import ArrowDown from '../../assets/arrow-down.svg' import { styles } from './style' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export interface CreatedTx { contractAddress: string @@ -184,7 +184,7 @@ const SendCustomTx: React.FC = ({ initialValues, onClose, onNext, contrac - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx index d073fd57..26ed380a 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx @@ -5,9 +5,8 @@ import { makeStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -32,6 +31,7 @@ import { textShortener } from 'src/utils/strings' import ArrowDown from '../assets/arrow-down.svg' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const { nativeCoin } = getNetworkInfo() @@ -153,7 +153,7 @@ const ReviewCollectible = ({ onClose, onPrev, tx }: Props): React.ReactElement = {tx.recipientAddress} - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx index 81a48eb7..049121c8 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewTx/index.tsx @@ -5,10 +5,9 @@ import { BigNumber } from 'bignumber.js' import React, { useEffect, useMemo, useState } from 'react' import { useDispatch, useSelector } from 'react-redux' import { toTokenUnit, fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -32,6 +31,7 @@ import { sm } from 'src/theme/variables' import ArrowDown from '../assets/arrow-down.svg' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const useStyles = makeStyles(styles) @@ -162,7 +162,7 @@ const ReviewTx = ({ onClose, onPrev, tx }: ReviewTxProps): React.ReactElement => {tx.recipientAddress} - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx index 2bbb17fa..9af42f79 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendCollectible/index.tsx @@ -5,7 +5,6 @@ import React, { useState } from 'react' import { useSelector } from 'react-redux' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import GnoForm from 'src/components/forms/GnoForm' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' @@ -29,6 +28,8 @@ import ArrowDown from '../assets/arrow-down.svg' import { styles } from './style' import { NFTToken } from 'src/logic/collectibles/sources/collectibles' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' +import { getExplorerInfo } from 'src/config' const formMutators = { setMax: (args, state, utils) => { @@ -187,7 +188,7 @@ const SendCollectible = ({ - + diff --git a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx index 92d34615..8d11b552 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx +++ b/src/routes/safe/components/Balances/SendModal/screens/SendFunds/index.tsx @@ -2,13 +2,12 @@ import IconButton from '@material-ui/core/IconButton' import InputAdornment from '@material-ui/core/InputAdornment' import { makeStyles } from '@material-ui/core/styles' import Close from '@material-ui/icons/Close' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import React, { useState } from 'react' import { OnChange } from 'react-final-form-listeners' import { useSelector } from 'react-redux' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Field from 'src/components/forms/Field' import GnoForm from 'src/components/forms/GnoForm' import TextField from 'src/components/forms/TextField' @@ -34,6 +33,7 @@ import { sm } from 'src/theme/variables' import ArrowDown from '../assets/arrow-down.svg' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' const formMutators = { setMax: (args, state, utils) => { @@ -189,7 +189,7 @@ const SendFunds = ({ - + diff --git a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.tsx b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.tsx index 1721a983..2b74e8b0 100644 --- a/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/AddOwnerModal/screens/Review/index.tsx @@ -5,9 +5,8 @@ import classNames from 'classnames' import React, { useEffect, useState } from 'react' import { useSelector } from 'react-redux' import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -21,6 +20,7 @@ import { estimateTxGasCosts } from 'src/logic/safe/transactions/gas' import { formatAmount } from 'src/logic/tokens/utils/formatAmount' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export const ADD_OWNER_SUBMIT_BTN_TEST_ID = 'add-owner-submit-btn' @@ -118,7 +118,7 @@ const ReviewAddOwner = ({ classes, onClickBack, onClose, onSubmit, values }) => {owner.address} - + @@ -146,7 +146,7 @@ const ReviewAddOwner = ({ classes, onClickBack, onClose, onSubmit, values }) => {values.ownerAddress} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.tsx b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.tsx index 6d750aed..0d8b33bb 100644 --- a/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/EditOwnerModal/index.tsx @@ -5,7 +5,6 @@ import React from 'react' import { useDispatch, useSelector } from 'react-redux' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Field from 'src/components/forms/Field' import GnoForm from 'src/components/forms/GnoForm' import TextField from 'src/components/forms/TextField' @@ -26,6 +25,8 @@ import { safeParamAddressFromStateSelector } from 'src/logic/safe/store/selector import { sm } from 'src/theme/variables' import { styles } from './style' +import { getExplorerInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export const RENAME_OWNER_INPUT_TEST_ID = 'rename-owner-input' export const SAVE_OWNER_CHANGES_BTN_TEST_ID = 'save-owner-changes-btn' @@ -93,7 +94,7 @@ const EditOwnerComponent = ({ isOpen, onClose, ownerAddress, selectedOwnerName } {ownerAddress} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/OwnerAddressTableCell/index.tsx b/src/routes/safe/components/Settings/ManageOwners/OwnerAddressTableCell/index.tsx index 0caf445c..39220c64 100644 --- a/src/routes/safe/components/Settings/ManageOwners/OwnerAddressTableCell/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/OwnerAddressTableCell/index.tsx @@ -1,12 +1,12 @@ import * as React from 'react' import { useEffect, useState } from 'react' -import EtherScanLink from 'src/components/EtherscanLink' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Paragraph from 'src/components/layout/Paragraph' import { getValidAddressBookName } from 'src/logic/addressBook/utils' import { useWindowDimensions } from 'src/logic/hooks/useWindowDimensions' +import { EtherscanLink } from 'src/components/EtherscanLink' type OwnerAddressTableCellProps = { address: string @@ -36,7 +36,7 @@ const OwnerAddressTableCell = (props: OwnerAddressTableCellProps): React.ReactEl {showLinks ? (
{userName && getValidAddressBookName(userName)} - +
) : ( {address} diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.tsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.tsx index 3ab15c42..5ba7990d 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/CheckOwner/index.tsx @@ -5,7 +5,6 @@ import classNames from 'classnames/bind' import React from 'react' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -15,6 +14,8 @@ import Paragraph from 'src/components/layout/Paragraph' import Row from 'src/components/layout/Row' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' +import { getExplorerInfo } from 'src/config' export const REMOVE_OWNER_MODAL_NEXT_BTN_TEST_ID = 'remove-owner-next-btn' @@ -53,7 +54,7 @@ const CheckOwner = ({ classes, onClose, onSubmit, ownerAddress, ownerName }) => {ownerAddress} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.tsx b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.tsx index d7da610a..155840a1 100644 --- a/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/RemoveOwnerModal/screens/Review/index.tsx @@ -5,9 +5,8 @@ import classNames from 'classnames' import React, { useEffect, useState } from 'react' import { useSelector } from 'react-redux' import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -21,6 +20,7 @@ import { estimateTxGasCosts } from 'src/logic/safe/transactions/gas' import { formatAmount } from 'src/logic/tokens/utils/formatAmount' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export const REMOVE_OWNER_REVIEW_BTN_TEST_ID = 'remove-owner-review-btn' @@ -119,7 +119,7 @@ const ReviewRemoveOwner = ({ classes, onClickBack, onClose, onSubmit, ownerAddre {owner.address} - + @@ -148,7 +148,7 @@ const ReviewRemoveOwner = ({ classes, onClickBack, onClose, onSubmit, ownerAddre {ownerAddress} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.tsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.tsx index c808f411..932da2c5 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/OwnerForm/index.tsx @@ -6,7 +6,6 @@ import React from 'react' import { useSelector } from 'react-redux' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import AddressInput from 'src/components/forms/AddressInput' import Field from 'src/components/forms/Field' import GnoForm from 'src/components/forms/GnoForm' @@ -23,6 +22,8 @@ import { ScanQRWrapper } from 'src/components/ScanQRModal/ScanQRWrapper' import { safeOwnersSelector } from 'src/logic/safe/store/selectors' import { styles } from './style' +import { getExplorerInfo } from 'src/config' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export const REPLACE_OWNER_NAME_INPUT_TEST_ID = 'replace-owner-name-input' export const REPLACE_OWNER_ADDRESS_INPUT_TEST_ID = 'replace-owner-address-testid' @@ -94,7 +95,7 @@ const OwnerForm = ({ classes, onClose, onSubmit, ownerAddress, ownerName }) => { {ownerAddress} - + diff --git a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.tsx b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.tsx index 0611c275..607b3cfb 100644 --- a/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.tsx +++ b/src/routes/safe/components/Settings/ManageOwners/ReplaceOwnerModal/screens/Review/index.tsx @@ -5,9 +5,8 @@ import classNames from 'classnames' import React, { useEffect, useState } from 'react' import { useSelector } from 'react-redux' import { fromTokenUnit } from 'src/logic/tokens/utils/humanReadableValue' -import { getNetworkInfo } from 'src/config' +import { getExplorerInfo, getNetworkInfo } from 'src/config' import CopyBtn from 'src/components/CopyBtn' -import EtherscanBtn from 'src/components/EtherscanBtn' import Identicon from 'src/components/Identicon' import Block from 'src/components/layout/Block' import Button from 'src/components/layout/Button' @@ -26,6 +25,7 @@ import { estimateTxGasCosts } from 'src/logic/safe/transactions/gas' import { formatAmount } from 'src/logic/tokens/utils/formatAmount' import { styles } from './style' +import { ExplorerButton } from '@gnosis.pm/safe-react-components' export const REPLACE_OWNER_SUBMIT_BTN_TEST_ID = 'replace-owner-submit-btn' @@ -124,7 +124,7 @@ const ReviewRemoveOwner = ({ classes, onClickBack, onClose, onSubmit, ownerAddre {owner.address} - + @@ -153,7 +153,7 @@ const ReviewRemoveOwner = ({ classes, onClickBack, onClose, onSubmit, ownerAddre {ownerAddress} - + @@ -178,7 +178,7 @@ const ReviewRemoveOwner = ({ classes, onClickBack, onClose, onSubmit, ownerAddre {values.ownerAddress} - + diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/IncomingTxDescription/index.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/IncomingTxDescription/index.tsx index 532ce9ac..3243d867 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/IncomingTxDescription/index.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/IncomingTxDescription/index.tsx @@ -2,7 +2,7 @@ import { makeStyles } from '@material-ui/core/styles' import React from 'react' import { useSelector } from 'react-redux' -import EtherscanLink from 'src/components/EtherscanLink' +import { EtherscanLink } from 'src/components/EtherscanLink' import Block from 'src/components/layout/Block' import Bold from 'src/components/layout/Bold' import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors' diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx index ccaf06fe..43661075 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/SettingsDescription.tsx @@ -1,6 +1,6 @@ import React from 'react' import { useSelector } from 'react-redux' -import EtherscanLink from 'src/components/EtherscanLink' +import { EtherscanLink } from 'src/components/EtherscanLink' import Block from 'src/components/layout/Block' import Bold from 'src/components/layout/Bold' import Paragraph from 'src/components/layout/Paragraph' diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx index afc5f2c1..7d589d84 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/TransferDescription.tsx @@ -1,6 +1,6 @@ import React from 'react' import { useSelector } from 'react-redux' -import EtherscanLink from 'src/components/EtherscanLink' +import { EtherscanLink } from 'src/components/EtherscanLink' import Block from 'src/components/layout/Block' import Bold from 'src/components/layout/Bold' import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors'