mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-17 19:37:02 +00:00
improvement: better names in pages, folders and routes
This commit is contained in:
@@ -22,7 +22,7 @@ If a contact sent a new message in less than 2 hours interval, and there is no t
|
||||
|
||||
## Screenshots
|
||||
|
||||
<img src="https://raw.githubusercontent.com/canove/whaticket/master/images/chat2.png" width="350"> <img src="https://raw.githubusercontent.com/canove/whaticket/master/images/chat3.png" width="350">
|
||||
<img src="https://raw.githubusercontent.com/canove/whaticket/master/images/tickets2.png" width="350"> <img src="https://raw.githubusercontent.com/canove/whaticket/master/images/tickets3.png" width="350">
|
||||
|
||||
## Demo
|
||||
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@ const MainListItems = () => {
|
||||
<div>
|
||||
<ListItemLink to="/" primary="Dashboard" icon={<DashboardIcon />} />
|
||||
<ListItemLink
|
||||
to="/whats-auth"
|
||||
to="/connection"
|
||||
primary={i18n.t("mainDrawer.listItems.connection")}
|
||||
icon={<SyncAltIcon />}
|
||||
/>
|
||||
<ListItemLink
|
||||
to="/chat"
|
||||
to="/tickets"
|
||||
primary={i18n.t("mainDrawer.listItems.tickets")}
|
||||
icon={<WhatsAppIcon />}
|
||||
/>
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ const WhatsAuth = () => {
|
||||
if (data.action === "authentication") {
|
||||
setQrCode("");
|
||||
setSession(data.session);
|
||||
history.push("/chat");
|
||||
history.push("/tickets");
|
||||
}
|
||||
});
|
||||
|
||||
0
frontend/src/pages/Settings/index.js
Normal file
0
frontend/src/pages/Settings/index.js
Normal file
@@ -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 = () => {
|
||||
<Route exact path="/signup" component={Signup} />
|
||||
<MainDrawer>
|
||||
<Route exact path="/" component={Dashboard} isPrivate />
|
||||
<Route exact path="/chat/:ticketId?" component={Chat} isPrivate />
|
||||
<Route exact path="/whats-auth" component={WhatsAuth} isPrivate />
|
||||
<Route
|
||||
exact
|
||||
path="/tickets/:ticketId?"
|
||||
component={Tickets}
|
||||
isPrivate
|
||||
/>
|
||||
<Route exact path="/connection" component={Connection} isPrivate />
|
||||
<Route exact path="/contacts" component={Contacts} isPrivate />
|
||||
<Route exact path="/users" component={Users} isPrivate />
|
||||
</MainDrawer>
|
||||
|
||||
Reference in New Issue
Block a user