frontend part
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import './App.css'
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import { LoginPage } from "./pages/LoginPage";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<Routes>
|
||||
<Route path="/" element={<LoginPage />} />
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
|
||||
export default App
|
||||
@@ -0,0 +1,38 @@
|
||||
import { useState, type ReactElement } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import "./AuthComponent.css";
|
||||
|
||||
export function Auth():ReactElement {
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [rememberMe, setRememberMe] = useState(false);
|
||||
|
||||
return (
|
||||
<form>
|
||||
<input
|
||||
type="email"
|
||||
value={email}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
placeholder="Email"
|
||||
required
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Password"
|
||||
required
|
||||
/>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={rememberMe}
|
||||
onChange={(e) => setRememberMe(e.target.checked)}
|
||||
/>
|
||||
Запомнить меня
|
||||
</label>
|
||||
<Link to="/forgot-password">Забыли пароль?</Link>
|
||||
<button type="submit">Войти</button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<StrictMode>
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</StrictMode>,
|
||||
)
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Auth } from "../features/auth/components/AuthComponent";
|
||||
|
||||
export function LoginPage(){
|
||||
return(
|
||||
<>
|
||||
<Auth />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
interface PermissionsOut {
|
||||
id: number
|
||||
permission: string
|
||||
}
|
||||
|
||||
interface PermissionsGroupsOut {
|
||||
id: number
|
||||
group: string
|
||||
permissions: PermissionsOut[]
|
||||
}
|
||||
|
||||
export interface UserOut {
|
||||
first_name: string
|
||||
last_name: string
|
||||
middle_name: string
|
||||
email: string
|
||||
|
||||
direct_permissions: PermissionsOut[]
|
||||
group: PermissionsGroupsOut[]
|
||||
}
|
||||
|
||||
export interface UserIn {
|
||||
email: string
|
||||
plain_password:string
|
||||
}
|
||||
Reference in New Issue
Block a user