mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
🧹 Fix warnings
This commit is contained in:
parent
304819726e
commit
e98d07227f
7 changed files with 11 additions and 37 deletions
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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<string>("", 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<string>("", value => {
|
||||
if(value === "") return undefined
|
||||
|
|
|
@ -103,6 +103,6 @@ export function useLoginAxios(config: AxiosRequestConfig) {
|
|||
}
|
||||
})
|
||||
},
|
||||
[instance, config]
|
||||
[instance, authHeader, config]
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 (
|
||||
<>
|
||||
<div>
|
||||
<InstanceBox/>
|
||||
{userData ?
|
||||
<LogoutBox/>
|
||||
|
@ -26,6 +21,6 @@ export function LoginPage({}: LoginPageProps): JSX.Element {
|
|||
<LoginBox/>
|
||||
</Chapter>
|
||||
}
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { LoginPage } from "./LoginPage"
|
|||
import { Heading } from "@steffo/bluelib-react"
|
||||
|
||||
|
||||
export function Router({}) {
|
||||
export function Router() {
|
||||
return <>
|
||||
<Heading level={1}>
|
||||
Sophon
|
||||
|
|
Loading…
Reference in a new issue