Remoção de e comentário de variáves não utilizadas do frontend

pull/1/head
adriano 2022-02-11 09:54:22 -03:00
parent 5d22b772d1
commit 737d6f6a46
9 changed files with 39 additions and 50 deletions

View File

@ -2,7 +2,7 @@ import React from "react";
import { makeStyles } from "@material-ui/core/styles";
import Container from "@material-ui/core/Container";
import { colors } from "@material-ui/core";
//import { colors } from "@material-ui/core";
const useStyles = makeStyles((theme) => ({
mainContainer: {

View File

@ -310,7 +310,8 @@ const MessageInput = ({ ticketStatus }) => {
setReplyingMessage(null);
};
const handleStartRecording = async () => {
const handleStartRecording = async () => {
setLoading(true);
try {
await navigator.mediaDevices.getUserMedia({ audio: true });

View File

@ -363,8 +363,8 @@ const MessagesList = ({ ticketId, isGroup }) => {
socket.on("appMessage", (data) => {
if (data.action === "create") {
dispatch({ type: "ADD_MESSAGE", payload: data.message });
dispatch({ type: "ADD_MESSAGE", payload: data.message });
console.log('* NOVA MENSAGEM CAP: ', data.message)
scrollToBottom();
@ -421,6 +421,7 @@ const MessagesList = ({ ticketId, isGroup }) => {
return <ModalImageCors imageUrl={message.mediaUrl} />;
}
if (message.mediaType === "audio") {
return (
<audio controls>
<source src={message.mediaUrl} type="audio/ogg"></source>

View File

@ -6,9 +6,9 @@ import React, { Fragment, useState } from "react";
import DateFnsUtils from '@date-io/date-fns'; // choose your lib
import {
KeyboardDatePicker,
DatePicker,
TimePicker,
DateTimePicker,
// DatePicker,
//TimePicker,
//DateTimePicker,
MuiPickersUtilsProvider,
} from '@material-ui/pickers';

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect, useRef} from "react";
import React, { useState, useRef} from "react";
import { CSVLink } from "react-csv";
import Button from '@mui/material/Button';
@ -17,28 +17,21 @@ const data = [
const ExportCSV = (props) => {
const [header, setHeader] = useState([])
const [dataRow, setDataRow] = useState([])
const csvLink = useRef()
const ExportCSV = (props) => {
const csvLink = useRef()
let headerFormat = JSON.parse(JSON.stringify(props.columns).split('"field":').join('"key":'))
headerFormat = JSON.parse(JSON.stringify(headerFormat).split('"title":').join('"label":'))
//const dataRows = props.data.map((row) => { return { ...row }});
const [header, /*setHeader*/] = useState(headerFormat)
const [dataRow, /*setDataRow*/] = useState(props.data)
// const dataRows = props.data.map((obj)=>{
// return {'fromMe': obj.fromMe, 'body': obj.body.replace(/ /g,''), 'createdAt': obj.createdAt}
// })
//console.log('******************************* dataRows: ',dataRows)
useEffect(()=>{
setHeader(headerFormat)
setDataRow(props.data)
},[])
//useEffect(()=>{
// setHeader(headerFormat)
// setDataRow(props.data)
// },[])
const getTransactionData = async () => {

View File

@ -7,11 +7,11 @@ import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import DataGridTable from '../Table';
//import DataGridTable from '../Table';
import MTable from "../MTable";
import ExportCSV from '../ExportCSV'
import { margin } from '@mui/system';
//import { margin } from '@mui/system';
let columns = [
{
@ -44,7 +44,9 @@ let columns = [
const Modal = (props) => {
const [open, setOpen] = React.useState(true);
const [scroll, setScroll] = React.useState('paper');
const [scroll, /*setScroll*/] = React.useState('paper');
const dataChat = props.data.map((dt) => {
return {

View File

@ -127,7 +127,7 @@ const DataGridTable = (props) => {
onCellKeyDown = {(params, event) => {
if(event.key.toString().toLowerCase() == 'enter'){
if(event.key.toString().toLowerCase() === 'enter'){
alert(params.value)
}

View File

@ -25,7 +25,7 @@ import { AuthContext } from "../context/Auth/AuthContext";
import BackdropLoading from "../components/BackdropLoading";
import { i18n } from "../translate/i18n";
import MailLogo from '../assets/logo.jpg';
//import MailLogo from '../assets/logo.jpg';
const drawerWidth = 240;

View File

@ -2,10 +2,10 @@ import React, { useState, useEffect, useReducer, useContext} from "react";
import MainContainer from "../../components/MainContainer";
import api from "../../services/api";
import SelectField from "../../components/Report/SelectField";
import { data } from '../../components/Report/MTable/data';
//import { data } from '../../components/Report/MTable/data';
import DatePicker1 from '../../components/Report/DatePicker'
import DatePicker2 from '../../components/Report/DatePicker'
import { Button } from "@material-ui/core";
//import { Button } from "@material-ui/core";
import MTable from "../../components/Report/MTable";
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
@ -159,12 +159,12 @@ const Report = () => {
const { user: userA } = useContext(AuthContext);
//--------
const [searchParam, setSearchParam] = useState("");
const [loading, setLoading] = useState(false);
const [hasMore, setHasMore] = useState(false);
const [searchParam] = useState("");
//const [loading, setLoading] = useState(false);
//const [hasMore, setHasMore] = useState(false);
const [pageNumber, setPageNumber] = useState(1);
const [users, dispatch] = useReducer(reducer, []);
const [columns, setColums] = useState([])
//const [columns, setColums] = useState([])
const [startDate, setDatePicker1] = useState(new Date())
const [endDate, setDatePicker2] = useState(new Date())
const [userId, setUser] = useState(null)
@ -178,7 +178,7 @@ const Report = () => {
}, [searchParam]);
useEffect(() => {
setLoading(true);
//setLoading(true);
const delayDebounceFn = setTimeout(() => {
@ -189,8 +189,8 @@ const Report = () => {
});
dispatch({ type: "LOAD_USERS", payload: data.users });
setHasMore(data.hasMore);
setLoading(false);
//setHasMore(data.hasMore);
//setLoading(false);
} catch (err) {
console.log(err);
}
@ -206,7 +206,7 @@ const Report = () => {
useEffect(() => {
setLoading(true);
//setLoading(true);
const delayDebounceFn = setTimeout(() => {
@ -217,7 +217,7 @@ const Report = () => {
dispatchQ({ type: "RESET" })
dispatchQ({ type: "LOAD_QUERY", payload: dataQuery.data });
setLoading(false);
//setLoading(false);
} catch (err) {
console.log(err);
@ -249,15 +249,7 @@ const textFieldSelectUser = (data) => {
console.log('textField: ',data);
setUser(data)
}
function handleQuery (){
console.log('startDate: ', startDate)
console.log('endDate: ', endDate)
console.log('userid: ', userId)
}
return (