diff --git a/src/routes/safe/components/AddressBook/EllipsisTransactionDetails/index.tsx b/src/routes/safe/components/AddressBook/EllipsisTransactionDetails/index.tsx
index c9a3a386..b7dd5250 100644
--- a/src/routes/safe/components/AddressBook/EllipsisTransactionDetails/index.tsx
+++ b/src/routes/safe/components/AddressBook/EllipsisTransactionDetails/index.tsx
@@ -7,6 +7,9 @@ import { push } from 'connected-react-router'
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
+import { sameString } from 'src/utils/strings'
+import { ADDRESS_BOOK_DEFAULT_NAME } from 'src/logic/addressBook/model/addressBook'
+import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors'
import { SAFELIST_ADDRESS } from 'src/routes/routes'
import { safeParamAddressFromStateSelector } from 'src/logic/safe/store/selectors'
import { xs } from 'src/theme/variables'
@@ -35,13 +38,11 @@ const useStyles = makeStyles(
type EllipsisTransactionDetailsProps = {
address: string
- knownAddress?: boolean
sendModalOpenHandler?: () => void
}
export const EllipsisTransactionDetails = ({
address,
- knownAddress,
sendModalOpenHandler,
}: EllipsisTransactionDetailsProps): React.ReactElement => {
const classes = useStyles()
@@ -51,6 +52,10 @@ export const EllipsisTransactionDetails = ({
const currentSafeAddress = useSelector(safeParamAddressFromStateSelector)
const isOwnerConnected = useSelector(grantedSelector)
+ const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, { address }))
+ // We have to check that the name returned is not UNKNOWN
+ const isStoredInAddressBook = !sameString(recipientName, ADDRESS_BOOK_DEFAULT_NAME)
+
const handleClick = (event) => setAnchorEl(event.currentTarget)
const closeMenuHandler = () => setAnchorEl(null)
@@ -73,7 +78,7 @@ export const EllipsisTransactionDetails = ({
,
]
: null}
- {knownAddress ? (
+ {isStoredInAddressBook ? (
) : (
diff --git a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx
index 37205482..1609b8da 100644
--- a/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx
+++ b/src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/Review/index.tsx
@@ -27,6 +27,7 @@ import {
getValueFromTxInputs,
} from 'src/routes/safe/components/Balances/SendModal/screens/ContractInteraction/utils'
import { useEstimateTransactionGas, EstimationStatus } from 'src/logic/hooks/useEstimateTransactionGas'
+import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors'
import { useEstimationStatus } from 'src/logic/hooks/useEstimationStatus'
import { ButtonStatus, Modal } from 'src/components/Modal'
import { TransactionFees } from 'src/components/TransactionsFees'
@@ -60,6 +61,9 @@ const ContractInteractionReview = ({ onClose, onPrev, tx }: Props): React.ReactE
const [manualSafeTxGas, setManualSafeTxGas] = useState(0)
const [manualGasPrice, setManualGasPrice] = useState()
const [manualGasLimit, setManualGasLimit] = useState()
+ const addressName = useSelector((state) =>
+ getNameFromAddressBookSelector(state, { address: tx.contractAddress as string }),
+ )
const [txInfo, setTxInfo] = useState<{
txRecipient: string
@@ -154,7 +158,13 @@ const ContractInteractionReview = ({ onClose, onPrev, tx }: Props): React.ReactE
-
+
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 29018978..6a4237cf 100644
--- a/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx
+++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewCollectible/index.tsx
@@ -35,6 +35,7 @@ const useStyles = makeStyles(styles)
export type CollectibleTx = {
recipientAddress: string
+ recipientName?: string
assetAddress: string
assetName: string
nftTokenId: string
@@ -177,6 +178,7 @@ const ReviewCollectible = ({ onClose, onPrev, tx }: Props): React.ReactElement =
{
{
const ownerName = useSelector((state) => getNameFromAddressBookSelector(state, { address }))
@@ -11,7 +13,7 @@ export const OwnerRow = ({ address }: { address: string }): ReactElement => {
return (
{
- const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, { address }))
- const knownAddress = recipientName !== 'UNKNOWN'
-
const { txLocation } = useContext(TxLocationContext)
const canRepeatTransaction =
// is transfer type by context
@@ -89,7 +84,6 @@ export const TxInfoDetails = ({
diff --git a/src/routes/safe/components/Transactions/TxList/hooks/useKnownAddress.ts b/src/routes/safe/components/Transactions/TxList/hooks/useKnownAddress.ts
index 31530a0a..1a08832b 100644
--- a/src/routes/safe/components/Transactions/TxList/hooks/useKnownAddress.ts
+++ b/src/routes/safe/components/Transactions/TxList/hooks/useKnownAddress.ts
@@ -1,5 +1,7 @@
import { useSelector } from 'react-redux'
+import { sameString } from 'src/utils/strings'
+import { ADDRESS_BOOK_DEFAULT_NAME } from 'src/logic/addressBook/model/addressBook'
import { getNameFromAddressBookSelector } from 'src/logic/addressBook/store/selectors'
type AddressInfo = { name: string | undefined; image: string | undefined }
@@ -8,8 +10,8 @@ type UseKnownAddressResponse = AddressInfo & { isAddressBook: boolean }
export const useKnownAddress = (address: string, addressInfo: AddressInfo): UseKnownAddressResponse => {
const recipientName = useSelector((state) => getNameFromAddressBookSelector(state, { address }))
-
- const isInAddressBook = recipientName !== 'UNKNOWN'
+ // We have to check that the name returned is not UNKNOWN
+ const isInAddressBook = !sameString(recipientName, ADDRESS_BOOK_DEFAULT_NAME)
return isInAddressBook
? {