[Comments] Batch resolve #7236

Merged
saltrafael merged 17 commits from batch-resolve into master 2021-10-11 03:42:10 +02:00
2 changed files with 15 additions and 4 deletions
Showing only changes of commit b455e807bc - Show all commits

View file

@ -42,6 +42,7 @@ type MarkdownProps = {
className?: string, className?: string,
parentCommentId?: string, parentCommentId?: string,
isMarkdownPost?: boolean, isMarkdownPost?: boolean,
disableTimestamps?: boolean,
stakedLevel?: number, stakedLevel?: number,
}; };
@ -132,7 +133,17 @@ function isStakeEnoughForPreview(stakedLevel) {
// **************************************************************************** // ****************************************************************************
const MarkdownPreview = (props: MarkdownProps) => { const MarkdownPreview = (props: MarkdownProps) => {
const { content, strip, simpleLinks, noDataStore, className, parentCommentId, isMarkdownPost, stakedLevel } = props; const {
content,
strip,
simpleLinks,
noDataStore,
className,
parentCommentId,
isMarkdownPost,
disableTimestamps,
stakedLevel,
} = props;
const strippedContent = content const strippedContent = content
? content.replace(REPLACE_REGEX, (iframeHtml, y, iframeSrc) => { ? content.replace(REPLACE_REGEX, (iframeHtml, y, iframeSrc) => {
// Let the browser try to create an iframe to see if the markup is valid // Let the browser try to create an iframe to see if the markup is valid
@ -217,8 +228,8 @@ const MarkdownPreview = (props: MarkdownProps) => {
// Note: The order is important // Note: The order is important
.use(formatedLinks) .use(formatedLinks)
.use(inlineLinks) .use(inlineLinks)
.use(isMarkdownPost ? null : inlineTimestamp) .use(disableTimestamps || isMarkdownPost ? null : inlineTimestamp)
.use(isMarkdownPost ? null : formattedTimestamp) .use(disableTimestamps || isMarkdownPost ? null : formattedTimestamp)
// Emojis // Emojis
.use(remarkEmoji) .use(remarkEmoji)
// Render new lines without needing spaces. // Render new lines without needing spaces.

View file

@ -104,7 +104,7 @@ function LivestreamComment(props: Props) {
)} )}
<div className="livestream-comment__text"> <div className="livestream-comment__text">
<MarkdownPreview content={message} promptLinks stakedLevel={stakedLevel} /> <MarkdownPreview content={message} promptLinks stakedLevel={stakedLevel} disableTimestamps />
</div> </div>
</div> </div>
</div> </div>