[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:
@ -33,7 +33,7 @@ export function CommandMenu() {
|
||||
const openActivityRightDrawer = useOpenActivityRightDrawer();
|
||||
const isCommandMenuOpened = useRecoilValue(isCommandMenuOpenedState);
|
||||
const [search, setSearch] = useState('');
|
||||
const commands = useRecoilValue(commandMenuCommandsState);
|
||||
const commandMenuCommands = useRecoilValue(commandMenuCommandsState);
|
||||
|
||||
useScopedHotkeys(
|
||||
'ctrl+k,meta+k',
|
||||
@ -80,13 +80,13 @@ export function CommandMenu() {
|
||||
});
|
||||
const activities = activityData?.searchResults ?? [];
|
||||
|
||||
const matchingNavigateCommand = commands.find(
|
||||
const matchingNavigateCommand = commandMenuCommands.find(
|
||||
(cmd) =>
|
||||
cmd.shortcuts?.join('') === search?.toUpperCase() &&
|
||||
cmd.type === CommandType.Navigate,
|
||||
);
|
||||
|
||||
const matchingCreateCommand = commands.find(
|
||||
const matchingCreateCommand = commandMenuCommands.find(
|
||||
(cmd) =>
|
||||
cmd.shortcuts?.join('') === search?.toUpperCase() &&
|
||||
cmd.type === CommandType.Create,
|
||||
@ -112,7 +112,7 @@ export function CommandMenu() {
|
||||
<StyledEmpty>No results found.</StyledEmpty>
|
||||
{!matchingCreateCommand && (
|
||||
<StyledGroup heading="Create">
|
||||
{commands
|
||||
{commandMenuCommands
|
||||
.filter((cmd) => cmd.type === CommandType.Create)
|
||||
.map((cmd) => (
|
||||
<CommandMenuItem
|
||||
@ -200,7 +200,7 @@ export function CommandMenu() {
|
||||
)}
|
||||
{!matchingNavigateCommand && (
|
||||
<StyledGroup heading="Navigate">
|
||||
{commands
|
||||
{commandMenuCommands
|
||||
.filter(
|
||||
(cmd) =>
|
||||
(cmd.shortcuts?.join('').includes(search?.toUpperCase()) ||
|
||||
|
||||
@ -9,9 +9,7 @@ import { isCommandMenuOpenedState } from '../states/isCommandMenuOpenedState';
|
||||
import { Command } from '../types/Command';
|
||||
|
||||
export function useCommandMenu() {
|
||||
const [, setIsCommandMenuOpenedState] = useRecoilState(
|
||||
isCommandMenuOpenedState,
|
||||
);
|
||||
const [, setIsCommandMenuOpened] = useRecoilState(isCommandMenuOpenedState);
|
||||
const setCommands = useSetRecoilState(commandMenuCommandsState);
|
||||
const {
|
||||
setHotkeyScopeAndMemorizePreviousScope,
|
||||
@ -19,12 +17,12 @@ export function useCommandMenu() {
|
||||
} = usePreviousHotkeyScope();
|
||||
|
||||
function openCommandMenu() {
|
||||
setIsCommandMenuOpenedState(true);
|
||||
setIsCommandMenuOpened(true);
|
||||
setHotkeyScopeAndMemorizePreviousScope(AppHotkeyScope.CommandMenu);
|
||||
}
|
||||
|
||||
function closeCommandMenu() {
|
||||
setIsCommandMenuOpenedState(false);
|
||||
setIsCommandMenuOpened(false);
|
||||
goBackToPreviousHotkeyScope();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user