Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
  • Loading branch information
Dragodui committed Jan 8, 2024
1 parent 35765a1 commit 1f287a8
Show file tree
Hide file tree
Showing 55 changed files with 4,399 additions and 4,098 deletions.
46 changes: 26 additions & 20 deletions EUniversity/ClientApp/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@ import React from 'react';
import { Route, Routes } from 'react-router-dom';
import AppRoutes from './AppRoutes';
import AuthorizeRoute from './components/api-authorization/AuthorizeRoute';
import Layout from "./components/Layout";
import Layout from './components/Layout';
import './styles/style.css';
import './styles/index.css';
import Login from "./components/Pages/Login";
import Login from './components/Pages/Login';

const App = () => {
return (
<Layout>
<Routes>
<Route path="/login" element={<Login/>} />
{AppRoutes.map((route, index) => {
const { element, requireAuth, ...rest } = route;
return (
<Route
key={index}
{...rest}
element={requireAuth ? <AuthorizeRoute {...rest} element={element} /> : element}
/>
);
})}
</Routes>
</Layout>
);
return (
<Layout>
<Routes>
<Route path='/login' element={<Login />} />
{AppRoutes.map((route, index) => {
const { element, requireAuth, ...rest } = route;
return (
<Route
key={index}
{...rest}
element={
requireAuth ? (
<AuthorizeRoute {...rest} element={element} />
) : (
element
)
}
/>
);
})}
</Routes>
</Layout>
);
};
App.displayName = 'App';

export default App;
export default App;
46 changes: 23 additions & 23 deletions EUniversity/ClientApp/src/AppRoutes.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,95 @@
import ApiAuthorzationRoutes from './components/api-authorization/ApiAuthorizationRoutes';
import Home from "./components/Pages/Home";
import Login from "./components/Pages/Login";
import ChangePassword from "./components/Pages/ChangePassword";
import AdminUsers from "./components/Pages/AdminUsers";
import Home from './components/Pages/Home';
import Login from './components/Pages/Login';
import ChangePassword from './components/Pages/ChangePassword';
import AdminUsers from './components/Pages/AdminUsers';
import AdminGroups from './components/Pages/AdminGroups';
import AdminGroup from "./components/Pages/AdminGroup";
import AdminCourses from "./components/Pages/AdminCourses";
import AdminGroup from './components/Pages/AdminGroup';
import AdminCourses from './components/Pages/AdminCourses';
import AdminClassrooms from './components/Pages/AdminClassrooms';
import AdminClassroom from './components/Pages/AdminClassroom';
import ProfilePage from './components/Pages/ProfilePage';
import AdminSemesters from './components/Pages/AdminSemesters';
import AdminSemester from "./components/Pages/AdminSemester";
import AdminSemester from './components/Pages/AdminSemester';
import AdminClasses from './components/Pages/AdminClasses';
import AdminClass from './components/Pages/AdminClass';
import ActivityTypes from './components/Pages/ActivityTypes';

const AppRoutes = [
{
index: true,
element: <Home />
element: <Home />,
},
{
path: '/change-password',
requireAuth: true,
element: <ChangePassword />
element: <ChangePassword />,
},
{
path: '/login',
element: <Login/>
element: <Login />,
},
{
path: '/users',
requireAuth: true,
element: <AdminUsers/>,
element: <AdminUsers />,
},
{
path: '/groups',
requireAuth: true,
element: <AdminGroups/>,
element: <AdminGroups />,
},
{
path: '/groups/:id',
requireAuth: true,
element: <AdminGroup/>,
element: <AdminGroup />,
},
{
path: '/courses',
requireAuth: true,
element: <AdminCourses/>,
element: <AdminCourses />,
},
{
path: '/classrooms',
requireAuth: true,
element: <AdminClassrooms/>,
element: <AdminClassrooms />,
},
{
path: '/classrooms/:id',
requireAuth: true,
element: <AdminClassroom/>,
element: <AdminClassroom />,
},
{
path: '/semesters',
requireAuth: true,
element: <AdminSemesters/>,
element: <AdminSemesters />,
},
{
path: '/semesters/:id',
requireAuth: true,
element: <AdminSemester/>,
element: <AdminSemester />,
},
{
path: '/profile',
requireAuth: true,
element: <ProfilePage/>,
element: <ProfilePage />,
},
{
path: '/classes',
requireAuth: true,
element: <AdminClasses/>,
element: <AdminClasses />,
},
{
path: '/classes/:id',
requireAuth: true,
element: <AdminClass/>,
element: <AdminClass />,
},
{
path: '/activityTypes',
requireAuth: true,
element: <ActivityTypes/>,
element: <ActivityTypes />,
},
...ApiAuthorzationRoutes
...ApiAuthorzationRoutes,
];

export default AppRoutes;
Loading

0 comments on commit 1f287a8

Please sign in to comment.