1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-22 06:44:21 +00:00

🧹 Fix warnings

This commit is contained in:
Steffo 2021-10-17 01:31:29 +02:00 committed by Stefano Pigozzi
parent df89faad26
commit cb0a7e4d6d
5 changed files with 6 additions and 8 deletions

View file

@ -4,12 +4,10 @@ import * as React from "react"
import {useAuthorizationContext} from "../../contexts/authorization"
import {Validators} from "../../utils/Validators"
import {IconText} from "../elements/IconText"
import {useInstanceAxios} from "../instance/useInstanceAxios"
import {AuthorizationLoginButton} from "./AuthorizationLoginButton"
export function AuthorizationLoginBox(): JSX.Element {
const axios = useInstanceAxios()
const authorization = useAuthorizationContext()
const username = useFormState<string>("", Validators.doNotValidate)
@ -20,7 +18,7 @@ export function AuthorizationLoginBox(): JSX.Element {
() => (
authorization !== undefined && authorization.state.token === undefined
),
[axios, authorization],
[authorization],
)
return (

View file

@ -25,7 +25,7 @@ export function AuthorizationLoginButton({username, password, disabled = false}:
() => (
!disabled && authorization !== undefined && !authorization.state.running && username !== "" && password !== ""
),
[authorization, username, password],
[disabled, authorization, username, password],
)
const doLogin =

View file

@ -5,14 +5,14 @@ import * as React from "react"
import ReactMarkdown from "react-markdown"
export interface DescriptionBox {
export interface DescriptionBoxProps {
icon: IconDefinition,
name: string,
description: string,
}
export function DescriptionBox({icon, name, description}: DescriptionBox): JSX.Element {
export function DescriptionBox({icon, name, description}: DescriptionBoxProps): JSX.Element {
return React.useMemo(
() => (
<Box>

View file

@ -633,6 +633,6 @@ export function useManagedViewSet<Resource extends DjangoResource>(baseRoute: st
command,
}
},
[state, resources, refresh, create, command]
[state, resources, refresh, create, command, viewset],
)
}

View file

@ -158,6 +158,6 @@ export function useViewSet<Resource>(baseRoute: string): ViewSet<Resource> | und
return {command, action, list, retrieve, create, update, destroy}
},
[command, action, list, retrieve, create, update, destroy],
[api, command, action, list, retrieve, create, update, destroy],
)
}