WIP ESLint fixes
This commit is contained in:
@ -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)!;
|
||||
}
|
||||
|
@ -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)!;
|
||||
}
|
||||
|
@ -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)!;
|
||||
}
|
||||
|
@ -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)!;
|
||||
}
|
||||
|
Reference in New Issue
Block a user