perf: md rendering only if preview

This commit is contained in:
Artemy 2022-10-17 17:21:43 +03:00
parent f6a7d6fdd3
commit f4fb0d8894
2 changed files with 9 additions and 9 deletions

View file

@ -14,7 +14,7 @@ function Menu() {
<MagnifyingGlassCircleIcon className="transform translate-z-0 h-7 w-7" />
}
>
Записки
Заметки
</IconWithButton>
</Button>
<Button href="/">

View file

@ -12,7 +12,7 @@ function CreateNote() {
<div>
<div className="grid grid-cols-1 lg:grid-cols-2">
<h2 className="font-medium text-center lg:text-left leading-tight text-4xl mt-0 mb-2">
Написать записку
Написать заметку
</h2>
<CheckBox
className="justify-self-center lg:justify-self-end"
@ -22,11 +22,11 @@ function CreateNote() {
/>
</div>
{preview && (
<div className="w-full md">
<ReactMarkdown className={!preview ? "hidden" : ""}>
{text}
</ReactMarkdown>
<ReactMarkdown>{text}</ReactMarkdown>
</div>
)}
<textarea
className={`
@ -54,7 +54,7 @@ function CreateNote() {
${preview ? "hidden" : ""}
`}
rows="10"
placeholder="Ваша записка начинается здесь. Можно использовать markdown..."
placeholder="Ваша заметка начинается здесь. Можно использовать markdown..."
maxLength={5000}
onChange={(e) => {
setText(e.target.value);
@ -63,7 +63,7 @@ function CreateNote() {
<div className="grid grid-cols-1 lg:grid-cols-2 justify-items-center w-full">
<CheckBox
className="justify-self-center lg:justify-self-start"
label="Публичная записка"
label="Публичная заметка"
id="public"
onClick={""}
checked