From 381df06b689038b26650bfe0601b7610b34b9514 Mon Sep 17 00:00:00 2001 From: Radu Mojic Date: Thu, 22 Feb 2024 13:40:39 +0200 Subject: [PATCH] updated provider details --- src/assets/scss/_shared-styles.scss | 2 +- .../IdentityAvatar/IdentityAvatar.tsx | 24 ++------ .../ProviderDetails/ProviderDetails.tsx | 55 +++++++++++-------- .../ProviderDetails/ProviderImage.tsx | 21 ------- 4 files changed, 40 insertions(+), 62 deletions(-) delete mode 100644 src/pages/AccountDetails/AccountStaking/components/ProviderDetails/ProviderImage.tsx diff --git a/src/assets/scss/_shared-styles.scss b/src/assets/scss/_shared-styles.scss index d053000a2..4354eed8a 100644 --- a/src/assets/scss/_shared-styles.scss +++ b/src/assets/scss/_shared-styles.scss @@ -224,7 +224,7 @@ max-width: 15rem; } @include media-breakpoint-up(xl) { - max-width: 36rem; + max-width: 30rem; } } diff --git a/src/components/SharedIdentity/IdentityAvatar/IdentityAvatar.tsx b/src/components/SharedIdentity/IdentityAvatar/IdentityAvatar.tsx index 1441bd5a8..d3919e8a1 100644 --- a/src/components/SharedIdentity/IdentityAvatar/IdentityAvatar.tsx +++ b/src/components/SharedIdentity/IdentityAvatar/IdentityAvatar.tsx @@ -1,5 +1,4 @@ -import { ReactComponent as DefaultAvatar } from 'assets/img/default-avatar.svg'; - +import { PLACEHOLDER_IMAGE_PATH } from 'appConstants'; import { ImageWithFallback } from 'components'; interface IdentityAvatarType { @@ -14,21 +13,10 @@ export const IdentityAvatar = ({ identity: IdentityAvatarType; }) => { return ( - <> - {identity.avatar ? ( - - ) : ( - - )} - + ); }; diff --git a/src/pages/AccountDetails/AccountStaking/components/ProviderDetails/ProviderDetails.tsx b/src/pages/AccountDetails/AccountStaking/components/ProviderDetails/ProviderDetails.tsx index 0cceccbaa..3bddd64c9 100644 --- a/src/pages/AccountDetails/AccountStaking/components/ProviderDetails/ProviderDetails.tsx +++ b/src/pages/AccountDetails/AccountStaking/components/ProviderDetails/ProviderDetails.tsx @@ -1,21 +1,44 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import BigNumber from 'bignumber.js'; -import { OverlayTrigger, Tooltip } from 'react-bootstrap'; -import { Trim, PercentageLed, NetworkLink } from 'components'; -import { getPercentage, stringIsFloat, urlBuilder } from 'helpers'; +import { PLACEHOLDER_IMAGE_PATH } from 'appConstants'; +import { + Trim, + PercentageLed, + NetworkLink, + ImageWithFallback, + Overlay +} from 'components'; +import { + getPercentage, + stringIsFloat, + urlBuilder, + getValidLink +} from 'helpers'; import { faExternalLink, faLeaf, faReceipt, faInfinity } from 'icons/regular'; import { faBadgeCheck } from 'icons/solid'; import { ProviderType } from 'types'; -import { ProviderImage } from './ProviderImage'; const minDelegation = '1000000000000000000'; export const ProviderDetails = ({ provider }: { provider: ProviderType }) => { + if (!provider) { + return null; + } + + const websiteLink = getValidLink({ + link: provider?.identityDetails?.website + }); + return provider ? (
- +
{ )} - {provider.featured && ( - ( - - Verified - - )} - > + - + )}
- {provider?.identityDetails?.website && ( + {websiteLink && ( { e.stopPropagation(); }} > - {provider.identityDetails.website.replace('http://', 'https://')} + {websiteLink} ( -
- {provider?.identityDetails?.avatar ? ( - {provider?.identityDetails?.name - ) : ( - - )} -
-);