Added a wrapper Markdown Rendered to render BOTH Emojis and Mardown as HTML

This commit is contained in:
SuperChamp234 2022-01-14 14:39:21 +05:30
parent 916236db5d
commit 88fdde519d
17 changed files with 65 additions and 41 deletions

View file

@ -1,15 +1,16 @@
import Emoji from "react-emoji-render";
import * as React from "react";
import ReactMarkdown from "react-markdown";
import DailySubTasks from "./DailySubTasks";
import renderMarkdown from "../markdownRender";
function DailyItem(props: any) {
var text_html = renderMarkdown(props.daily_text);
var note_html = renderMarkdown(props.daily_notes);
return (
<div className="todo-item" id={props.id}>
<input type="checkbox" className="checkbox" id={props.id} onChange={props.onChange} checked={props.completed} />
<div>
<p><Emoji text={props.daily_text}></Emoji></p>
<ReactMarkdown className="description" children={props.daily_notes} />
<p><span dangerouslySetInnerHTML={{__html: text_html}}></span></p>
<div className="description" dangerouslySetInnerHTML={{__html: note_html}}></div>
{console.log(props.checklist)}
<DailySubTasks subtasks={props.daily_subtasks} onChange={props.onChange}></DailySubTasks>
</div>