From 7ff7df1249b5c948ee3d24668f36a013b9d131f0 Mon Sep 17 00:00:00 2001 From: S2kael Date: Thu, 19 Oct 2023 17:22:19 +0700 Subject: [PATCH] [Issue-1929] Update text for history --- .../src/Popup/Home/History/index.tsx | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/extension-koni-ui/src/Popup/Home/History/index.tsx b/packages/extension-koni-ui/src/Popup/Home/History/index.tsx index 7bb07838f7..e00ce09a18 100644 --- a/packages/extension-koni-ui/src/Popup/Home/History/index.tsx +++ b/packages/extension-koni-ui/src/Popup/Home/History/index.tsx @@ -224,12 +224,15 @@ function Component ({ className = '' }: Props): React.ReactElement { }, {} as Record); }, [accounts]); - const typeNameMap: Record = useMemo(() => ({ + const typeNameMap: Record = useMemo((): Record => ({ default: t('Transaction'), submitting: t('Submitting...'), processing: t('Processing...'), send: t('Send'), received: t('Receive'), + [ExtrinsicType.TRANSFER_BALANCE]: t('Send token'), + [ExtrinsicType.TRANSFER_TOKEN]: t('Send token'), + [ExtrinsicType.TRANSFER_XCM]: t('Send token'), [ExtrinsicType.SEND_NFT]: t('NFT'), [ExtrinsicType.CROWDLOAN]: t('Crowdloan'), [ExtrinsicType.STAKING_JOIN_POOL]: t('Stake'), @@ -238,18 +241,30 @@ function Component ({ className = '' }: Props): React.ReactElement { [ExtrinsicType.STAKING_UNBOND]: t('Unstake'), [ExtrinsicType.STAKING_CLAIM_REWARD]: t('Claim Reward'), [ExtrinsicType.STAKING_WITHDRAW]: t('Withdraw'), + [ExtrinsicType.STAKING_POOL_WITHDRAW]: t('Withdraw'), [ExtrinsicType.STAKING_CANCEL_UNSTAKE]: t('Cancel unstake'), + [ExtrinsicType.STAKING_COMPOUNDING]: t('Compound'), + [ExtrinsicType.STAKING_CANCEL_COMPOUNDING]: t('Cancel compound'), [ExtrinsicType.EVM_EXECUTE]: t('EVM Transaction'), + [ExtrinsicType.JOIN_YIELD_POOL]: t('Stake'), [ExtrinsicType.MINT_QDOT]: t('Mint qDOT'), [ExtrinsicType.MINT_SDOT]: t('Mint sDOT'), [ExtrinsicType.MINT_LDOT]: t('Mint LDOT'), - [ExtrinsicType.MINT_VDOT]: t('Mint vDOT') + [ExtrinsicType.MINT_VDOT]: t('Mint vDOT'), + [ExtrinsicType.REDEEM_QDOT]: t('Redeem qDOT'), + [ExtrinsicType.REDEEM_SDOT]: t('Redeem sDOT'), + [ExtrinsicType.REDEEM_LDOT]: t('Redeem LDOT'), + [ExtrinsicType.REDEEM_VDOT]: t('Redeem vDOT'), + [ExtrinsicType.UNKNOWN]: t('Unknown') }), [t]); - const typeTitleMap: Record = useMemo(() => ({ + const typeTitleMap: Record = useMemo((): Record => ({ default: t('Transaction'), send: t('Send token'), received: t('Receive token'), + [ExtrinsicType.TRANSFER_BALANCE]: t('Send token'), + [ExtrinsicType.TRANSFER_TOKEN]: t('Send token'), + [ExtrinsicType.TRANSFER_XCM]: t('Send token'), [ExtrinsicType.SEND_NFT]: t('NFT transaction'), [ExtrinsicType.CROWDLOAN]: t('Crowdloan transaction'), [ExtrinsicType.STAKING_JOIN_POOL]: t('Stake transaction'), @@ -258,12 +273,21 @@ function Component ({ className = '' }: Props): React.ReactElement { [ExtrinsicType.STAKING_UNBOND]: t('Unbond transaction'), [ExtrinsicType.STAKING_CLAIM_REWARD]: t('Claim Reward transaction'), [ExtrinsicType.STAKING_WITHDRAW]: t('Withdraw transaction'), + [ExtrinsicType.STAKING_POOL_WITHDRAW]: t('Withdraw transaction'), [ExtrinsicType.STAKING_CANCEL_UNSTAKE]: t('Cancel unstake transaction'), + [ExtrinsicType.STAKING_COMPOUNDING]: t('Compound transaction'), + [ExtrinsicType.STAKING_CANCEL_COMPOUNDING]: t('Cancel compound transaction'), [ExtrinsicType.EVM_EXECUTE]: t('EVM Transaction'), + [ExtrinsicType.JOIN_YIELD_POOL]: t('Stake transaction'), [ExtrinsicType.MINT_QDOT]: t('Mint qDOT transaction'), [ExtrinsicType.MINT_SDOT]: t('Mint sDOT transaction'), [ExtrinsicType.MINT_LDOT]: t('Mint LDOT transaction'), - [ExtrinsicType.MINT_VDOT]: t('Mint vDOT transaction') + [ExtrinsicType.MINT_VDOT]: t('Mint vDOT transaction'), + [ExtrinsicType.REDEEM_QDOT]: t('Redeem qDOT transaction'), + [ExtrinsicType.REDEEM_SDOT]: t('Redeem sDOT transaction'), + [ExtrinsicType.REDEEM_LDOT]: t('Redeem LDOT transaction'), + [ExtrinsicType.REDEEM_VDOT]: t('Redeem vDOT transaction'), + [ExtrinsicType.UNKNOWN]: t('Unknown transaction') }), [t]); // Fill display data to history list