Skip to content

Commit

Permalink
[GH-240]:Fixed issue #240 edited the pretext of custom post (#287)
Browse files Browse the repository at this point in the history
* [MI-2825]:Fixed issue #240 edited the pretext (#5)

* [MM-240]: Added support to render post markdown.

---------

Co-authored-by: Abhishek Verma <[email protected]>
  • Loading branch information
Kshitij-Katiyar and avas27JTG authored Oct 27, 2023
1 parent f50692b commit a44bfe7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions webapp/src/components/post_type_zoom/post_type_zoom.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ export default class PostTypeZoom extends React.PureComponent {
};
}

renderPostWithMarkdown(post) {
const {formatText, messageHtmlToComponent} = window.PostUtils;
const markdownOptions = {
atMentions: true,
};

return messageHtmlToComponent(
formatText(post, markdownOptions),
false,
);
}

render() {
const style = getStyle(this.props.theme);
const post = this.props.post;
Expand All @@ -79,7 +91,7 @@ export default class PostTypeZoom extends React.PureComponent {
let content;
let subtitle;
if (props.meeting_status === 'STARTED') {
preText = 'I have started a meeting';
preText = this.renderPostWithMarkdown(post.message);
if (this.props.fromBot) {
preText = `${this.props.creatorName} has started a meeting`;
}
Expand Down Expand Up @@ -127,7 +139,7 @@ export default class PostTypeZoom extends React.PureComponent {
);
}
} else if (props.meeting_status === 'ENDED') {
preText = 'The meeting has ended';
preText = this.renderPostWithMarkdown(post.message);
if (this.props.fromBot) {
preText = `${this.props.creatorName} has ended the meeting`;
}
Expand Down

0 comments on commit a44bfe7

Please sign in to comment.