Reorganize context/states/selectors in dedicated folders (#1205)
* Reorganize context/states/selectors in dedicated folders * linter
This commit is contained in:
@ -15,7 +15,7 @@ import {
|
||||
import { getLogoUrlFromDomainName } from '~/utils';
|
||||
|
||||
import { useCommandMenu } from '../hooks/useCommandMenu';
|
||||
import { commandMenuCommand } from '../states/commandMenuCommandsState';
|
||||
import { commandMenuCommandsState } from '../states/commandMenuCommandsState';
|
||||
import { isCommandMenuOpenedState } from '../states/isCommandMenuOpenedState';
|
||||
import { CommandType } from '../types/Command';
|
||||
|
||||
@ -33,7 +33,7 @@ export function CommandMenu() {
|
||||
const openActivityRightDrawer = useOpenActivityRightDrawer();
|
||||
const isCommandMenuOpened = useRecoilValue(isCommandMenuOpenedState);
|
||||
const [search, setSearch] = useState('');
|
||||
const commands = useRecoilValue(commandMenuCommand);
|
||||
const commands = useRecoilValue(commandMenuCommandsState);
|
||||
|
||||
useScopedHotkeys(
|
||||
'ctrl+k,meta+k',
|
||||
|
||||
@ -4,7 +4,7 @@ import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousH
|
||||
import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope';
|
||||
|
||||
import { commandMenuCommands } from '../constants/commandMenuCommands';
|
||||
import { commandMenuCommand } from '../states/commandMenuCommandsState';
|
||||
import { commandMenuCommandsState } from '../states/commandMenuCommandsState';
|
||||
import { isCommandMenuOpenedState } from '../states/isCommandMenuOpenedState';
|
||||
import { Command } from '../types/Command';
|
||||
|
||||
@ -12,7 +12,7 @@ export function useCommandMenu() {
|
||||
const [, setIsCommandMenuOpenedState] = useRecoilState(
|
||||
isCommandMenuOpenedState,
|
||||
);
|
||||
const setCommands = useSetRecoilState(commandMenuCommand);
|
||||
const setCommands = useSetRecoilState(commandMenuCommandsState);
|
||||
const {
|
||||
setHotkeyScopeAndMemorizePreviousScope,
|
||||
goBackToPreviousHotkeyScope,
|
||||
|
||||
@ -2,8 +2,8 @@ import { atom } from 'recoil';
|
||||
|
||||
import { Command, CommandType } from '../types/Command';
|
||||
|
||||
export const commandMenuCommand = atom<Command[]>({
|
||||
key: 'command-menu/commandMenuCommand',
|
||||
export const commandMenuCommandsState = atom<Command[]>({
|
||||
key: 'command-menu/commandMenuCommandsState',
|
||||
default: [
|
||||
{
|
||||
to: '',
|
||||
|
||||
Reference in New Issue
Block a user