From 2668eaaf3d0a03be958a20afb35f200e420d05ed Mon Sep 17 00:00:00 2001 From: adriano Date: Sun, 27 Feb 2022 18:04:31 -0300 Subject: [PATCH] =?UTF-8?q?Adi=C3=A7=C3=A3o=20completa=20de=20componentes?= =?UTF-8?q?=20de=20para=20agendamento=20ao=20finalizar=20o=20atendimento?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 4 +- .../components/ChatEnd/ModalChatEnd/index.js | 55 ++++++++++--------- .../src/components/ChatEnd/TextArea/index.js | 12 +++- frontend/src/components/Ticket/index.js | 2 + 4 files changed, 43 insertions(+), 30 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index d7d31a3..80e12d7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,8 +5,8 @@ "dependencies": { "@date-io/date-fns": "^1.3.13", "@emotion/react": "^11.7.1", - "@emotion/styled": "^11.6.0", - "@material-ui/core": "^4.11.0", + "@emotion/styled": "^11.6.0", + "@material-ui/core": "^4.12.1", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/pickers": "^3.3.10", diff --git a/frontend/src/components/ChatEnd/ModalChatEnd/index.js b/frontend/src/components/ChatEnd/ModalChatEnd/index.js index 5889331..956a073 100644 --- a/frontend/src/components/ChatEnd/ModalChatEnd/index.js +++ b/frontend/src/components/ChatEnd/ModalChatEnd/index.js @@ -63,6 +63,7 @@ const Modal = (props) => { const [timerPicker, setTimerPicker] = useState(new Date()) const [textArea1, setTextArea1] = useState() const [textArea2, setTextArea2] = useState() + const [textFieldCpfCnpj, setTextField] = useState() const [data] = useState([ {'id': 1, 'name': 'STATUS1'}, @@ -79,6 +80,15 @@ const Modal = (props) => { setOpen(false); }; + const handleChatEnd = (event, reason) => { + + if (reason && reason === "backdropClick") + return; + + setOpen(false); + }; + + const descriptionElementRef = useRef(null); useEffect(() => { if (open) { @@ -120,6 +130,12 @@ const textArea2Value = (data) => { setTextArea2(data) } + +const handleTextFieldChange = (event) => { + + console.log('CPF/CNPJ: ',(event.target.value)); + setTextField(event.target.value); +}; return ( @@ -154,26 +170,7 @@ const textArea2Value = (data) => { height: 430, // backgroundColor: 'primary.dark', // '&:hover': {backgroundColor: 'primary.main', opacity: [0.9, 0.8, 0.7],}, - }}> - - - {/* - - - {return {'value': obj.id, 'label': obj.name}})} - /> - - - - - - */} - + }}> { maxWidth: '100%', }} > - + @@ -215,13 +220,13 @@ const textArea2Value = (data) => { - {/* + - */} + @@ -231,9 +236,9 @@ const textArea2Value = (data) => {
-
footer
+
- +
diff --git a/frontend/src/components/ChatEnd/TextArea/index.js b/frontend/src/components/ChatEnd/TextArea/index.js index ce1f90f..8799f27 100644 --- a/frontend/src/components/ChatEnd/TextArea/index.js +++ b/frontend/src/components/ChatEnd/TextArea/index.js @@ -1,13 +1,19 @@ -import * as React from 'react'; +import React, { useState, useEffect } from "react"; import TextareaAutosize from '@mui/material/TextareaAutosize'; const MinHeightTextarea = (props) => { - const [value, setValue] = React.useState(''); + const [value, setValue] = useState(''); - props.func(value); + // props.func(value); + + useEffect(()=>{ + + props.func(value); + + }, [value]) const handleChange = (event) => { setValue(event.target.value); diff --git a/frontend/src/components/Ticket/index.js b/frontend/src/components/Ticket/index.js index f5b041b..6b9a58f 100644 --- a/frontend/src/components/Ticket/index.js +++ b/frontend/src/components/Ticket/index.js @@ -88,6 +88,8 @@ const Ticket = () => { const delayDebounceFn = setTimeout(() => { const fetchTicket = async () => { try { + + const { data } = await api.get("/tickets/" + ticketId); setContact(data.contact);