Skip to content

Commit

Permalink
adjust routes
Browse files Browse the repository at this point in the history
  • Loading branch information
janderson-souza authored Nov 15, 2023
1 parent dfa217e commit a6eb897
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/Layouts/ProtectedLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const ProtectedLayout = () => {
const navigate = useNavigate();

useEffect(() => {
if (!user) navigate('/login');
if (!user) navigate('/sl/admin/login');
}, [user, navigate]);

const flexDir = useBreakpointValue({ base: 'column', md: 'row' }) as 'column' | 'row';
Expand Down
14 changes: 7 additions & 7 deletions src/components/Navbar/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ export const MenuItems = [
{
icon: 'chart-line',
label: 'dashboard',
route: '/',
route: '/sl/admin/',
},
{
label: 'questionnaire',
subItems: [
{
icon: 'document-layout-right',
label: 'teaching-practices',
route: '/teaching-practices',
route: '/sl/admin/teaching-practices',
},
{
icon: 'clipboard-notes',
label: 'coaching-sessions',
route: '/coaching-sessions',
route: '/sl/admin/coaching-sessions',
},
],
},
Expand All @@ -25,22 +25,22 @@ export const MenuItems = [
{
icon: 'university',
label: 'schools',
route: '/schools',
route: '/sl/admin/schools',
},
{
icon: 'calender',
label: 'coaches-over-time',
route: '/coach-over-time',
route: '/sl/admin/coach-over-time',
},
{
icon: 'folder',
label: 'session-data',
route: '/session-data',
route: '/sl/admin/session-data',
},
{
icon: 'sync',
label: 'syncs',
route: '/syncs',
route: '/sl/admin/syncs',
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const UserCard: React.FC<Props> = ({ name, email, logout }) => {
}, [name]);

const handleSettings = () => {
navigate("/settings");
navigate("/sl/admin/settings");
};

return (
Expand Down
4 changes: 2 additions & 2 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Router = () => {
<Routes location={location} key={location.pathname}>
{!user ? (
<>
<Route path="/" element={<Login />} />
<Route path="/sl/admin" element={<Login />} />
</>
) : (
<Route path="/sl/admin" element={<ProtectedLayout />}>
Expand All @@ -41,7 +41,7 @@ export const Router = () => {
<Route path="syncs" element={<SyncsPage />} />
</Route>
)}
<Route path="*" element={<Navigate to="/" replace />} />
<Route path="*" element={<Navigate to="/sl/admin" replace />} />
</Routes>
</AnimatePresence>
);
Expand Down

0 comments on commit a6eb897

Please sign in to comment.