Skip to content

Commit

Permalink
Write code cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
mikozet committed Aug 8, 2023
1 parent f9961b8 commit d8f460f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
9 changes: 4 additions & 5 deletions src/components/ActivityStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
<Grid item key={key} xs={12}>
Expand Down
22 changes: 10 additions & 12 deletions src/components/ProfileContentActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -58,17 +58,15 @@ const ProfileContentActivity = ({ address }) => {
};

return (
<>
<Box className={classes.activityContainer}>
<ActivityStream
activities={mutualActivities}
isLoading={isLoadingMore}
isMoreAvailable={isMoreAvailable}
lastSeenAt={currentTime}
onLoadMore={handleLoadMore}
/>
</Box>
</>
<Box className={classes.activityContainer}>
<ActivityStream
activities={mutualActivities}
isLoading={isLoadingMore}
isMoreAvailable={isMoreAvailable}
lastSeenAt={currentTime}
onLoadMore={handleLoadMore}
/>
</Box>
);
};

Expand Down

0 comments on commit d8f460f

Please sign in to comment.