From d8f460f175df014bf442e95a199d467e06de65d3 Mon Sep 17 00:00:00 2001 From: miko Date: Tue, 8 Aug 2023 16:22:23 +0400 Subject: [PATCH] Write code cleaner --- src/components/ActivityStream.js | 9 ++++----- src/components/ProfileContentActivity.js | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/components/ActivityStream.js b/src/components/ActivityStream.js index 3c515b9e..eb223d84 100644 --- a/src/components/ActivityStream.js +++ b/src/components/ActivityStream.js @@ -212,13 +212,12 @@ const ActivityStreamList = ({ ? DateTime.fromISO(lastSeenAt) > DateTime.fromISO(createdAt) : true; - const key = hash ? hash : transactionHash; + const key = hash || transactionHash; - const createdAtDate = createdAt - ? createdAt - : DateTime.fromSeconds(timestamp).toISO(); + const createdAtDate = + createdAt || DateTime.fromSeconds(timestamp).toISO(); - const txHashUpdtated = txHash ? txHash : transactionHash; + const txHashUpdtated = txHash || transactionHash; const item = ( diff --git a/src/components/ProfileContentActivity.js b/src/components/ProfileContentActivity.js index 7bc69ffc..ca72c132 100644 --- a/src/components/ProfileContentActivity.js +++ b/src/components/ProfileContentActivity.js @@ -49,7 +49,7 @@ const ProfileContentActivity = ({ address }) => { dispatch(loadMoreActivitiesMutual(address, { fromOffsetZero: true })), ]); } - }, [address, mutualAddress, dispatch]); + }, [address, mutualAddress]); //eslint-disable-line react-hooks/exhaustive-deps const currentTime = DateTime.now().toISO(); @@ -58,17 +58,15 @@ const ProfileContentActivity = ({ address }) => { }; return ( - <> - - - - + + + ); };