From 88511f1016c1d66cf217f02881b4fe1aae604042 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Fri, 14 Jul 2023 09:17:09 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(chatMessage):=20adjust=20cla?= =?UTF-8?q?ssName=20to=20fix=20layout=20issue=20in=20ChatMessage=20compone?= =?UTF-8?q?nt=20=F0=9F=94=A7=20fix(genericModal):=20reformat=20import=20st?= =?UTF-8?q?atements=20and=20fix=20indentation=20in=20GenericModal=20compon?= =?UTF-8?q?ent=20=F0=9F=94=A7=20fix(genericModal):=20adjust=20className=20?= =?UTF-8?q?to=20fix=20layout=20issue=20in=20GenericModal=20component=20?= =?UTF-8?q?=F0=9F=94=A7=20fix(genericModal):=20fix=20indentation=20and=20a?= =?UTF-8?q?dd=20missing=20closing=20tag=20in=20GenericModal=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modals/formModal/chatMessage/index.tsx | 2 +- .../src/modals/genericModal/index.tsx | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/frontend/src/modals/formModal/chatMessage/index.tsx b/src/frontend/src/modals/formModal/chatMessage/index.tsx index 9affce87e..953aed530 100644 --- a/src/frontend/src/modals/formModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/formModal/chatMessage/index.tsx @@ -81,7 +81,7 @@ export default function ChatMessage({ remarkPlugins={[remarkGfm, remarkMath]} rehypePlugins={[rehypeMathjax]} className="markdown prose inline-block break-words text-primary - dark:prose-invert sm:max-w-[30vw] lg:max-w-[40vw] sm:w-[30vw] lg:w-[40vw]" + dark:prose-invert sm:w-[30vw] sm:max-w-[30vw] lg:w-[40vw] lg:max-w-[40vw]" components={{ code: ({ node, diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx index b76a71c4b..fa26af1be 100644 --- a/src/frontend/src/modals/genericModal/index.tsx +++ b/src/frontend/src/modals/genericModal/index.tsx @@ -6,7 +6,11 @@ import { Badge } from "../../components/ui/badge"; import { Button } from "../../components/ui/button"; import { DialogTitle } from "../../components/ui/dialog"; import { Textarea } from "../../components/ui/textarea"; -import { MAX_WORDS_HIGHLIGHT, PROMPT_DIALOG_SUBTITLE, TEXT_DIALOG_SUBTITLE } from "../../constants"; +import { + MAX_WORDS_HIGHLIGHT, + PROMPT_DIALOG_SUBTITLE, + TEXT_DIALOG_SUBTITLE, +} from "../../constants"; import { alertContext } from "../../contexts/alertContext"; import { darkContext } from "../../contexts/darkContext"; import { PopUpContext } from "../../contexts/popUpContext"; @@ -120,15 +124,16 @@ export default function GenericModal({ ); }; - function getClassByNumberLength(){ + function getClassByNumberLength() { let sumOfCaracteres: number = 0; - wordsHighlight.forEach(element => { - sumOfCaracteres = sumOfCaracteres + element.replace(/[{}]/g, "").length + wordsHighlight.forEach((element) => { + sumOfCaracteres = sumOfCaracteres + element.replace(/[{}]/g, "").length; }); - return sumOfCaracteres > MAX_WORDS_HIGHLIGHT ? "code-highlight" : "code-nohighlight" + return sumOfCaracteres > MAX_WORDS_HIGHLIGHT + ? "code-highlight" + : "code-nohighlight"; } - function validatePrompt(closeModal: boolean) { postValidatePrompt(field_name, inputValue, nodeClass) .then((apiReturn) => { @@ -234,7 +239,10 @@ export default function GenericModal({
{type === TypeModal.PROMPT && (
-
+