Skip to content

Commit

Permalink
Merge branch 'development' of github.com:multiversx/mx-explorer-dapp …
Browse files Browse the repository at this point in the history
…into next
  • Loading branch information
radumojic committed Sep 23, 2024
2 parents 6b4d56b + 115219e commit 306d402
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 28 deletions.
5 changes: 3 additions & 2 deletions src/components/DetailItem/DetailItem.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ReactNode } from 'react';
import classNames from 'classnames';
import { WithClassnameType } from 'types';

export interface DetailItemUIType extends WithClassnameType {
children?: React.ReactNode;
title?: string | React.ReactNode;
children?: ReactNode;
title?: ReactNode;
colWidth?: string;
noBorder?: boolean;
verticalCenter?: boolean;
Expand Down
9 changes: 2 additions & 7 deletions src/helpers/getValue/getAccountDelegationDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,15 @@ export const getAccountDelegationDetails = (
(a, b) => new BigNumber(a).plus(b),
new BigNumber(ZERO)
);
const bNunbondable = delegation
.map(({ userUnBondable }) => userUnBondable)
.reduce((a, b) => new BigNumber(a).plus(b), new BigNumber(ZERO));

const activePlusUnStaked = bNactive.plus(bNunstaked);
const bNlocked = activePlusUnStaked
.plus(bNclaimableRewards)
.plus(bNunbondable);
const bNlocked = activePlusUnStaked.plus(bNclaimableRewards);

const show = bNlocked.isGreaterThan(0);

return {
active: bNactive,
unstaked: bNunstaked.plus(bNunbondable),
unstaked: bNunstaked,
claimable: bNclaimableRewards,
locked: bNlocked,
show
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ export const prepareChartData = ({
({ provider }) => delegation.contract === provider
);
if (provider) {
const {
userActiveStake,
claimableRewards,
userUnBondable,
userUndelegatedList
} = delegation;
const { userActiveStake, claimableRewards, userUndelegatedList } =
delegation;

const undelegatedAmounts =
userUndelegatedList && userUndelegatedList.length > 0
Expand All @@ -60,7 +56,6 @@ export const prepareChartData = ({

const bNLocked = new BigNumber(userActiveStake)
.plus(claimableRewards)
.plus(userUnBondable)
.plus(bNtotalUserUnStakedValue);

const amount = formatAmount({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useRef, useState } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';

import {
CopyButton,
Expand Down Expand Up @@ -69,9 +70,10 @@ export const EventItem = ({ event, txHash, id }: EventItemUIType) => {

return (
<div
className={`detailed-item d-flex border-start border-bottom ms-3 py-3 ${
isEventHighlighted ? 'highlighted' : ''
}`}
className={classNames(
'detailed-item d-flex border-start border-bottom ms-3 py-3',
{ highlighted: isEventHighlighted }
)}
{...(isEventHighlighted ? { ref: ref } : {})}
>
<NetworkLink to={eventLink} className='detailed-item-icon'>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useRef, useState } from 'react';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import classNames from 'classnames';

import { MAX_DISPLAY_TX_DATA_LENGTH } from 'appConstants';
import {
Expand Down Expand Up @@ -55,9 +56,10 @@ export const ScResultsList = ({
<div
key={i}
id={result.hash}
className={`detailed-item d-flex border-start border-bottom ms-3 py-3 ${
isResultHighlighted ? 'highlighted' : ''
}`}
className={classNames(
'detailed-item d-flex border-start border-bottom ms-3 py-3',
{ highlighted: isResultHighlighted }
)}
{...(isResultHighlighted ? { ref: ref } : {})}
>
<NetworkLink to={resultLink} className='detailed-item-icon'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,8 @@ export const TransactionInfo = ({
<DetailItem title='To'>
<div className='d-flex flex-column'>
<div className='d-flex align-items-center'>
{isContract(transaction.receiver) ? (
{isContract(transaction.receiver) && (
<span className='me-2 text-neutral-400'>Contract</span>
) : (
''
)}
<AccountLink
address={transaction.receiver}
Expand All @@ -328,10 +326,8 @@ export const TransactionInfo = ({
<DetailItem title='Destination'>
<div className='d-flex flex-column'>
<div className='d-flex align-items-center'>
{isContract(receiver) ? (
{isContract(receiver) && (
<span className='me-2 text-neutral-400'>Contract</span>
) : (
''
)}
<AccountLink
address={receiver}
Expand Down

0 comments on commit 306d402

Please sign in to comment.