Skip to content

Commit

Permalink
Default avatar size
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh committed Aug 23, 2023
1 parent 6d54282 commit 18882d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions src/components/common/EthHashInfo/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,15 @@ describe('EthHashInfo', () => {

describe('name', () => {
it('renders a name by default', () => {
const { queryByText } = render(<EthHashInfo address={MOCK_SAFE_ADDRESS} name="Test" />)
const { queryByText } = render(<EthHashInfo address="0x1234" name="Test name" />)

expect(queryByText('Test')).toBeInTheDocument()
expect(queryByText('Test name')).toBeInTheDocument()
})

it('renders a name from the address book even if a name is passed', () => {
const { queryByText } = render(<EthHashInfo address={MOCK_SAFE_ADDRESS} name="Fallback name" />)

expect(queryByText('Address book name')).toBeInTheDocument()
})

it('renders a name from the address book', () => {
Expand All @@ -173,7 +179,7 @@ describe('EthHashInfo', () => {

expect(container.querySelector('.icon')).toHaveAttribute(
'style',
`background-image: url(${makeBlockie(MOCK_SAFE_ADDRESS)}); width: 44px; height: 44px;`,
`background-image: url(${makeBlockie(MOCK_SAFE_ADDRESS)}); width: 40px; height: 40px;`,
)
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/common/EthHashInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import useSafeAddress from '@/hooks/useSafeAddress'

const EthHashInfo = ({
showName = true,
avatarSize = 44,
avatarSize = 40,
...props
}: EthHashInfoProps & { showName?: boolean }): ReactElement => {
const settings = useAppSelector(selectSettings)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const TransferTxInfo = ({ txInfo, txStatus }: TransferTxInfoProps) => {
shortAddress={false}
hasExplorer
showCopyButton
avatarSize={44}
>
<TransferActions address={address.value} txInfo={txInfo} />
</EthHashInfo>
Expand Down

0 comments on commit 18882d0

Please sign in to comment.