diff --git a/package.json b/package.json index 4ecd3cc8a..ba9dd2fc5 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "@dicebear/core": "7.0.1", "@dicebear/personas": "7.0.1", "@emotion/is-prop-valid": "1.2.1", + "@ensdomains/ens-avatar": "1.0.0-alpha.0.ethers.6", "@ledgerhq/hw-app-eth": "6.35.2", "@ledgerhq/hw-transport": "6.30.1", "@ledgerhq/hw-transport-webauthn": "5.36.0-deprecated", diff --git a/src/app/components/blocks/ContactsDialog.tsx b/src/app/components/blocks/ContactsDialog.tsx index 5c72156cb..8e965070a 100644 --- a/src/app/components/blocks/ContactsDialog.tsx +++ b/src/app/components/blocks/ContactsDialog.tsx @@ -19,11 +19,11 @@ import { useContactsDialog } from "app/hooks/contacts"; import { useDialog } from "app/hooks/dialog"; import { useToast } from "app/hooks/toast"; import SecondaryModal from "app/components/elements/SecondaryModal"; -import AutoIcon from "app/components/elements/AutoIcon"; import Input from "app/components/elements/Input"; import AddressField from "app/components/elements/AddressField"; import Button from "app/components/elements/Button"; import { ReactComponent as AvatarPlaceholderIcon } from "app/icons/avatar-placeholder.svg"; +import WalletAvatar from "../elements/WalletAvatar"; type FormValues = { name: string; @@ -110,10 +110,8 @@ const ContactsDialog: FC = () => { )} > {address || values.address ? ( - ) : ( diff --git a/src/app/components/blocks/ContactsSection.tsx b/src/app/components/blocks/ContactsSection.tsx index 800c4153a..e1a0df694 100644 --- a/src/app/components/blocks/ContactsSection.tsx +++ b/src/app/components/blocks/ContactsSection.tsx @@ -16,13 +16,13 @@ import { useDialog } from "app/hooks/dialog"; import { useContacts, useContactsDialog } from "app/hooks/contacts"; import { ToastOverflowProvider, useToast } from "app/hooks/toast"; import SearchInput from "app/components/elements/SearchInput"; -import AutoIcon from "app/components/elements/AutoIcon"; import HashPreview from "app/components/elements/HashPreview"; import ScrollAreaContainer from "app/components/elements/ScrollAreaContainer"; import { ReactComponent as AddWalletIcon } from "app/icons/add-wallet.svg"; import { ReactComponent as DeleteIcon } from "app/icons/delete-medium.svg"; import { ReactComponent as EditIcon } from "app/icons/edit-medium.svg"; import { ReactComponent as NoResultsFoundIcon } from "app/icons/no-results-found.svg"; +import WalletAvatar from "../elements/WalletAvatar"; const ContactsSection: FC = () => { const { confirm } = useDialog(); @@ -212,10 +212,8 @@ const ContactCard = forwardRef( )} >
- = ({ address, className }) => { className, )} > - = ({ onClick={onClick} autoFocus={active} > - = ({ account, signing }) => ( "text-left", )} > - ( ({ address, baseAsset, quoteAsset }) => (
- +
diff --git a/src/app/components/elements/AccountSelect.tsx b/src/app/components/elements/AccountSelect.tsx index 53dca6dd2..905414d6f 100644 --- a/src/app/components/elements/AccountSelect.tsx +++ b/src/app/components/elements/AccountSelect.tsx @@ -21,7 +21,6 @@ import { ReactComponent as GasIcon } from "app/icons/gas.svg"; import { ReactComponent as AddWalletIcon } from "app/icons/add-wallet.svg"; import Select from "./Select"; -import AutoIcon from "./AutoIcon"; import HashPreview from "./HashPreview"; import Balance from "./Balance"; import CopiableTooltip from "./CopiableTooltip"; @@ -29,6 +28,7 @@ import WalletName from "./WalletName"; import SmartLink from "./SmartLink"; import Avatar from "./Avatar"; import IconedButton from "./IconedButton"; +import WalletAvatar from "./WalletAvatar"; type AccountSelectProps = { className?: string; @@ -147,10 +147,8 @@ const CurrentAccount: FC = ({ account }) => { return ( - - {isSelected && ( diff --git a/src/app/components/elements/ContactAutocomplete.tsx b/src/app/components/elements/ContactAutocomplete.tsx index 71f5e34a4..baa161694 100644 --- a/src/app/components/elements/ContactAutocomplete.tsx +++ b/src/app/components/elements/ContactAutocomplete.tsx @@ -26,13 +26,13 @@ import { LOAD_MORE_ON_CONTACTS_DROPDOWN_FROM_END, } from "app/defaults"; import { useContacts } from "app/hooks/contacts"; -import { useAccounts } from "app/hooks"; +import { useAccounts, useEns } from "app/hooks"; import ScrollAreaContainer from "./ScrollAreaContainer"; import AddressField, { AddressFieldProps } from "./AddressField"; -import AutoIcon from "./AutoIcon"; import WalletName from "./WalletName"; import HashPreview from "./HashPreview"; import SmallContactCard from "./SmallContactCard"; +import WalletAvatar from "./WalletAvatar"; type ContactAutocompleteProps = { meta: FieldMetaState; @@ -117,6 +117,7 @@ const ContactAutocomplete = forwardRef< e.preventDefault(); } } + rest.onKeyDown?.(e); }, [mergedAccounts, rest, activeSuggestion, setValue], @@ -158,6 +159,12 @@ const ContactAutocomplete = forwardRef< const { paste } = usePasteFromClipboard(setValue); + const { getAddressByEns, watchEns } = useEns(); + + useEffect(() => { + watchEns(value, setValue); + }, [value, setValue, getAddressByEns, watchEns]); + const pasteButton = useMemo(() => { return (