mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
feat(post): add 'user was banned for this post' if user was banned by board to post in it
This commit is contained in:
@@ -217,7 +217,8 @@ const PostMedia = ({ post }: PostProps) => {
|
||||
};
|
||||
|
||||
const PostMessage = ({ post }: PostProps) => {
|
||||
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
|
||||
const { cid, content, commentAuthor, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
|
||||
const banned = commentAuthor?.banExpiresAt;
|
||||
const { t } = useTranslation();
|
||||
const params = useParams();
|
||||
const location = useLocation();
|
||||
@@ -268,6 +269,19 @@ const PostMessage = ({ post }: PostProps) => {
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
{banned && (
|
||||
<span className={styles.removedContent}>
|
||||
<br />
|
||||
<Tooltip
|
||||
children={`(${t('user_banned')})`}
|
||||
content={t('ban_expires_at', {
|
||||
address: subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress),
|
||||
timestamp: getFormattedDate(commentAuthor?.banExpiresAt),
|
||||
interpolation: { escapeValue: false },
|
||||
})}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{(removed || deleted) && reason && (
|
||||
|
||||
@@ -152,7 +152,8 @@ const ReplyBacklinks = ({ post }: PostProps) => {
|
||||
|
||||
const PostMessageMobile = ({ post }: PostProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
|
||||
const { cid, commentAuthor, content, deleted, edit, original, parentCid, postCid, reason, removed, spoiler, state, subplebbitAddress } = post || {};
|
||||
const banned = commentAuthor?.banExpiresAt;
|
||||
const [showOriginal, setShowOriginal] = useState(false);
|
||||
|
||||
const params = useParams();
|
||||
@@ -204,6 +205,19 @@ const PostMessageMobile = ({ post }: PostProps) => {
|
||||
)}
|
||||
</span>
|
||||
)}
|
||||
{banned && (
|
||||
<span className={styles.removedContent}>
|
||||
<br />
|
||||
<Tooltip
|
||||
children={`(${t('user_banned')})`}
|
||||
content={t('ban_expires_at', {
|
||||
address: subplebbitAddress && Plebbit.getShortAddress(subplebbitAddress),
|
||||
timestamp: getFormattedDate(commentAuthor?.banExpiresAt),
|
||||
interpolation: { escapeValue: false },
|
||||
})}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{(removed || deleted) && reason && (
|
||||
|
||||
Reference in New Issue
Block a user