From 36d1f43fde1daa8e04d628b013fe97776fc4f1d4 Mon Sep 17 00:00:00 2001 From: Jan Michek <15363559+janmichek@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:05:49 +0200 Subject: [PATCH] feat: Prepend token symbol (#809) --- cypress.config.ts | 2 +- src/assets/ae-token.svg | 6 +- ...countActivityDataCellAex9TransferEvent.vue | 15 ++-- ...untActivityDataCellContractCallTxEvent.vue | 8 +-- ...ivityDataCellInternalContractCallEvent.vue | 5 +- ...tActivityDataCellInternalTransferEvent.vue | 7 +- ...ccountActivityDataCellNameClaimTxEvent.vue | 9 +-- .../AccountActivityDataCellSpendTxEvent.vue | 4 +- src/components/AccountDetailsPanel.vue | 7 +- src/components/AccountTokensTable.vue | 44 +++++------- .../AccountTokensTableCondensed.vue | 49 ++++++------- src/components/AeCoinPanel.vue | 6 +- src/components/ContractDetailsPanel.vue | 4 +- src/components/ContractEventCellAllowance.vue | 8 +-- src/components/ContractEventCellBurn.vue | 8 +-- src/components/ContractEventCellMint.vue | 8 +-- src/components/ContractEventCellSwap.vue | 6 +- src/components/ContractEventCellTransfer.vue | 9 ++- src/components/DashboardAuctionsSwiper.vue | 3 +- src/components/DashboardAuctionsTable.vue | 9 +-- src/components/DashboardNamesSwiper.vue | 3 +- src/components/DashboardNamesTable.vue | 9 +-- .../DashboardStateChannelsSwiper.vue | 3 +- .../DashboardStateChannelsTable.vue | 3 +- src/components/KeyblockDetailsPanel.vue | 6 +- src/components/KeyblockTable.vue | 6 +- src/components/KeyblockTableCondensed.vue | 6 +- src/components/MarketStats.vue | 20 ++++-- src/components/NameDetailsPanel.vue | 6 +- .../NameHistoryDataCellNameClaimEvent.vue | 6 +- src/components/NamesActiveTable.vue | 11 +-- src/components/NamesActiveTableCondensed.vue | 6 +- src/components/NamesExpiredTable.vue | 11 +-- src/components/NamesExpiredTableCondensed.vue | 6 +- src/components/NamesInAuctionTable.vue | 9 +-- .../NamesInAuctionTableCondensed.vue | 6 +- src/components/OracleDetailsPanel.vue | 3 +- src/components/OracleEventsQueryPanel.vue | 4 +- src/components/OraclesTable.vue | 3 +- src/components/OraclesTableCondensed.vue | 3 +- src/components/PriceLabel.vue | 71 +++++++++++++++++++ src/components/StateChannelDetailsPanel.vue | 5 +- src/components/StateChannelsTable.vue | 4 +- src/components/StatsPanel.vue | 37 +++++++--- src/components/TokenDetailsPanel.vue | 12 +++- src/components/TokenEventsDataCell.vue | 36 +++++----- src/components/TokenHoldersTable.vue | 20 ++---- src/components/TokenHoldersTableCondensed.vue | 19 ++--- src/components/TopAccountsTable.vue | 5 +- .../TransactionCellChannelCloseMutualTx.vue | 11 +-- .../TransactionCellChannelCreateTx.vue | 12 +--- .../TransactionCellChannelDepositTx.vue | 7 +- .../TransactionCellChannelSettleTx.vue | 11 +-- .../TransactionCellChannelWithdrawTx.vue | 7 +- src/components/TransactionCellGAMetaTx.vue | 6 +- src/components/TransactionCellNameClaimTx.vue | 9 +-- .../TransactionCellOracleRegisterTx.vue | 7 +- src/components/TransactionCellPayingForTx.vue | 6 +- src/components/TransactionCellSpendTx.vue | 7 +- src/components/TransactionGeneralPanel.vue | 4 +- ...ansactionTypeTableChannelCloseMutualTx.vue | 32 ++++----- .../TransactionTypeTableChannelCreateTx.vue | 49 ++++++------- .../TransactionTypeTableChannelDepositTx.vue | 4 +- .../TransactionTypeTableChannelSettleTx.vue | 16 +---- .../TransactionTypeTableChannelWithdrawTx.vue | 4 +- .../TransactionTypeTableContractCallTx.vue | 26 ++++--- .../TransactionTypeTableContractCreateTx.vue | 26 ++++--- .../TransactionTypeTableGAAttachTx.vue | 24 +++++-- .../TransactionTypeTableGAMetaTx.vue | 9 +-- .../TransactionTypeTableNameClaimTx.vue | 4 +- .../TransactionTypeTableOracleQueryTx.vue | 4 +- .../TransactionTypeTableOracleRegisterTx.vue | 4 +- .../TransactionTypeTableSpendTx.vue | 4 +- src/utils/adapters.js | 29 +++++--- src/utils/format.js | 27 +++++-- 75 files changed, 464 insertions(+), 441 deletions(-) create mode 100644 src/components/PriceLabel.vue diff --git a/cypress.config.ts b/cypress.config.ts index b4d6f9b24..75ae8000f 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -19,5 +19,5 @@ export default defineConfig({ }, viewportWidth: 1280, viewportHeight: 720, - defaultCommandTimeout: 30000, + defaultCommandTimeout: 40000, }) diff --git a/src/assets/ae-token.svg b/src/assets/ae-token.svg index 19d3ea8ed..6238f6a50 100644 --- a/src/assets/ae-token.svg +++ b/src/assets/ae-token.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + diff --git a/src/components/AccountActivityDataCellAex9TransferEvent.vue b/src/components/AccountActivityDataCellAex9TransferEvent.vue index 6e8aea915..04fbe22fc 100644 --- a/src/components/AccountActivityDataCellAex9TransferEvent.vue +++ b/src/components/AccountActivityDataCellAex9TransferEvent.vue @@ -2,15 +2,14 @@ - - - {{ tokenValue }} - + diff --git a/src/components/AccountActivityDataCellContractCallTxEvent.vue b/src/components/AccountActivityDataCellContractCallTxEvent.vue index c855534b3..365283134 100644 --- a/src/components/AccountActivityDataCellContractCallTxEvent.vue +++ b/src/components/AccountActivityDataCellContractCallTxEvent.vue @@ -7,17 +7,15 @@ {{ activity.payload.tx.function }} - - {{ formatAePrice(formatAettosToAe(activity.payload.tx.amount)) }} - + :price="formatAettosToAe(activity.payload.tx.amount)"/> diff --git a/src/components/AccountTokensTable.vue b/src/components/AccountTokensTable.vue index 29ba0ee73..b1872b46c 100644 --- a/src/components/AccountTokensTable.vue +++ b/src/components/AccountTokensTable.vue @@ -3,33 +3,27 @@ - Symbol - - {{ tokensHints.tokenSymbol }} - - - - Name + Amount - {{ tokensHints.tokenName }} + {{ tokensHints.amount }} - Smart Contract + Value - {{ tokensHints.smartContractId }} + {{ tokensHints.value }} - Amount + Name - {{ tokensHints.amount }} + {{ tokensHints.tokenName }} - Value + Smart Contract - {{ tokensHints.value }} + {{ tokensHints.smartContractId }} @@ -39,23 +33,23 @@ v-for="token in accountTokens?.data" :key="token.contractId"> - - {{ token.tokenSymbol }} - + - {{ token.tokenName }} + {{ token.value }} - - - - {{ formatNumber(token.amount) }} + + {{ token.tokenName }} + - {{ token.value !== null ? `$${formatNumber(token.value,null,null, 7)}` : 'N/A' }} + diff --git a/src/components/AccountTokensTableCondensed.vue b/src/components/AccountTokensTableCondensed.vue index 53682963f..17d6e30d0 100644 --- a/src/components/AccountTokensTableCondensed.vue +++ b/src/components/AccountTokensTableCondensed.vue @@ -8,70 +8,61 @@ - Symbol - - - - - - {{ token.tokenSymbol }} - - - - - - - Name + Amount - {{ token.tokenName }} + - Smart Contract + Value - + {{ token.value }} - Amount + Name - {{ formatNumber(token.amount) }} + + {{ token.tokenName }} + + - Value + Smart Contract - {{ token.value !== null ? `$${formatNumber(token.value, null, null, 7)}` : 'N/A' }} + diff --git a/src/components/AeCoinPanel.vue b/src/components/AeCoinPanel.vue index 466291b87..e40194736 100644 --- a/src/components/AeCoinPanel.vue +++ b/src/components/AeCoinPanel.vue @@ -39,7 +39,7 @@ Total Supply - {{ formatNullable(formatAePrice(MAX_AE_DISTRIBUTION), 0) }} + @@ -50,7 +50,7 @@ Circulating Supply - {{ formatNullable(formatAePrice(totalTokenSupply), 0) }} + @@ -70,7 +70,7 @@ + + diff --git a/src/components/StateChannelDetailsPanel.vue b/src/components/StateChannelDetailsPanel.vue index 02285c652..283a4388b 100644 --- a/src/components/StateChannelDetailsPanel.vue +++ b/src/components/StateChannelDetailsPanel.vue @@ -59,7 +59,7 @@ Initial Amount - {{ formatAePrice(stateChannelDetails.initialAmount, null) }} + @@ -128,7 +128,7 @@ Locked - {{ formatAePrice(stateChannelDetails.aeLocked, null) }} + @@ -201,7 +201,6 @@ diff --git a/src/components/TokenHoldersTableCondensed.vue b/src/components/TokenHoldersTableCondensed.vue index 218ee0bef..4ca02c386 100644 --- a/src/components/TokenHoldersTableCondensed.vue +++ b/src/components/TokenHoldersTableCondensed.vue @@ -29,7 +29,10 @@ - {{ formatNumber(holder.amount, 0, tokenDetails.decimals) }} {{ tokenDetails.symbol }} + @@ -42,7 +45,7 @@ - {{ formatPercentage(holder.percentage) }} + {{ holder.percentage }} @@ -50,7 +53,6 @@ diff --git a/src/components/TransactionTypeTableChannelCreateTx.vue b/src/components/TransactionTypeTableChannelCreateTx.vue index 3ea74ea69..585cbfecf 100644 --- a/src/components/TransactionTypeTableChannelCreateTx.vue +++ b/src/components/TransactionTypeTableChannelCreateTx.vue @@ -22,12 +22,7 @@ Channel Reserve - {{ - formatAePrice( - formatAettosToAe(transactionData.channelReserve), - null, - ) - }} + @@ -38,16 +33,13 @@ Initiator / Amount - - {{ transactionData.initiatorId }} - - / - {{ - formatAePrice( - formatAettosToAe(transactionData.initiatorAmount), - null, - ) - }} +
+ + {{ transactionData.initiatorId }} + + / + +
@@ -69,16 +61,13 @@ Responder / Amount - - {{ transactionData.responderId }} - - / - {{ - formatAePrice( - formatAettosToAe(transactionData.responderAmount), - null, - ) - }} +
+ + {{ transactionData.responderId }} + + / + +
@@ -110,7 +99,7 @@