Skip to content

Commit

Permalink
#11 Add handle change to input
Browse files Browse the repository at this point in the history
  • Loading branch information
SandraBergstrom committed Jun 21, 2023
1 parent e6113a3 commit eab4e54
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/pages/auth/LoginForm.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";

import Form from "react-bootstrap/Form";
import Alert from "react-bootstrap/Alert";
Expand All @@ -15,7 +15,19 @@ import btnStyles from "../../styles/Button.module.css";
import appStyles from "../../App.module.css";

function LogInForm() {
// Add your component logic here
const [signInData, setSignInData] = useState({
username: "",
password: "",
});

const { username, password } = signInData;

const handleChange = (event) => {
setSignInData({
...signInData,
[event.target.name]: event.targetvalue,
});
};

return (
<Row className={styles.Row}>
Expand All @@ -42,6 +54,8 @@ function LogInForm() {
type="text"
placeholder="Enter username"
name="username"
value={username}
onChange={handleChange}
/>
</Form.Group>

Expand All @@ -51,6 +65,8 @@ function LogInForm() {
className={styles.Input}
type="password"
placeholder="Password"
value={password}
onChange={handleChange}
/>
</Form.Group>

Expand Down

0 comments on commit eab4e54

Please sign in to comment.