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

🧹 Fix warnings

This commit is contained in:
Steffo 2021-10-17 01:31:29 +02:00 committed by Stefano Pigozzi
parent 615a59806a
commit d62df362d3
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 {useAuthorizationContext} from "../../contexts/authorization"
import {Validators} from "../../utils/Validators" import {Validators} from "../../utils/Validators"
import {IconText} from "../elements/IconText" import {IconText} from "../elements/IconText"
import {useInstanceAxios} from "../instance/useInstanceAxios"
import {AuthorizationLoginButton} from "./AuthorizationLoginButton" import {AuthorizationLoginButton} from "./AuthorizationLoginButton"
export function AuthorizationLoginBox(): JSX.Element { export function AuthorizationLoginBox(): JSX.Element {
const axios = useInstanceAxios()
const authorization = useAuthorizationContext() const authorization = useAuthorizationContext()
const username = useFormState<string>("", Validators.doNotValidate) const username = useFormState<string>("", Validators.doNotValidate)
@ -20,7 +18,7 @@ export function AuthorizationLoginBox(): JSX.Element {
() => ( () => (
authorization !== undefined && authorization.state.token === undefined authorization !== undefined && authorization.state.token === undefined
), ),
[axios, authorization], [authorization],
) )
return ( return (

View file

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

View file

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

View file

@ -633,6 +633,6 @@ export function useManagedViewSet<Resource extends DjangoResource>(baseRoute: st
command, 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} return {command, action, list, retrieve, create, update, destroy}
}, },
[command, action, list, retrieve, create, update, destroy], [api, command, action, list, retrieve, create, update, destroy],
) )
} }