mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post): show pending approval reason
This commit is contained in:
@@ -69,6 +69,9 @@ vi.mock('react-i18next', () => ({
|
||||
if (key === 'reason_reason') {
|
||||
return `reason:${options?.reason}`;
|
||||
}
|
||||
if (key === 'pending_mod_approval_reason') {
|
||||
return `pending-reason:${options?.reason}`;
|
||||
}
|
||||
if (key === 'ban_expires_at') {
|
||||
return `ban:${options?.address}:${options?.timestamp}`;
|
||||
}
|
||||
@@ -473,6 +476,7 @@ describe('CommentContent', () => {
|
||||
});
|
||||
|
||||
expect(container.textContent).toContain('pending_mod_approval');
|
||||
expect(container.textContent).toContain('pending-reason:rules violation');
|
||||
const tooltip = container.querySelector('[data-testid="tooltip"]');
|
||||
expect(tooltip?.getAttribute('title')).toContain('ban:short:music-posting.eth:2024-01-01 12:00:00');
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ const CommentContent = ({
|
||||
const failedError = getFailedCommentError(resolvedPost);
|
||||
const failedErrorMessage = formatErrorMessageForDisplay(failedError);
|
||||
const shouldShowUnpublishedStateDetails = !cid && (!hasFailedState || Boolean(failedError));
|
||||
const pendingApprovalReason = pendingApproval ? reason?.trim() : undefined;
|
||||
|
||||
const loadingString = (
|
||||
<div className={styles.stateString}>
|
||||
@@ -219,6 +220,18 @@ const CommentContent = ({
|
||||
<br />
|
||||
<br />
|
||||
<span className={styles.pendingApproval}>({t('pending_mod_approval')})</span>
|
||||
{pendingApprovalReason && (
|
||||
<>
|
||||
<br />
|
||||
<br />
|
||||
<span className={styles.grayEditMessage}>
|
||||
{t('pending_mod_approval_reason', {
|
||||
reason: pendingApprovalReason,
|
||||
interpolation: { escapeValue: false },
|
||||
})}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{((!isInPostView && content?.length > 1000 && !showFullComment) || (isInPostView && content?.length > 2000 && !showFullComment)) && (
|
||||
|
||||
Reference in New Issue
Block a user