mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
Finished AuthContext
This commit is contained in:
@@ -1,60 +1,10 @@
|
||||
import React from "react";
|
||||
import { BrowserRouter, Route, Switch } from "react-router-dom";
|
||||
import { toast, ToastContainer } from "react-toastify";
|
||||
import Routes from "./routes";
|
||||
|
||||
import Dashboard from "./pages/Home/Dashboard";
|
||||
import Chat from "./pages/Chat/Chat";
|
||||
import Profile from "./pages/Profile/Profile";
|
||||
import Signup from "./pages/Signup/Signup";
|
||||
import Login from "./pages/Login/Login";
|
||||
import "./App.css";
|
||||
|
||||
const App = () => {
|
||||
const showToast = (type, message) => {
|
||||
switch (type) {
|
||||
case 0:
|
||||
toast.warning(message);
|
||||
break;
|
||||
case 1:
|
||||
toast.success(message);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<ToastContainer
|
||||
autoClose={2000}
|
||||
hideProgressBar={true}
|
||||
position={toast.POSITION.TOP_CENTER}
|
||||
/>
|
||||
<Switch>
|
||||
<Route exact path="/" render={props => <Dashboard />} />
|
||||
<Route
|
||||
exact
|
||||
path="/login"
|
||||
render={props => <Login showToast={showToast} />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/profile"
|
||||
render={props => <Profile showToast={showToast} />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/signup"
|
||||
render={props => <Signup showToast={showToast} />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/chat"
|
||||
render={props => <Chat showToast={showToast} />}
|
||||
/>
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
);
|
||||
return <Routes />;
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in New Issue
Block a user