mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(post): 'comment too long' link was broken for description and rules
This commit is contained in:
@@ -240,6 +240,7 @@ const PostMedia = ({ post }: PostProps) => {
|
|||||||
|
|
||||||
const PostMessage = ({ post }: PostProps) => {
|
const PostMessage = ({ post }: PostProps) => {
|
||||||
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
|
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
|
||||||
|
const { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
// TODO: commentAuthor is not available outside of editedComment, update when available
|
// TODO: commentAuthor is not available outside of editedComment, update when available
|
||||||
// const banned = !!post?.commentAuthor?.banExpiresAt;
|
// const banned = !!post?.commentAuthor?.banExpiresAt;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -320,7 +321,11 @@ const PostMessage = ({ post }: PostProps) => {
|
|||||||
{!isReply && content.length > 1000 && !isInPostView && (
|
{!isReply && content.length > 1000 && !isInPostView && (
|
||||||
<span className={styles.abbr}>
|
<span className={styles.abbr}>
|
||||||
<br />
|
<br />
|
||||||
<Trans i18nKey={'comment_too_long'} shouldUnescape={true} components={{ 1: <Link to={`/p/${subplebbitAddress}/c/${cid}`} /> }} />
|
<Trans
|
||||||
|
i18nKey={'comment_too_long'}
|
||||||
|
shouldUnescape={true}
|
||||||
|
components={{ 1: <Link to={`/p/${subplebbitAddress}/${isDescription ? 'description' : isRules ? 'rules' : `c/${cid}`}`} /> }}
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{!cid && state === 'pending' && stateString !== 'Failed' && (
|
{!cid && state === 'pending' && stateString !== 'Failed' && (
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ const ReplyBacklinks = ({ post }: PostProps) => {
|
|||||||
const PostMessageMobile = ({ post }: PostProps) => {
|
const PostMessageMobile = ({ post }: PostProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
|
const { cid, content, deleted, edit, original, parentCid, postCid, reason, removed, state, subplebbitAddress } = post || {};
|
||||||
|
const { isDescription, isRules } = post || {}; // custom properties, not from api
|
||||||
// TODO: commentAuthor is not available outside of editedComment, update when available
|
// TODO: commentAuthor is not available outside of editedComment, update when available
|
||||||
// const banned = !!post?.commentAuthor?.banExpiresAt;
|
// const banned = !!post?.commentAuthor?.banExpiresAt;
|
||||||
const [showOriginal, setShowOriginal] = useState(false);
|
const [showOriginal, setShowOriginal] = useState(false);
|
||||||
@@ -244,7 +245,11 @@ const PostMessageMobile = ({ post }: PostProps) => {
|
|||||||
{!isReply && content.length > 1000 && !isInPostView && (
|
{!isReply && content.length > 1000 && !isInPostView && (
|
||||||
<span className={styles.abbr}>
|
<span className={styles.abbr}>
|
||||||
<br />
|
<br />
|
||||||
<Trans i18nKey={'comment_too_long'} shouldUnescape={true} components={{ 1: <Link to={`/p/${subplebbitAddress}/c/${cid}`} /> }} />
|
<Trans
|
||||||
|
i18nKey={'comment_too_long'}
|
||||||
|
shouldUnescape={true}
|
||||||
|
components={{ 1: <Link to={`/p/${subplebbitAddress}/${isDescription ? 'description' : isRules ? 'rules' : `c/${cid}`}`} /> }}
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{!cid && state === 'pending' && stateString !== 'Failed' && (
|
{!cid && state === 'pending' && stateString !== 'Failed' && (
|
||||||
|
|||||||
Reference in New Issue
Block a user