diff --git a/frontend/src/components/GuestBox.tsx b/frontend/src/components/GuestBox.tsx index b953f18..e7fbd74 100644 --- a/frontend/src/components/GuestBox.tsx +++ b/frontend/src/components/GuestBox.tsx @@ -5,12 +5,7 @@ import {useInstance} from "./InstanceContext"; import {navigate} from "@reach/router"; -interface GuestBoxProps { - -} - - -export function GuestBox({}: GuestBoxProps): JSX.Element { +export function GuestBox(): JSX.Element { const instance = useInstance() const login = useLogin() diff --git a/frontend/src/components/InstanceBox.tsx b/frontend/src/components/InstanceBox.tsx index 206b3d8..5d44deb 100644 --- a/frontend/src/components/InstanceBox.tsx +++ b/frontend/src/components/InstanceBox.tsx @@ -4,12 +4,7 @@ import {useInstance} from "./InstanceContext"; import {useLogin} from "./LoginContext"; -interface InstanceBoxProps { - -} - - -export function InstanceBox({}: InstanceBoxProps): JSX.Element { +export function InstanceBox(): JSX.Element { const instance = useInstance() const login = useLogin() diff --git a/frontend/src/components/LoginBox.tsx b/frontend/src/components/LoginBox.tsx index 8882cd2..11b970c 100644 --- a/frontend/src/components/LoginBox.tsx +++ b/frontend/src/components/LoginBox.tsx @@ -3,16 +3,10 @@ import {navigate} from "@reach/router"; import {Box, Form, Heading, Idiomatic as I, Panel, useFormState} from "@steffo/bluelib-react" import {useLogin} from "./LoginContext"; import {useInstance} from "./InstanceContext"; -import {FormState} from "@steffo/bluelib-react/dist/hooks/useFormState"; import {AxiosError} from "axios-lab"; -interface LoginBoxProps { - -} - - -export function LoginBox({}: LoginBoxProps): JSX.Element { +export function LoginBox(): JSX.Element { /** * The {@link InstanceContext}. */ @@ -24,7 +18,7 @@ export function LoginBox({}: LoginBoxProps): JSX.Element { const {login, running} = useLogin() /** - * The {@link FormState} of the username field. + * The FormState of the username field. */ const username = useFormState("", value => { if(value === "") return undefined @@ -32,7 +26,7 @@ export function LoginBox({}: LoginBoxProps): JSX.Element { }) /** - * The {@link FormState} of the password field. + * The FormState of the password field. */ const password = useFormState("", value => { if(value === "") return undefined diff --git a/frontend/src/components/LoginContext.tsx b/frontend/src/components/LoginContext.tsx index fca3330..4d77ba3 100644 --- a/frontend/src/components/LoginContext.tsx +++ b/frontend/src/components/LoginContext.tsx @@ -103,6 +103,6 @@ export function useLoginAxios(config: AxiosRequestConfig) { } }) }, - [instance, config] + [instance, authHeader, config] ) } diff --git a/frontend/src/components/LogoutBox.tsx b/frontend/src/components/LogoutBox.tsx index 2bd0224..d25eb3f 100644 --- a/frontend/src/components/LogoutBox.tsx +++ b/frontend/src/components/LogoutBox.tsx @@ -3,12 +3,7 @@ import {Box, Form, Heading, Panel, Variable} from "@steffo/bluelib-react"; import {useLogin} from "./LoginContext"; -interface LogoutBoxProps { - -} - - -export function LogoutBox({}: LogoutBoxProps): JSX.Element { +export function LogoutBox(): JSX.Element { const login = useLogin() if(!login.userData) { diff --git a/frontend/src/routes/LoginPage.tsx b/frontend/src/routes/LoginPage.tsx index 71ca610..99820c6 100644 --- a/frontend/src/routes/LoginPage.tsx +++ b/frontend/src/routes/LoginPage.tsx @@ -7,16 +7,11 @@ import {LogoutBox} from "../components/LogoutBox"; import {GuestBox} from "../components/GuestBox"; -interface LoginPageProps { - -} - - -export function LoginPage({}: LoginPageProps): JSX.Element { +export function LoginPage(): JSX.Element { const {userData} = useLogin() return ( - <> +
{userData ? @@ -26,6 +21,6 @@ export function LoginPage({}: LoginPageProps): JSX.Element { } - +
) } diff --git a/frontend/src/routes/Router.jsx b/frontend/src/routes/Router.jsx index 52dc917..3473e27 100644 --- a/frontend/src/routes/Router.jsx +++ b/frontend/src/routes/Router.jsx @@ -4,7 +4,7 @@ import { LoginPage } from "./LoginPage" import { Heading } from "@steffo/bluelib-react" -export function Router({}) { +export function Router() { return <> Sophon