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:
parent
b6ec0948e2
commit
b03523cb8d
2 changed files with 4 additions and 2 deletions
|
@ -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>
|
||||
) : (
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue