mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 06:06:41 +01:00
Testing showing activity on Account Block
Meh
This commit is contained in:
parent
8d501668d0
commit
f4275d27fe
1 changed files with 30 additions and 2 deletions
|
@ -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 && (
|
||||||
|
<>
|
||||||
|
{' '}
|
||||||
|
· Last posted:{' '}
|
||||||
|
{niceDateTime(lastStatusAt, {
|
||||||
|
hideTime: true,
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</small>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue