Skip to content

Commit

Permalink
fix(wallet, dashboard): use validator image when possible (#4247)
Browse files Browse the repository at this point in the history
* fix(wallet, dashboard): use validator image when possible

* fix: remove unnecessary change

* feat: add missing image in dashboard
  • Loading branch information
VmMad authored Nov 27, 2024
1 parent ea7499c commit c010a5d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function DetailsView({
<Card type={CardType.Filled}>
<CardImage>
<ImageIcon
src={null}
src={validatorSummary?.imageUrl ?? null}
label={validatorName}
fallback={validatorName}
size={ImageIconSize.Large}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export function Validator({
isSelected,
showAction = true,
}: ValidatorProps) {
const { name, newValidator, isAtRisk, apy, isApyApproxZero } = useValidatorInfo({
validatorAddress: address,
});
const { name, newValidator, isAtRisk, apy, isApyApproxZero, validatorSummary } =
useValidatorInfo({
validatorAddress: address,
});

const subtitle = showActiveStatus ? (
<div className="flex items-center gap-1">
Expand All @@ -47,7 +48,12 @@ export function Validator({
return (
<Card type={isSelected ? CardType.Filled : CardType.Default} onClick={handleClick}>
<CardImage>
<ImageIcon src={null} label={name} fallback={name} size={ImageIconSize.Large} />
<ImageIcon
src={validatorSummary?.imageUrl ?? null}
label={name}
fallback={name}
size={ImageIconSize.Large}
/>
</CardImage>
<CardBody title={name} subtitle={subtitle} isTextTruncated />
{showAction && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export function ValidatorLogo({
<Card type={type} onClick={onClick}>
<CardImage>
<ImageIcon
src={null}
src={validatorMeta?.imageUrl ?? null}
label={validatorName}
fallback={validatorName}
size={ImageIconSize.Large}
Expand Down

0 comments on commit c010a5d

Please sign in to comment.