Skip to content

Commit

Permalink
Chary/validator profile fix (#1198)
Browse files Browse the repository at this point in the history
* fix witval validator issue

* fix totaldelegations and delegator fix

* fix lint issues
  • Loading branch information
charymalloju authored Mar 15, 2024
1 parent 37be1e7 commit df5f692
Showing 1 changed file with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,37 @@ const ValidatorProfile = ({ moniker }: { moniker: string }) => {
const tabs = ['Profile', 'Announcements', 'Inbox', 'Notices'];
const selectedTab = 'profile';
useInitAllValidator();
const { getChainwiseValidatorInfo, getValidatorStats } =
const { getChainwiseValidatorInfo,
getOasisValidatorInfo,
getPolygonValidatorInfo, getValidatorStats } =
useGetValidatorInfo();
const {
chainWiseValidatorData,
validatorDescription,
validatorIdentity,
validatorWebsite,
} = getChainwiseValidatorInfo({ moniker });
const {
totalDelegators,
totalStaked,
avgCommission,
activeNetworks,
totalNetworks,
} = getValidatorStats({

const validatorStatsResult = getValidatorStats({
data: chainWiseValidatorData,
moniker: moniker,
});

const { avgCommission,
activeNetworks,
totalNetworks } = validatorStatsResult;

let { totalDelegators,
totalStaked, } = validatorStatsResult

const { totalStakedInUSD: totalPolygonStaked, totalDelegators: totalPolygonDelegators } = getPolygonValidatorInfo()
const { totalStakedInUSD: totalOasisStaked, totalDelegators: totalOasisDelegator } = getOasisValidatorInfo()

totalStaked += totalPolygonStaked || 0
totalStaked += totalOasisStaked || 0
totalDelegators += totalPolygonDelegators
totalDelegators += totalOasisDelegator

return (
<div className="py-6 px-10 space-y-10 h-screen flex flex-col">
<div className="space-y-10">
Expand Down Expand Up @@ -121,8 +133,8 @@ const ValidatorMetadataCard = ({
<div className="space-y-2">
<div className="text-[#FFFFFF80] text-[14px]">Description</div>
<div className="text-[16px] leading-[30px]">{
moniker.toLowerCase() === WITVAL?
'Vitwit excels in providing top-notch infrastructure services for the Cosmos blockchain ecosystem. We specialize in setting up and managing validators, relayers, and offering expert advisory services.':description || '-'}</div>
moniker.toLowerCase() === WITVAL ?
'Vitwit excels in providing top-notch infrastructure services for the Cosmos blockchain ecosystem. We specialize in setting up and managing validators, relayers, and offering expert advisory services.' : description || '-'}</div>
</div>
{website ? (
<div>
Expand Down

0 comments on commit df5f692

Please sign in to comment.