-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathApp.js
40 lines (38 loc) · 1.21 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
// App.js
import React from 'react';
import { AuthProvider } from './components/AuthContext';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import AppLayout from './components/layout/AppLayout';
import Users from './pages/Users';
import Blank from './components/layout/Blank';
import Matches from './components/matches/Matches';
import ProtectedRoute from './components/layout/ProtectedRoute';
const App = () => (
<AuthProvider>
<BrowserRouter>
<Routes>
<Route path="/" element={<AppLayout />}>
<Route index element={<Blank />} />
<Route
path="users"
element={
<ProtectedRoute allowedRoles={['padel-users-admin']}>
<Users />
</ProtectedRoute>
}
/>
<Route
path="matches"
element={
<ProtectedRoute allowedRoles={['padel-users-admin', 'padel-user']}>
<Matches />
</ProtectedRoute>
}
/>
{/* Asegúrate de que todas las demás rutas también estén correctamente anidadas aquí */}
</Route>
</Routes>
</BrowserRouter>
</AuthProvider>
);
export default App;