Skip to content

Commit f6ecdcc

Browse files
authored
Fix Directory typings (codesandbox#3162)
1 parent 7b3c9ef commit f6ecdcc

File tree

6 files changed

+6
-86
lines changed

6 files changed

+6
-86
lines changed

packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/DirectoryChildren/ModuleEntry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface IModuleEntryProps {
1919
directories: Directory[],
2020
id: string
2121
) => string;
22-
renameValidator: (id: string, title: string) => string;
22+
renameValidator: (id: string, title: string) => string | false | null;
2323
}
2424

2525
const ModuleEntry: React.FC<IModuleEntryProps> = ({

packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/DirectoryChildren/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ interface IDirectoryChildrenProps {
2020
directories: Directory[],
2121
id: string
2222
) => string;
23-
renameValidator: (id: string, title: string) => boolean;
23+
renameValidator: (id: string, title: string) => string | false | null;
2424
}
2525

2626
const DirectoryChildren: React.FC<IDirectoryChildrenProps> = ({

packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EntryTitleInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface Props {
2121
onCommit: (value: string, force?: boolean) => void;
2222
onChange: (value: string) => void;
2323
onCancel: () => void;
24-
error: string | null;
24+
error: string | false | null;
2525
id: string;
2626
}
2727

packages/app/src/app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import EntryTitle from './EntryTitle';
1818
import { EntryTitleInput } from './EntryTitleInput';
1919

2020
interface IEntryProps {
21-
renameValidator: (id: string, title: string) => string;
21+
renameValidator: (id: string, title: string) => string | false | null;
2222
shortid: string;
2323
id: string;
2424
title: string;
@@ -74,7 +74,7 @@ const Entry: React.FC<IEntryProps> = ({
7474
state: incomingState = '',
7575
}) => {
7676
const [state, setState] = useState(incomingState);
77-
const [error, setError] = useState<string | null>(null);
77+
const [error, setError] = useState<string | false | null>(null);
7878
const [hovering, setHovering] = useState(false);
7979

8080
const resetState = () => {

packages/app/src/app/pages/Sandbox/Editor/Workspace/OpenedTabs/index.tsx

Lines changed: 0 additions & 80 deletions
This file was deleted.

packages/app/src/app/pages/Sandbox/Editor/Workspace/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type ContainerStylesProps = {
99
depth?: number;
1010
active?: boolean;
1111
editing?: boolean;
12-
nameValidationError?: string;
12+
nameValidationError?: string | null | false;
1313
rightColors?: string[];
1414
};
1515

0 commit comments

Comments
 (0)