Compare commits

...

2 Commits

Author SHA1 Message Date
Gregory Schier
0cad8f69e2 Fix imports 2025-11-24 08:55:55 -08:00
Zhizhen He
a8402824ed Fix useState (#307) 2025-11-24 08:55:37 -08:00
3 changed files with 11 additions and 7 deletions

View File

@@ -32,7 +32,7 @@ import { EmptyStateText } from '../EmptyStateText';
import { SelectFile } from '../SelectFile';
export function SettingsPlugins() {
const [directory, setDirectory] = React.useState<string | null>(null);
const [directory, setDirectory] = useState<string | null>(null);
const plugins = useAtomValue(pluginsAtom);
const createPlugin = useInstallPlugin();
const refreshPlugins = useRefreshPlugins();

View File

@@ -1,5 +1,5 @@
import classNames from 'classnames';
import type React from 'react';
import type { ReactNode } from 'react';
import { Fragment } from 'react';
import type { HotkeyAction } from '../../hooks/useHotKey';
import { HotKey } from './HotKey';
@@ -7,7 +7,7 @@ import { HotKeyLabel } from './HotKeyLabel';
interface Props {
hotkeys: HotkeyAction[];
bottomSlot?: React.ReactNode;
bottomSlot?: ReactNode;
className?: string;
}

View File

@@ -3,8 +3,12 @@ import { useDndContext, useDndMonitor, useDraggable, useDroppable } from '@dnd-k
import classNames from 'classnames';
import { useAtomValue } from 'jotai';
import { selectAtom } from 'jotai/utils';
import type React from 'react';
import type { MouseEvent, PointerEvent } from 'react';
import type {
MouseEvent,
PointerEvent,
FocusEvent as ReactFocusEvent,
KeyboardEvent as ReactKeyboardEvent,
} from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { computeSideForDragMove } from '../../../lib/dnd';
import { jotaiStore } from '../../../lib/jotai';
@@ -148,14 +152,14 @@ function TreeItem_<T extends { id: string }>({
}, []);
const handleEditBlur = useCallback(
async function editBlur(e: React.FocusEvent<HTMLInputElement>) {
async function editBlur(e: ReactFocusEvent<HTMLInputElement>) {
await handleSubmitNameEdit(e.currentTarget);
},
[handleSubmitNameEdit],
);
const handleEditKeyDown = useCallback(
async (e: React.KeyboardEvent<HTMLInputElement>) => {
async (e: ReactKeyboardEvent<HTMLInputElement>) => {
e.stopPropagation(); // Don't trigger other tree keys (like arrows)
switch (e.key) {
case 'Enter':