Fix more types and use logical ANDs

This commit is contained in:
Isaac Wise
2024-07-27 17:40:07 -05:00
parent ff31732ba3
commit 4faf389a2b
16 changed files with 40 additions and 86 deletions
+2 -12
View File
@@ -6,16 +6,6 @@ import { Options } from "./types";
import CreatableSelect from "react-select/creatable";
import Select, { ActionMeta } from "react-select";
interface Option {
label: string;
value: number;
ownerId: number;
count?: {
links: number;
};
parentId?: number;
}
type Props = {
onChange: (newValue: unknown, actionMeta: ActionMeta<unknown>) => void;
showDefaultValue?: boolean;
@@ -113,7 +103,7 @@ export default function CollectionSelection({
onChange={onChange}
options={options}
styles={styles}
defaultValue={showDefaultValue ? defaultValue : null}
defaultValue={showDefaultValue && defaultValue}
components={{
Option: customOption,
}}
@@ -129,7 +119,7 @@ export default function CollectionSelection({
onChange={onChange}
options={options}
styles={styles}
defaultValue={showDefaultValue ? defaultValue : null}
defaultValue={showDefaultValue && defaultValue}
components={{
Option: customOption,
}}
-1
View File
@@ -35,7 +35,6 @@ export default function TagSelection({ onChange, defaultValue }: Props) {
options={options}
styles={styles}
defaultValue={defaultValue}
// menuPosition="fixed"
isMulti
/>
);