diff --git a/README.md b/README.md index bcf2b33..d0487b6 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If a contact sent a new message in less than 2 hours interval, and there is no t ## Screenshots - + ## Demo diff --git a/frontend/src/components/MessagesList/index.js b/frontend/src/components/MessagesList/index.js index 6e04f27..16f16a0 100644 --- a/frontend/src/components/MessagesList/index.js +++ b/frontend/src/components/MessagesList/index.js @@ -304,7 +304,7 @@ const MessagesList = () => { } catch (err) { console.log(err); toast.error("Ticket não encontrado"); - history.push("/chat"); + history.push("/tickets"); } }; fetchMessages(); @@ -418,7 +418,7 @@ const MessagesList = () => { } catch (err) { console.log(err); } - history.push("/chat"); + history.push("/tickets"); }; const handleDrawerOpen = () => { diff --git a/frontend/src/components/NewTicketModal/index.js b/frontend/src/components/NewTicketModal/index.js index 0f273b9..83769e2 100644 --- a/frontend/src/components/NewTicketModal/index.js +++ b/frontend/src/components/NewTicketModal/index.js @@ -85,7 +85,7 @@ const NewTicketModal = ({ modalOpen, onClose, contactId }) => { userId: userId, status: "open", }); - history.push(`/chat/${ticket.id}`); + history.push(`/tickets/${ticket.id}`); } catch (err) { alert(err); } diff --git a/frontend/src/components/NotificationsPopOver/index.js b/frontend/src/components/NotificationsPopOver/index.js index a1234f3..34917c1 100644 --- a/frontend/src/components/NotificationsPopOver/index.js +++ b/frontend/src/components/NotificationsPopOver/index.js @@ -116,7 +116,7 @@ const NotificationsPopOver = () => { notification.onclick = function (event) { event.preventDefault(); // - window.open(`/chat/${ticket.id}`, "_self"); + window.open(`/tickets/${ticket.id}`, "_self"); }; document.addEventListener("visibilitychange", () => { @@ -137,7 +137,7 @@ const NotificationsPopOver = () => { }, [setIsOpen]); const handleSelectTicket = (e, ticket) => { - history.push(`/chat/${ticket.id}`); + history.push(`/tickets/${ticket.id}`); handleClickAway(); }; diff --git a/frontend/src/components/TicketListItem/index.js b/frontend/src/components/TicketListItem/index.js index 04f3720..8494f4d 100644 --- a/frontend/src/components/TicketListItem/index.js +++ b/frontend/src/components/TicketListItem/index.js @@ -100,11 +100,11 @@ const TicketListItem = ({ ticket }) => { } catch (err) { alert(err); } - history.push(`/chat/${ticketId}`); + history.push(`/tickets/${ticketId}`); }; const handleSelectTicket = (e, ticket) => { - history.push(`/chat/${ticket.id}`); + history.push(`/tickets/${ticket.id}`); }; return ( diff --git a/frontend/src/components/TicketOptionsMenu/index.js b/frontend/src/components/TicketOptionsMenu/index.js index a3f7a5c..fc92752 100644 --- a/frontend/src/components/TicketOptionsMenu/index.js +++ b/frontend/src/components/TicketOptionsMenu/index.js @@ -18,7 +18,7 @@ const TicketOptionsMenu = ({ ticket, menuOpen, handleClose, anchorEl }) => { try { await api.delete(`/tickets/${ticket.id}`); toast.success("Ticket deletado com sucesso."); - history.push("/chat"); + history.push("/tickets"); } catch (err) { toast.error("Erro ao deletar o ticket"); } diff --git a/frontend/src/components/_layout/MainListItems.js b/frontend/src/components/_layout/MainListItems.js index 79ba541..ebfa195 100644 --- a/frontend/src/components/_layout/MainListItems.js +++ b/frontend/src/components/_layout/MainListItems.js @@ -42,12 +42,12 @@ const MainListItems = () => {
} /> } /> } /> diff --git a/frontend/src/context/Auth/useAuth.js b/frontend/src/context/Auth/useAuth.js index e7611ea..995c10b 100644 --- a/frontend/src/context/Auth/useAuth.js +++ b/frontend/src/context/Auth/useAuth.js @@ -51,7 +51,7 @@ const useAuth = () => { api.defaults.headers.Authorization = `Bearer ${res.data.token}`; setIsAuth(true); toast.success(i18n.t("auth.toasts.success")); - history.push("/chat"); + history.push("/tickets"); } catch (err) { toast.error(i18n.t("auth.toasts.fail")); } diff --git a/frontend/src/pages/WhatsAuth/WhatsAuth.js b/frontend/src/pages/Connection/index.js similarity index 94% rename from frontend/src/pages/WhatsAuth/WhatsAuth.js rename to frontend/src/pages/Connection/index.js index 3773159..9fa4a15 100644 --- a/frontend/src/pages/WhatsAuth/WhatsAuth.js +++ b/frontend/src/pages/Connection/index.js @@ -71,7 +71,7 @@ const WhatsAuth = () => { if (data.action === "authentication") { setQrCode(""); setSession(data.session); - history.push("/chat"); + history.push("/tickets"); } }); diff --git a/frontend/src/pages/Settings/index.js b/frontend/src/pages/Settings/index.js new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/pages/Chat/index.js b/frontend/src/pages/Tickets/index.js similarity index 100% rename from frontend/src/pages/Chat/index.js rename to frontend/src/pages/Tickets/index.js diff --git a/frontend/src/routes/index.js b/frontend/src/routes/index.js index 4042e26..3932021 100644 --- a/frontend/src/routes/index.js +++ b/frontend/src/routes/index.js @@ -4,10 +4,10 @@ import { ToastContainer } from "react-toastify"; import MainDrawer from "../components/_layout"; import Dashboard from "../pages/Dashboard/"; -import Chat from "../pages/Chat/"; +import Tickets from "../pages/Tickets/"; import Signup from "../pages/Signup/"; import Login from "../pages/Login/"; -import WhatsAuth from "../pages/WhatsAuth/WhatsAuth"; +import Connection from "../pages/Connection/"; import Users from "../pages/Users"; import Contacts from "../pages/Contacts/"; import { AuthProvider } from "../context/Auth/AuthContext"; @@ -22,8 +22,13 @@ const Routes = () => { - - + +