Skip to content

Commit

Permalink
adjust imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed Jun 11, 2024
1 parent 54a4bb0 commit cab88b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/__tests__/NotFound.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { vi } from 'vitest'
import { render, screen } from '@testing-library/react'
import NotFound from '@/components/NotFound'
import NotFound from '@/pages/NotFound'

vi.mock('react-router', () => ({
useNavigate: vi.fn(),
Expand Down
19 changes: 7 additions & 12 deletions frontend/src/routes/protected-routes.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import { FC } from "react";
import { Navigate, Outlet } from "react-router-dom";
import Roles from "../roles";
import Dashboard from "@/components/Dashboard";
import { Layout } from "@/components/Layout";
import { FC } from 'react'
import { Navigate } from 'react-router-dom'
import Roles from '../roles'
import Dashboard from '@/pages/Dashboard'

export const ProtectedRoutes: FC<{ roles: Array<Roles> }> = () => {
let auth = { token: true }
return auth.token ? (
<Dashboard/>
) : (
<Navigate to="/not-authorized" />
)
}
let auth = { token: true }
return auth.token ? <Dashboard /> : <Navigate to="/not-authorized" />
}

0 comments on commit cab88b0

Please sign in to comment.