Refactor the error messages (fix #102) #103

Merged
cami merged 1 commit from refactor/errormessage into main 2021-07-05 16:00:38 +00:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit b03523cb8d - Show all commits

View file

@ -6,6 +6,7 @@ import InputField from "../InputField";
import SubmitField from "../SubmitField";
import { login, useAuth, logout } from "../../auth/AuthProvider";
import Secret from "./Secret";
import ErrorMessage from "../ErrorMessage";
export default function Login() {
const [username, setUsername] = useState("");
@ -65,7 +66,7 @@ export default function Login() {
InputPlaceHolder="Passwort"
/>
<br />
<p className="errorMessage">{errorMessage}</p>
<ErrorMessage message={errorMessage}/>
<SubmitField onClick={onSubmitClick} LabelName="Einloggen" />
</form>
) : (

View file

@ -5,6 +5,7 @@ import Footer from "../../Footer";
import InputField from "../InputField";
import SubmitField from "../SubmitField";
import "../Input.css";
import ErrorMessage from "../ErrorMessage";
export default function Login() {
const [username, setUsername] = useState("");
@ -61,7 +62,7 @@ export default function Login() {
onChange={handleUsernameChange}
InputName="username"
/>
{!isStatusOk && <p className="errorMessage">{errorMessage}</p>}
{!isStatusOk && <ErrorMessage message={errorMessage} />}
<InputField
LabelName="Passwort"
InputType="password"