diff --git a/src/core/types/EvmTransaction.ts b/src/core/types/EvmTransaction.ts index 020ebeb91..544c2fbf8 100644 --- a/src/core/types/EvmTransaction.ts +++ b/src/core/types/EvmTransaction.ts @@ -35,6 +35,8 @@ export interface EvmTransaction { to: string | null; // null if contract creation v: string; value: string; // string representation of hex number + prevTxHash: string | null; // hash of the previous transaction in the same contract + nextTxHash: string | null; // hash of the next transaction in the same contract } export interface EvmTransactionParsed extends EvmTransaction { diff --git a/src/css/global/_mixins.scss b/src/css/global/_mixins.scss index c4b67b6b3..039f5293a 100644 --- a/src/css/global/_mixins.scss +++ b/src/css/global/_mixins.scss @@ -23,9 +23,9 @@ cursor: pointer; height: 22px; width: 22px; - color: white; - background-color: $grey; - border: solid 1.25px $grey; + color: var(--text-color); + background-color: var(--tab-bg-color); + border: solid 1.25px var(--border-color); border-radius: 6px; display: flex; justify-content: center; @@ -36,6 +36,11 @@ &--right { padding-left: 1px; } + &--disabled { + cursor: not-allowed; + color: var(--muted-text-color); + border-color: var(--muted-text-color); + } .q-dark & { color: rgb(8, 29, 53); } diff --git a/src/i18n/de-de/index.js b/src/i18n/de-de/index.js index 892cfc5d1..237618199 100644 --- a/src/i18n/de-de/index.js +++ b/src/i18n/de-de/index.js @@ -43,6 +43,10 @@ export default { logs: 'Protokolle', internal: 'Interne Transaktionen', not_found: 'Transaktion nicht gefunden', + previous: 'Vorherige Transaktion des Absenders', + next: 'Nächste Transaktion des Absenders', + not_previous: 'Keine vorherige Transaktion des Absenders', + not_next: 'Keine nächste Transaktion des Absenders', }, internaltrx: { page_title: 'Interne Transaktionen des Vertrags', diff --git a/src/i18n/en-us/index.js b/src/i18n/en-us/index.js index 721d1db44..b581368a2 100644 --- a/src/i18n/en-us/index.js +++ b/src/i18n/en-us/index.js @@ -43,6 +43,10 @@ export default { logs: 'Logs', internal: 'Internal Transactions', not_found: 'Transaction not found', + previous: 'Previous transaction by sender', + next: 'Next transaction by sender', + not_previous: 'No previous transaction by sender', + not_next: 'No next transaction by sender', }, internaltrx: { page_title: 'Contract Internal Transactions', diff --git a/src/i18n/es-es/index.js b/src/i18n/es-es/index.js index 5977d35f6..2f094b233 100644 --- a/src/i18n/es-es/index.js +++ b/src/i18n/es-es/index.js @@ -43,6 +43,10 @@ export default { logs: 'Registros', internal: 'Transacciones Internas', not_found: 'Transacción no encontrada', + previous: 'Transacción anterior del remitente', + next: 'Siguiente transacción del remitente', + not_previous: 'No hay transacción anterior del remitente', + not_next: 'No hay siguiente transacción del remitente', }, internaltrx: { page_title: 'Transacciones internas del contrato', diff --git a/src/i18n/fr-fr/index.js b/src/i18n/fr-fr/index.js index 4cb3970d7..3fa1e746d 100644 --- a/src/i18n/fr-fr/index.js +++ b/src/i18n/fr-fr/index.js @@ -43,6 +43,10 @@ export default { logs: 'Journaux', internal: 'Transactions internes', not_found: 'Transaction non trouvée', + previous: 'Transaction précédente par l\'expéditeur', + next: 'Transaction suivante par l\'expéditeur', + not_previous: 'Aucune transaction précédente par l\'expéditeur', + not_next: 'Aucune transaction suivante par l\'expéditeur', }, internaltrx: { page_title: 'Transactions internes du contrat', diff --git a/src/i18n/pt-br/index.js b/src/i18n/pt-br/index.js index 2c3d6149f..2d3b9f4d7 100644 --- a/src/i18n/pt-br/index.js +++ b/src/i18n/pt-br/index.js @@ -43,6 +43,10 @@ export default { logs: 'Logs', internal: 'Transações Internas', not_found: 'Transação não encontrada', + previous: 'Transação anterior do remetente', + next: 'Próxima transação do remetente', + not_previous: 'Nenhuma transação anterior do remetente', + not_next: 'Nenhuma próxima transação do remetente', }, internaltrx: { page_title: 'Transações internas do contrato', diff --git a/src/pages/BlockListPage.vue b/src/pages/BlockListPage.vue index 7721fd970..82191de01 100644 --- a/src/pages/BlockListPage.vue +++ b/src/pages/BlockListPage.vue @@ -40,9 +40,6 @@ const showEmptyBlocks = ref(false); &__header { @include page-header; - &-nav-btn { - @include page-header-nav-btn; - } } &__tabs { diff --git a/src/pages/TransactionPage.vue b/src/pages/TransactionPage.vue index 51d438bf0..6c20ebe25 100644 --- a/src/pages/TransactionPage.vue +++ b/src/pages/TransactionPage.vue @@ -19,39 +19,37 @@ const tab = ref(route.query.tab as string || defaultTab); const trxNotFound = ref(false); const hash = ref(''); const trx = ref(null); +const prevTxHash = ref(null); +const nextTxHash = ref(null); const updateData = async () => { + console.log('TransactionPage: updateData() loadTransaction(hash.value)', hash.value); trx.value = await loadTransaction(hash.value); trxNotFound.value = !trx.value; if (!trx.value || !route.query.tab) { tab.value = defaultTab; } + prevTxHash.value = trx.value?.prevTxHash || null; + nextTxHash.value = trx.value?.nextTxHash || null; + console.log('TransactionPage: updateData()', prevTxHash.value, nextTxHash.value); }; + watch(() => route.params.hash, async (newValue) => { if (!newValue || hash.value === newValue) { + console.log('TransactionPage: watch route.params.hash (SKIP)', newValue, hash.value); return; } hash.value = typeof newValue === 'string' ? newValue : newValue[0]; + console.log('TransactionPage: watch route.params.hash', newValue, hash.value); updateData(); }, { immediate: true }); -watch(() => route.query, () => { - updateData(); -}); - watch(tab, (newTab) => { + console.log('TransactionPage: watch tab', newTab); router.replace({ query: { ...route.query, tab: newTab } }); }); -const prevTransaction = () => { - console.error('prevTransaction() NOT IMPLEMENTED'); -}; - -const nextTransaction = () => { - console.error('nextTransaction() NOT IMPLEMENTED'); -}; - @@ -61,11 +59,39 @@ const nextTransaction = () => {
{{ $t('pages.transaction.page_title') }} -
+ + + + {{ $t('pages.transaction.previous') }} + +
+ + {{ $t('pages.transaction.not_previous') }}
-
+ + + + + {{ $t('pages.transaction.next') }} + +
+ {{ $t('pages.transaction.not_next') }}
@@ -160,9 +186,10 @@ const nextTransaction = () => { &__header { @include page-header; + flex-direction: row; + gap: 5px; &-nav-btn { @include page-header-nav-btn; - display: none; // remove this line to enable the buttons } }