-
Notifications
You must be signed in to change notification settings - Fork 64
/
App.js
57 lines (54 loc) · 1.53 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import { ToastContainer } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
import Header from './components/Header'
import PrivateRoute from './components/PrivateRoute'
import Home from './pages/Home'
import Login from './pages/Login'
import Register from './pages/Register'
import NewTicket from './pages/NewTicket'
import Tickets from './pages/Tickets'
import Ticket from './pages/Ticket'
// NOTE: Here we have removed the nested routing as the path is the same
function App() {
return (
<>
<Router>
<div className='container'>
<Header />
<Routes>
<Route path='/' element={<Home />} />
<Route path='/login' element={<Login />} />
<Route path='/register' element={<Register />} />
<Route
path='/new-ticket'
element={
<PrivateRoute>
<NewTicket />
</PrivateRoute>
}
/>
<Route
path='/tickets'
element={
<PrivateRoute>
<Tickets />
</PrivateRoute>
}
/>
<Route
path='/ticket/:ticketId'
element={
<PrivateRoute>
<Ticket />
</PrivateRoute>
}
/>
</Routes>
</div>
</Router>
<ToastContainer />
</>
)
}
export default App