From f4275d27fe7d00914234cbbc2847d55e083ed07f Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 7 Mar 2023 22:36:12 +0800 Subject: [PATCH] Testing showing activity on Account Block Meh --- src/components/account-block.jsx | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/components/account-block.jsx b/src/components/account-block.jsx index c8c2e54b..84d3792b 100644 --- a/src/components/account-block.jsx +++ b/src/components/account-block.jsx @@ -1,6 +1,7 @@ import './account-block.css'; import emojifyText from '../utils/emojify-text'; +import niceDateTime from '../utils/nice-date-time'; import states from '../utils/states'; import Avatar from './avatar'; @@ -12,6 +13,7 @@ function AccountBlock({ instance, external, onClick, + showActivity = false, }) { if (skeleton) { return ( @@ -26,8 +28,17 @@ function AccountBlock({ ); } - const { acct, avatar, avatarStatic, displayName, username, emojis, url } = - account; + const { + acct, + avatar, + avatarStatic, + displayName, + username, + emojis, + url, + statusesCount, + lastStatusAt, + } = account; const displayNameWithEmoji = emojifyText(displayName, emojis); return ( @@ -58,6 +69,23 @@ function AccountBlock({ {username} )}
@{acct} + {showActivity && ( + <> +
+ + Posts: {statusesCount} + {!!lastStatusAt && ( + <> + {' '} + · Last posted:{' '} + {niceDateTime(lastStatusAt, { + hideTime: true, + })} + + )} + + + )} );