add Login view

This commit is contained in:
Patryk Drzewiński 2022-06-11 19:12:08 +02:00
parent 03a8e84e63
commit 468951d9bb
2 changed files with 50 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import Coordinator from './views/coordinator/Coordinator'
import Groups from './views/coordinator/Groups' import Groups from './views/coordinator/Groups'
import Leaders from './views/coordinator/Leaders' import Leaders from './views/coordinator/Leaders'
import Students from './views/coordinator/Students' import Students from './views/coordinator/Students'
import Login from './views/Login'
const queryClient = new QueryClient({ const queryClient = new QueryClient({
defaultOptions: { defaultOptions: {
@ -22,7 +23,8 @@ function App() {
<div> <div>
<QueryClientProvider client={queryClient}> <QueryClientProvider client={queryClient}>
<Routes> <Routes>
<Route index element={<Coordinator />} /> <Route index element={<Login />} />
<Route path="" element={<Login />} />
<Route path="coordinator" element={<Coordinator />}> <Route path="coordinator" element={<Coordinator />}>
<Route path="groups" element={<Groups />} /> <Route path="groups" element={<Groups />} />
<Route path="students" element={<Students />} /> <Route path="students" element={<Students />} />

View File

@ -0,0 +1,47 @@
import { useEffect } from 'react'
import { Outlet, useNavigate } from 'react-router-dom'
import { NavLink } from 'react-router-dom'
const Login = () => {
const navigate = useNavigate()
// useEffect(() => {
// navigate('/coordinator/students')
// // eslint-disable-next-line react-hooks/exhaustive-deps
// }, [])
return (
<>
<div className="flex items-center bg-gray-300 mt-20 py-6 px-10 shadow">
<h1 className="text-xl font-bold mx-auto">System PRI</h1>
</div>
<div className="w-full lg:w-1/4 flex flex-col mx-auto mt-20 px-10 py-5 bg-gray-300 rounded-lg shadow">
<div className="form-control">
<label className="label" htmlFor="login">
Login
</label>
<input
className="input input-bordered"
id="login"
type="text"
/>
</div>
<div className="form-control">
<label className="label" htmlFor="password">
Hasło
</label>
<input
className="input input-bordered"
id="password"
type="text"
/>
</div>
<span onClick={() => navigate('/coordinator/students')} className="cursor-pointer">Koordynator</span>
<span>Opiekun</span>
<span>Student</span>
</div>
</>
)
}
export default Login