diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a04cbd1..fd7dcdc47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -82,6 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Bug fixes +- [#305](https://github.com/alleslabs/celatone-frontend/pull/305) Fix UI avatar for validator not shown when encounter special chars - [#302](https://github.com/alleslabs/celatone-frontend/pull/302) Fix token card width, text size for unsupported token button in account details page and tx count color when equal to zero - [#300](https://github.com/alleslabs/celatone-frontend/pull/300) Fix search bar's placeholder text and remove separator in latest block height - [#290](https://github.com/alleslabs/celatone-frontend/pull/290) Fix spacing and styling in account detail diff --git a/src/lib/components/ValidatorBadge.tsx b/src/lib/components/ValidatorBadge.tsx index 7058fd905..c2463cb5e 100644 --- a/src/lib/components/ValidatorBadge.tsx +++ b/src/lib/components/ValidatorBadge.tsx @@ -5,6 +5,7 @@ import { useWallet } from "@cosmos-kit/react"; import { getChainApiPath } from "env"; import { ExplorerLink } from "lib/components/ExplorerLink"; import type { ValidatorInfo } from "lib/types"; +import { removeSpecialChars } from "lib/utils"; interface ValidatorBadgeProps { validator: ValidatorInfo | null; @@ -44,9 +45,9 @@ export const ValidatorBadge = ({ currentChainName )}/moniker/${validator.validatorAddress}.png`} alt={validator.moniker} - fallbackSrc={`https://ui-avatars.com/api/?name=${ + fallbackSrc={`https://ui-avatars.com/api/?name=${removeSpecialChars( validator.moniker ?? "" - }&background=9793F3&color=fff`} + )}&background=9793F3&color=fff`} borderRadius="50%" /> + text.replace(/[^a-zA-Z0-9]/g, "");