WIP ESLint fixes

This commit is contained in:
2025-03-28 11:35:51 +01:00
parent 4b9df95721
commit 9a905e83f7
40 changed files with 92 additions and 91 deletions

View File

@ -39,7 +39,7 @@ export function AlertDialogProvider(p: PropsWithChildren): React.ReactElement {
return (
<>
<AlertContextK.Provider value={hook}>{p.children}</AlertContextK.Provider>
<AlertContextK value={hook}>{p.children}</AlertContextK>
<Dialog
open={open}
@ -67,5 +67,5 @@ export function AlertDialogProvider(p: PropsWithChildren): React.ReactElement {
}
export function useAlert(): AlertContext {
return React.useContext(AlertContextK)!;
return React.use(AlertContextK)!;
}

View File

@ -59,13 +59,13 @@ export function ConfirmDialogProvider(
return (
<>
<ConfirmContextK.Provider value={hook}>
<ConfirmContextK value={hook}>
{p.children}
</ConfirmContextK.Provider>
</ConfirmContextK>
<Dialog
open={open}
onClose={() => handleClose(false)}
onClose={() => { handleClose(false); }}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
@ -76,10 +76,10 @@ export function ConfirmDialogProvider(
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={() => handleClose(false)} autoFocus>
<Button onClick={() => { handleClose(false); }} autoFocus>
{cancelButton ?? "Cancel"}
</Button>
<Button onClick={() => handleClose(true)} color="error">
<Button onClick={() => { handleClose(true); }} color="error">
{confirmButton ?? "Confirm"}
</Button>
</DialogActions>
@ -89,5 +89,5 @@ export function ConfirmDialogProvider(
}
export function useConfirm(): ConfirmContext {
return React.useContext(ConfirmContextK)!;
return React.use(ConfirmContextK)!;
}

View File

@ -6,10 +6,10 @@ import {
} from "@mui/material";
import React, { PropsWithChildren } from "react";
type LoadingMessageContext = {
interface LoadingMessageContext {
show: (message: string) => void;
hide: () => void;
};
}
const LoadingMessageContextK =
React.createContext<LoadingMessageContext | null>(null);
@ -34,9 +34,9 @@ export function LoadingMessageProvider(
return (
<>
<LoadingMessageContextK.Provider value={hook}>
<LoadingMessageContextK value={hook}>
{p.children}
</LoadingMessageContextK.Provider>
</LoadingMessageContextK>
<Dialog open={open}>
<DialogContent>
@ -60,5 +60,5 @@ export function LoadingMessageProvider(
}
export function useLoadingMessage(): LoadingMessageContext {
return React.useContext(LoadingMessageContextK)!;
return React.use(LoadingMessageContextK)!;
}

View File

@ -24,9 +24,9 @@ export function SnackbarProvider(p: PropsWithChildren): React.ReactElement {
return (
<>
<SnackbarContextK.Provider value={hook}>
<SnackbarContextK value={hook}>
{p.children}
</SnackbarContextK.Provider>
</SnackbarContextK>
<Snackbar
open={open}
@ -39,5 +39,5 @@ export function SnackbarProvider(p: PropsWithChildren): React.ReactElement {
}
export function useSnackbar(): SnackbarContext {
return React.useContext(SnackbarContextK)!;
return React.use(SnackbarContextK)!;
}