fix(post mobile): tooltip for title wasn't centered

This commit is contained in:
Tom (plebeius.eth)
2024-09-04 16:35:47 +02:00
parent fcd1ce65fb
commit ca0020f2c5
2 changed files with 16 additions and 10 deletions
+12 -9
View File
@@ -130,15 +130,18 @@ const PostInfoAndMedia = ({ openReplyModal, post, postReplyCount = 0, roles }: P
<img src='assets/icons/closed.gif' alt='' className={styles.closedIcon} title={t('closed')} />
</span>
)}
{title &&
(title.length <= 30 ? (
<span className={styles.subject}>{title}</span>
) : (
<Tooltip
children={<span className={styles.subject}>{title.slice(0, 30) + '(...)'}</span>}
content={title.length < 1000 ? title : title.slice(0, 1000) + `... ${t('title_too_long')}`}
/>
))}
{title && (
<span className={styles.subjectWrapper}>
{title.length <= 30 ? (
<span className={styles.subject}>{title}</span>
) : (
<Tooltip
children={<span className={styles.subject}>{title.slice(0, 30) + '(...)'}</span>}
content={title.length < 1000 ? title : title.slice(0, 1000) + `... ${t('title_too_long')}`}
/>
)}
</span>
)}
</span>
<span className={styles.dateTimePostNum}>
{subplebbitAddress && (isInAllView || isInSubscriptionsView) && !isReply && (
+4 -1
View File
@@ -303,13 +303,16 @@
padding: 0 13px;
}
.postMobile .nameBlock .subjectWrapper {
display: block;
}
.postMobile .nameBlock .subject {
color: var(--post-mobile-subject-text-color);
font-weight: var(--post-mobile-subject-font-weight);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: block;
}
.postMobile .dateTimePostNum {