Testing showing activity on Account Block

Meh
This commit is contained in:
Lim Chee Aun 2023-03-07 22:36:12 +08:00
parent 8d501668d0
commit f4275d27fe

View file

@ -1,6 +1,7 @@
import './account-block.css'; import './account-block.css';
import emojifyText from '../utils/emojify-text'; import emojifyText from '../utils/emojify-text';
import niceDateTime from '../utils/nice-date-time';
import states from '../utils/states'; import states from '../utils/states';
import Avatar from './avatar'; import Avatar from './avatar';
@ -12,6 +13,7 @@ function AccountBlock({
instance, instance,
external, external,
onClick, onClick,
showActivity = false,
}) { }) {
if (skeleton) { if (skeleton) {
return ( return (
@ -26,8 +28,17 @@ function AccountBlock({
); );
} }
const { acct, avatar, avatarStatic, displayName, username, emojis, url } = const {
account; acct,
avatar,
avatarStatic,
displayName,
username,
emojis,
url,
statusesCount,
lastStatusAt,
} = account;
const displayNameWithEmoji = emojifyText(displayName, emojis); const displayNameWithEmoji = emojifyText(displayName, emojis);
return ( return (
@ -58,6 +69,23 @@ function AccountBlock({
<b>{username}</b> <b>{username}</b>
)} )}
<br />@{acct} <br />@{acct}
{showActivity && (
<>
<br />
<small class="last-status-at insignificant">
Posts: {statusesCount}
{!!lastStatusAt && (
<>
{' '}
&middot; Last posted:{' '}
{niceDateTime(lastStatusAt, {
hideTime: true,
})}
</>
)}
</small>
</>
)}
</span> </span>
</a> </a>
); );