From fa2d1e3aa5b3a42e9e4b2322ddb84adf2b8c25e7 Mon Sep 17 00:00:00 2001 From: Edd Date: Wed, 9 Aug 2023 17:38:02 +0100 Subject: [PATCH] feat(explorer): succession line in market details --- .../app/components/markets/market-details.tsx | 7 ++- .../components/txs/details/tx-proposal.tsx | 51 +++++++++++-------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/apps/explorer/src/app/components/markets/market-details.tsx b/apps/explorer/src/app/components/markets/market-details.tsx index 48409bb60..de0cdec22 100644 --- a/apps/explorer/src/app/components/markets/market-details.tsx +++ b/apps/explorer/src/app/components/markets/market-details.tsx @@ -1,6 +1,9 @@ import { t } from '@vegaprotocol/i18n'; import type { MarketInfoWithData } from '@vegaprotocol/markets'; -import { PriceMonitoringBoundsInfoPanel } from '@vegaprotocol/markets'; +import { + PriceMonitoringBoundsInfoPanel, + SuccessionLineInfoPanel, +} from '@vegaprotocol/markets'; import { LiquidityInfoPanel, LiquidityMonitoringParametersInfoPanel, @@ -103,6 +106,8 @@ export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => { )} +

{t('Succession line')}

+ ); }; diff --git a/apps/explorer/src/app/components/txs/details/tx-proposal.tsx b/apps/explorer/src/app/components/txs/details/tx-proposal.tsx index 85c1d2fae..12a89ab24 100644 --- a/apps/explorer/src/app/components/txs/details/tx-proposal.tsx +++ b/apps/explorer/src/app/components/txs/details/tx-proposal.tsx @@ -91,9 +91,13 @@ export const TxProposal = ({ txData, pubKey, blockData }: TxProposalProps) => { } const tx = proposal.terms?.newAsset || proposal.terms?.updateAsset; - const isSuccessorMarketProposal = proposal?.terms?.newMarket?.changes?.successor; - const parentMarketId = isSuccessorMarketProposal && proposal?.terms.newMarket?.changes?.successor?.parentMarketId; - const insurancePoolFraction = proposal?.terms?.newMarket?.changes?.successor?.insurancePoolFraction; + const isSuccessorMarketProposal = + proposal?.terms?.newMarket?.changes?.successor; + const parentMarketId = + isSuccessorMarketProposal && + proposal?.terms.newMarket?.changes?.successor?.parentMarketId; + const insurancePoolFraction = + proposal?.terms?.newMarket?.changes?.successor?.insurancePoolFraction; // This component is not rendered if no bundle is required const SignatureBundleComponent = proposal.terms?.newAsset @@ -120,23 +124,30 @@ export const TxProposal = ({ txData, pubKey, blockData }: TxProposalProps) => { - {isSuccessorMarketProposal ? <> - {parentMarketId ? - - {t('Previous market')} - - - - : null} - {insurancePoolFraction ? - - {t('Insurance pool fraction')} - - {formatNumber(Number(insurancePoolFraction) * 100, 0)}% - - : null} - : null} - + {isSuccessorMarketProposal ? ( + <> + {parentMarketId ? ( + + {t('Previous market')} + + + + + ) : null} + {insurancePoolFraction ? ( + + {t('Insurance pool fraction')} + + {formatNumber(Number(insurancePoolFraction) * 100, 0)}% + + + ) : null} + + ) : null}