From 383db66481fe807f2482001d8a1e710b60bd22b7 Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 31 Jul 2019 10:17:59 +0800 Subject: [PATCH] feat(neuron-ui): double click on tx item shows its details --- packages/neuron-ui/src/components/TransactionList/index.tsx | 5 ++++- packages/neuron-ui/src/services/remote/app.ts | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/neuron-ui/src/components/TransactionList/index.tsx b/packages/neuron-ui/src/components/TransactionList/index.tsx index 3b757f5be6..12cf93e6a6 100644 --- a/packages/neuron-ui/src/components/TransactionList/index.tsx +++ b/packages/neuron-ui/src/components/TransactionList/index.tsx @@ -13,7 +13,7 @@ import { } from 'office-ui-fabric-react' import { StateDispatch } from 'states/stateProvider/reducer' -import { contextMenu } from 'services/remote' +import { contextMenu, showTransactionDetails } from 'services/remote' import { useLocalDescription } from 'utils/hooks' import { shannonToCKBFormatter, uniformTimeFormatter as timeFormatter, uniformTimeFormatter } from 'utils/formatters' @@ -203,6 +203,9 @@ const TransactionList = ({ onRenderHeader, }} checkboxVisibility={CheckboxVisibility.hidden} + onItemInvoked={item => { + showTransactionDetails(item.hash) + }} onItemContextMenu={item => { if (item) { contextMenu({ type: 'transactionList', id: item.hash }) diff --git a/packages/neuron-ui/src/services/remote/app.ts b/packages/neuron-ui/src/services/remote/app.ts index c3443322d9..d4b54a235f 100644 --- a/packages/neuron-ui/src/services/remote/app.ts +++ b/packages/neuron-ui/src/services/remote/app.ts @@ -12,8 +12,13 @@ export const contextMenu = controllerMethodWrapper(CONTROLLER_NAME)( controller => (params: { type: string; id: string }) => controller.contextMenu(params) ) +export const showTransactionDetails = controllerMethodWrapper(CONTROLLER_NAME)(controller => (hash: string) => + controller.showTransactionDetails(hash) +) + export default { getNeuronWalletState, handleViewError, contextMenu, + showTransactionDetails, }