Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: AddressInput identicon #2393

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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