Skip to content

Commit

Permalink
Remove variation argument
Browse files Browse the repository at this point in the history
Fix unit test.
Fix storybook.
  • Loading branch information
matthewwalsh0 committed Mar 13, 2024
1 parent 1241336 commit 0dc6096
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions ui/components/ui/identicon/identicon.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export default class Identicon extends Component {
* User preferred IPFS gateway
*/
ipfsGateway: PropTypes.string,
/**
* Watched NFT contract data keyed by address
*/
watchedNftContracts: PropTypes.object,
};

Expand All @@ -73,6 +76,7 @@ export default class Identicon extends Component {
useBlockie: false,
alt: '',
tokenList: {},
watchedNftContracts: {},
};

renderImage() {
Expand Down
1 change: 1 addition & 0 deletions ui/components/ui/identicon/identicon.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default {
imageBorder: { control: 'boolean' },
useTokenDetection: { control: 'boolean' },
tokenList: { control: 'object' },
watchedNftContracts: { control: 'object' },
},
};

Expand Down
10 changes: 2 additions & 8 deletions ui/hooks/useDisplayName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,17 @@ import { useFirstPartyContractName } from './useFirstPartyContractName';
*
* @param value
* @param type
* @param variation
* @returns An object with two properties:
* - `name` {string|null} - The display name, if it can be resolved, otherwise null.
* - `hasPetname` {boolean} - True if there is a petname for the given address.
*/
export function useDisplayName(
value: string,
type: NameType,
variation?: string,
): { name: string | null; hasPetname: boolean } {
const nameEntry = useName(value, type, variation);
const nameEntry = useName(value, type);

const firstPartyContractName = useFirstPartyContractName(
value,
type,
variation,
);
const firstPartyContractName = useFirstPartyContractName(value, type);

const contractName = useSelector((state) =>
(getMemoizedMetadataContractName as any)(state, value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jest.mock('react-redux', () => ({
}));

jest.mock('../../../../../selectors', () => ({
...jest.requireActual('../../../../../selectors'),
getAddressBook: (s) => [{ name: `mockAddressBook:${s}` }],
getAddressBookEntry: (s) => `mockAddressBookEntry:${s}`,
getInternalAccountsSortedByKeyring: () => [
Expand Down

0 comments on commit 0dc6096

Please sign in to comment.