diff --git a/frontend/src/components/authorization/AuthorizationLoginBox.tsx b/frontend/src/components/authorization/AuthorizationLoginBox.tsx index 3f1614d..54fb376 100644 --- a/frontend/src/components/authorization/AuthorizationLoginBox.tsx +++ b/frontend/src/components/authorization/AuthorizationLoginBox.tsx @@ -1,4 +1,4 @@ -import {faInfoCircle} from "@fortawesome/free-solid-svg-icons" +import {faExclamationCircle} from "@fortawesome/free-solid-svg-icons" import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" import {navigate} from "@reach/router" import {Box, Form, Heading, useFormState} from "@steffo/bluelib-react" @@ -6,7 +6,6 @@ import * as React from "react" import {useAuthorizationContext} from "../../contexts/authorization" import {SophonToken, SophonUser} from "../../types/SophonTypes" import {Loading} from "../elements/Loading" -import {ErrorBox} from "../errors/ErrorBox" import {useInstanceAxios} from "../instance/useInstanceAxios" @@ -71,21 +70,16 @@ export function AuthorizationLoginBox(): JSX.Element { [axios, authorization, username, password], ) - const messagePanel = + const buttonText = React.useMemo( () => { - if(!authorization) { - return + if(authorization?.state.running) { + return } if(error) { - return + return <> Login } - if(authorization.state.running) { - return - } - return ( - Press the login button after inserting your credentials. - ) + return <>Login }, [error, authorization], ) @@ -102,14 +96,11 @@ export function AuthorizationLoginBox(): JSX.Element { If you do not have one, you can ask your system administrator to create one for you.

- - {messagePanel} - - - Login + + {buttonText}