diff --git a/src/legacy-components/IssueUI/index.tsx b/src/legacy-components/IssueUI/index.tsx index 9c97b0eb12..5721453831 100644 --- a/src/legacy-components/IssueUI/index.tsx +++ b/src/legacy-components/IssueUI/index.tsx @@ -7,6 +7,7 @@ import { displayMonetaryAmountInUSDFormat, formatNumber } from '@/common/utils/u import { Flex } from '@/component-library'; import { WRAPPED_TOKEN_SYMBOL, WrappedTokenAmount } from '@/config/relay-chains'; import { useGetPrices } from '@/hooks/api/use-get-prices'; +import { useWallet } from '@/hooks/use-wallet'; import AddressWithCopyUI from '@/legacy-components/AddressWithCopyUI'; import Hr2 from '@/legacy-components/hrs/Hr2'; import PriceInfo from '@/legacy-components/PriceInfo'; @@ -20,10 +21,10 @@ import IssueRequestStatusUI from './IssueRequestStatusUI'; import WhoopsStatusUI from './WhoopsStatusUI'; // TODO: should type properly (`Relay`) -const renderModalStatusPanel = (request: any) => { +const renderModalStatusPanel = (request: any, showPendingStatus: boolean) => { switch (request.status) { case IssueStatus.PendingWithBtcTxNotFound: { - return ; + return showPendingStatus && ; } case IssueStatus.RequestedRefund: { return ; @@ -41,8 +42,10 @@ interface Props { const IssueUI = ({ issue }: Props): JSX.Element => { const { t } = useTranslation(); const prices = useGetPrices(); + const { account } = useWallet(); const destinationAddress = issue.userParachainAddress; + const showPendingStatus = account?.toString() === issue.userParachainAddress; const receivedWrappedTokenAmount: WrappedTokenAmount = issue.execution ? issue.execution.amountWrapped @@ -55,33 +58,35 @@ const IssueUI = ({ issue }: Props): JSX.Element => { return (
-
- {/* TODO: could componentize */} -

- {t('receive')} + {showPendingStatus && ( +
+ {/* TODO: could componentize */} +

+ {t('receive')} + + {receivedWrappedTokenAmount.toHuman(8)} + + {WRAPPED_TOKEN_SYMBOL} +

- {receivedWrappedTokenAmount.toHuman(8)} + {`≈ ${displayMonetaryAmountInUSDFormat( + receivedWrappedTokenAmount, + getTokenPrice(prices, ForeignAssetIdLiteral.BTC)?.usd + )}`} - {WRAPPED_TOKEN_SYMBOL} -

- - {`≈ ${displayMonetaryAmountInUSDFormat( - receivedWrappedTokenAmount, - getTokenPrice(prices, ForeignAssetIdLiteral.BTC)?.usd - )}`} - -
+
+ )}
{

- <>{renderModalStatusPanel(issue)} + <>{renderModalStatusPanel(issue, showPendingStatus)}
); };