mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat: implement post numbers
This commit is contained in:
@@ -52,7 +52,7 @@ const useShowOmittedReplies = create<ShowOmittedRepliesState>((set) => ({
|
|||||||
|
|
||||||
const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
|
const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { author, cid, deleted, locked, pinned, parentCid, postCid, reason, removed, shortCid, state, subplebbitAddress, timestamp } = post || {};
|
const { author, cid, deleted, locked, pinned, parentCid, postCid, reason, removed, state, subplebbitAddress, timestamp } = post || {};
|
||||||
const title = post?.title?.trim();
|
const title = post?.title?.trim();
|
||||||
const replies = useReplies(post);
|
const replies = useReplies(post);
|
||||||
const { address, shortAddress } = author || {};
|
const { address, shortAddress } = author || {};
|
||||||
@@ -176,10 +176,10 @@ const PostInfo = ({ post, postReplyCount = 0, roles, isHidden }: PostProps) => {
|
|||||||
title={t('link_to_post')}
|
title={t('link_to_post')}
|
||||||
onClick={(e) => !cid && e.preventDefault()}
|
onClick={(e) => !cid && e.preventDefault()}
|
||||||
>
|
>
|
||||||
CID:
|
No.
|
||||||
</Link>
|
</Link>
|
||||||
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={onReplyModalClick}>
|
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={onReplyModalClick}>
|
||||||
{shortCid}
|
{post?.number || '?'}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -32,25 +32,8 @@ import { selectPostMenuProps } from '../../lib/utils/post-menu-props';
|
|||||||
const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const defaultSubplebbits = useDefaultSubplebbits();
|
const defaultSubplebbits = useDefaultSubplebbits();
|
||||||
const {
|
const { author, cid, deleted, link, linkHeight, linkWidth, locked, parentCid, pinned, postCid, reason, removed, state, subplebbitAddress, timestamp, thumbnailUrl } =
|
||||||
author,
|
post || {};
|
||||||
cid,
|
|
||||||
deleted,
|
|
||||||
link,
|
|
||||||
linkHeight,
|
|
||||||
linkWidth,
|
|
||||||
locked,
|
|
||||||
parentCid,
|
|
||||||
pinned,
|
|
||||||
postCid,
|
|
||||||
reason,
|
|
||||||
removed,
|
|
||||||
shortCid,
|
|
||||||
state,
|
|
||||||
subplebbitAddress,
|
|
||||||
timestamp,
|
|
||||||
thumbnailUrl,
|
|
||||||
} = post || {};
|
|
||||||
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : undefined;
|
const boardPath = subplebbitAddress ? getBoardPath(subplebbitAddress, defaultSubplebbits) : undefined;
|
||||||
const isReply = parentCid;
|
const isReply = parentCid;
|
||||||
const title = post?.title?.trim();
|
const title = post?.title?.trim();
|
||||||
@@ -117,7 +100,7 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
|||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
_.capitalize(t('anonymous'))
|
_.capitalize(t('anonymous'))
|
||||||
)}
|
)}{' '}
|
||||||
{!(deleted || removed) && authorRole && (
|
{!(deleted || removed) && authorRole && (
|
||||||
<span className='capitalize'>
|
<span className='capitalize'>
|
||||||
{' '}
|
{' '}
|
||||||
@@ -198,10 +181,10 @@ const PostInfoAndMedia = ({ post, postReplyCount = 0, roles }: PostProps) => {
|
|||||||
title={t('link_to_post')}
|
title={t('link_to_post')}
|
||||||
onClick={(e) => !cid && e.preventDefault()}
|
onClick={(e) => !cid && e.preventDefault()}
|
||||||
>
|
>
|
||||||
CID:
|
No.
|
||||||
</Link>
|
</Link>
|
||||||
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={onReplyModalClick}>
|
<span className={styles.replyToPost} title={t('reply_to_post')} onMouseDown={onReplyModalClick}>
|
||||||
{shortCid.slice(0, -4)}
|
{post?.number || '?'}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user