Skip to content

Commit

Permalink
Fix: AddressInput identicon (#2393)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Aug 14, 2023
1 parent a824270 commit 085aebc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/common/AddressInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import SaveAddressIcon from '@/public/images/common/save-address.svg'
import classnames from 'classnames'
import css from './styles.module.css'
import inputCss from '@/styles/inputs.module.css'
import Identicon from '../Identicon'

export type AddressInputProps = TextFieldProps & {
name: string
Expand Down Expand Up @@ -128,8 +129,13 @@ const AddressInput = ({

// Display the current short name in the adornment, unless the value contains the same prefix
startAdornment: (
<InputAdornment position="end" sx={{ ml: 0 }}>
<Skeleton variant="circular" width={32} height={32} animation={false} sx={{ marginRight: '0.5em' }} />
<InputAdornment position="end" sx={{ ml: 0, gap: 1 }}>
{watchedValue && !fieldError ? (
<Identicon address={watchedValue} size={32} />
) : (
<Skeleton variant="circular" width={32} height={32} animation={false} />
)}

{!rawValueRef.current.startsWith(`${currentShortName}:`) && <>{currentShortName}:</>}
</InputAdornment>
),
Expand Down

0 comments on commit 085aebc

Please sign in to comment.