From 380abf2adc8d6d0ca154d97b35561e95677a1e9c Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Thu, 23 Sep 2021 18:33:20 -0300 Subject: [PATCH] Custom msg for 0 logs --- src/transaction/Logs.tsx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/transaction/Logs.tsx b/src/transaction/Logs.tsx index 3990a24..72258f0 100644 --- a/src/transaction/Logs.tsx +++ b/src/transaction/Logs.tsx @@ -60,11 +60,24 @@ const Logs: React.FC = ({ txData, metadata }) => { return ( -
Transaction Receipt Event Logs
- {txData.confirmedData && - txData.confirmedData.logs.map((l, i) => ( - - ))} + {txData.confirmedData && ( + <> + {txData.confirmedData.logs.length > 0 ? ( + <> + {txData.confirmedData.logs.map((l, i) => ( + + ))} + + ) : ( +
Transaction didn't emit any logs
+ )} + + )}
); };