mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(catalog post preview): show displayName of last reply with thread.lastChildCid
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { useComment } from '@plebbit/plebbit-react-hooks';
|
||||
|
||||
const DisplayName = ({ commentCid }) => {
|
||||
const comment = useComment({ commentCid });
|
||||
|
||||
return <span>{comment?.author?.displayName ?? 'Anonymous'}</span>;
|
||||
};
|
||||
|
||||
export default DisplayName;
|
||||
@@ -12,6 +12,7 @@ import { Threads, PostPreview, PostMenuCatalog } from '../styled/views/Catalog.s
|
||||
import { TopBar, Footer } from '../styled/views/Thread.styled';
|
||||
import { AlertModal } from '../styled/modals/AlertModal.styled';
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import DisplayName from '../DisplayName';
|
||||
import EditModal from '../modals/EditModal';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
@@ -383,7 +384,10 @@ const CatalogPost = ({ post }) => {
|
||||
{thread.replyCount > 0 ? (
|
||||
<div className='post-last'>
|
||||
Last reply by
|
||||
<span className='post-author'> Anonymous </span>
|
||||
<span className='post-author'>
|
||||
{' '}
|
||||
<DisplayName commentCid={thread.lastChildCid} />{' '}
|
||||
</span>
|
||||
<span className='post-ago'>{getFormattedTime(thread.lastReplyTimestamp)}</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -18,6 +18,7 @@ import SettingsModal from '../modals/SettingsModal';
|
||||
import BoardSettings from '../BoardSettings';
|
||||
import BoardStats from '../BoardStats';
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import DisplayName from '../DisplayName';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import OfflineIndicator from '../OfflineIndicator';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
@@ -769,7 +770,10 @@ const CatalogPost = ({ post }) => {
|
||||
{thread.replyCount > 0 ? (
|
||||
<div className='post-last'>
|
||||
Last reply by
|
||||
<span className='post-author'> Anonymous </span>
|
||||
<span className='post-author'>
|
||||
{' '}
|
||||
<DisplayName commentCid={thread.lastChildCid} />{' '}
|
||||
</span>
|
||||
<span className='post-ago'>{getFormattedTime(thread.lastReplyTimestamp)}</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Threads, PostPreview, PostMenuCatalog } from '../styled/views/Catalog.s
|
||||
import { TopBar, Footer } from '../styled/views/Thread.styled';
|
||||
import { AlertModal } from '../styled/modals/AlertModal.styled';
|
||||
import CatalogLoader from '../CatalogLoader';
|
||||
import DisplayName from '../DisplayName';
|
||||
import EditModal from '../modals/EditModal';
|
||||
import ImageBanner from '../ImageBanner';
|
||||
import VerifiedAuthor from '../VerifiedAuthor';
|
||||
@@ -383,7 +384,10 @@ const CatalogPost = ({ post }) => {
|
||||
{thread.replyCount > 0 ? (
|
||||
<div className='post-last'>
|
||||
Last reply by
|
||||
<span className='post-author'> Anonymous </span>
|
||||
<span className='post-author'>
|
||||
{' '}
|
||||
<DisplayName commentCid={thread.lastChildCid} />{' '}
|
||||
</span>
|
||||
<span className='post-ago'>{getFormattedTime(thread.lastReplyTimestamp)}</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user