first commit
This commit is contained in:
52
src/App.jsx
Normal file
52
src/App.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import { useContactForm } from './hooks/useContactForm'
|
||||
import FormField from './components/FormField'
|
||||
import './App.css'
|
||||
|
||||
function App() {
|
||||
const { fields, errors, loginError, success, handlers, handleSubmit } = useContactForm()
|
||||
|
||||
return (
|
||||
<div className="page">
|
||||
<div className="card">
|
||||
<h1 className="card__title">Bejelentkezés</h1>
|
||||
<p className="card__subtitle">Add meg az adataidat.</p>
|
||||
|
||||
{success ? (
|
||||
<div className="alert alert--success">
|
||||
Sikeres bejelentkezés! Üdvözlünk, {fields.name}!
|
||||
</div>
|
||||
) : (
|
||||
<form className="form" onSubmit={handleSubmit} noValidate>
|
||||
<FormField
|
||||
id="name"
|
||||
label="Név"
|
||||
value={fields.name}
|
||||
onChange={handlers.setName}
|
||||
error={errors.name}
|
||||
/>
|
||||
<FormField
|
||||
id="email"
|
||||
label="Email"
|
||||
type="email"
|
||||
value={fields.email}
|
||||
onChange={handlers.setEmail}
|
||||
error={errors.email}
|
||||
/>
|
||||
|
||||
{loginError && (
|
||||
<div className="alert alert--error" role="alert">
|
||||
{loginError}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button className="form__submit" type="submit">
|
||||
Bejelentkezés
|
||||
</button>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default App
|
||||
Reference in New Issue
Block a user