Refactor the error messages (fix #102)

All the errormessages use now the component ErrorMessage as it will be easier like this
This commit is contained in:
cami 2021-07-05 18:00:01 +02:00
parent b6ec0948e2
commit b03523cb8d
2 changed files with 4 additions and 2 deletions

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"