add markdown render

This commit is contained in:
kkzzhizhou 2021-11-20 17:11:13 +08:00
parent 9b15bb1236
commit e45182547f
14 changed files with 53 additions and 28 deletions

View file

@ -1,5 +1,6 @@
import Emoji from "react-emoji-render";
import * as React from "react";
import ReactMarkdown from "react-markdown";
function HabitItem(props: any) {
return (
@ -10,8 +11,10 @@ function HabitItem(props: any) {
<button className="habit-minus" id={"mins" + props.id} onClick={props.onChange}>
-{props.downCount}
</button>
<p className="habit-text"><Emoji text={props.habit_text}></Emoji></p>
<div>
<p className="habit-text"><Emoji text={props.habit_text}></Emoji></p>
<ReactMarkdown children={props.habit_notes} />
</div>
</div>
)
}