[ESLint rule]: recoil value and setter should be named after their at… (#1402)

* Override unwanted changes

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

* Fix the tests

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Toledodev <rafael.toledo@engenharia.ufjf.br>
Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com>
Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
gitstart-twenty
2023-09-05 11:34:11 +03:00
committed by GitHub
parent 0ec4b78aee
commit 878302dd31
52 changed files with 400 additions and 281 deletions

View File

@ -9,7 +9,8 @@ import { DialogHotkeyScope } from '../types/DialogHotkeyScope';
import { Dialog } from './Dialog';
export function DialogProvider({ children }: React.PropsWithChildren) {
const [dialogState, setDialogState] = useRecoilState(dialogInternalState);
const [dialogInternal, setDialogInternal] =
useRecoilState(dialogInternalState);
const {
setHotkeyScopeAndMemorizePreviousScope,
@ -18,7 +19,7 @@ export function DialogProvider({ children }: React.PropsWithChildren) {
// Handle dialog close event
const handleDialogClose = (id: string) => {
setDialogState((prevState) => ({
setDialogInternal((prevState) => ({
...prevState,
queue: prevState.queue.filter((snackBar) => snackBar.id !== id),
}));
@ -26,17 +27,17 @@ export function DialogProvider({ children }: React.PropsWithChildren) {
};
useEffect(() => {
if (dialogState.queue.length === 0) {
if (dialogInternal.queue.length === 0) {
return;
}
setHotkeyScopeAndMemorizePreviousScope(DialogHotkeyScope.Dialog);
}, [dialogState.queue, setHotkeyScopeAndMemorizePreviousScope]);
}, [dialogInternal.queue, setHotkeyScopeAndMemorizePreviousScope]);
return (
<>
{children}
{dialogState.queue.map((dialog) => (
{dialogInternal.queue.map((dialog) => (
<Dialog
key={dialog.id}
{...dialog}