@@ -16,8 +16,6 @@ type Props = {
|
||||
}
|
||||
| undefined;
|
||||
creatable?: boolean;
|
||||
autoFocus?: boolean;
|
||||
onBlur?: any;
|
||||
};
|
||||
|
||||
export default function CollectionSelection({
|
||||
@@ -25,8 +23,6 @@ export default function CollectionSelection({
|
||||
defaultValue,
|
||||
showDefaultValue = true,
|
||||
creatable = true,
|
||||
autoFocus,
|
||||
onBlur,
|
||||
}: Props) {
|
||||
const { data: collections = [] } = useCollections();
|
||||
|
||||
@@ -80,7 +76,7 @@ export default function CollectionSelection({
|
||||
return (
|
||||
<div
|
||||
{...innerProps}
|
||||
className="px-2 py-2 last:border-0 border-b border-neutral-content hover:bg-neutral-content duration-100 cursor-pointer"
|
||||
className="px-2 py-2 last:border-0 border-b border-neutral-content hover:bg-neutral-content cursor-pointer"
|
||||
>
|
||||
<div className="flex w-full justify-between items-center">
|
||||
<span>{data.label}</span>
|
||||
@@ -108,8 +104,6 @@ export default function CollectionSelection({
|
||||
onChange={onChange}
|
||||
options={options}
|
||||
styles={styles}
|
||||
autoFocus={autoFocus}
|
||||
onBlur={onBlur}
|
||||
defaultValue={showDefaultValue ? defaultValue : null}
|
||||
components={{
|
||||
Option: customOption,
|
||||
@@ -126,9 +120,7 @@ export default function CollectionSelection({
|
||||
onChange={onChange}
|
||||
options={options}
|
||||
styles={styles}
|
||||
autoFocus={autoFocus}
|
||||
defaultValue={showDefaultValue ? defaultValue : null}
|
||||
onBlur={onBlur}
|
||||
components={{
|
||||
Option: customOption,
|
||||
}}
|
||||
|
||||
@@ -7,19 +7,12 @@ import { useTags } from "@/hooks/store/tags";
|
||||
type Props = {
|
||||
onChange: any;
|
||||
defaultValue?: {
|
||||
value?: number;
|
||||
value: number;
|
||||
label: string;
|
||||
}[];
|
||||
autoFocus?: boolean;
|
||||
onBlur?: any;
|
||||
};
|
||||
|
||||
export default function TagSelection({
|
||||
onChange,
|
||||
defaultValue,
|
||||
autoFocus,
|
||||
onBlur,
|
||||
}: Props) {
|
||||
export default function TagSelection({ onChange, defaultValue }: Props) {
|
||||
const { data: tags = [] } = useTags();
|
||||
|
||||
const [options, setOptions] = useState<Options[]>([]);
|
||||
@@ -41,9 +34,8 @@ export default function TagSelection({
|
||||
options={options}
|
||||
styles={styles}
|
||||
defaultValue={defaultValue}
|
||||
// menuPosition="fixed"
|
||||
isMulti
|
||||
autoFocus={autoFocus}
|
||||
onBlur={onBlur}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export const styles: StylesConfig = {
|
||||
? "oklch(var(--p))"
|
||||
: "oklch(var(--nc))",
|
||||
},
|
||||
transition: "all 100ms",
|
||||
transition: "all 50ms",
|
||||
}),
|
||||
control: (styles, state) => ({
|
||||
...styles,
|
||||
@@ -50,28 +50,19 @@ export const styles: StylesConfig = {
|
||||
multiValue: (styles) => {
|
||||
return {
|
||||
...styles,
|
||||
backgroundColor: "oklch(var(--b2))",
|
||||
color: "oklch(var(--bc))",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "0.1rem",
|
||||
marginRight: "0.4rem",
|
||||
backgroundColor: "#0ea5e9",
|
||||
color: "white",
|
||||
};
|
||||
},
|
||||
multiValueLabel: (styles) => ({
|
||||
...styles,
|
||||
color: "oklch(var(--bc))",
|
||||
color: "white",
|
||||
}),
|
||||
multiValueRemove: (styles) => ({
|
||||
...styles,
|
||||
height: "1.2rem",
|
||||
width: "1.2rem",
|
||||
borderRadius: "100px",
|
||||
transition: "all 100ms",
|
||||
color: "oklch(var(--w))",
|
||||
":hover": {
|
||||
color: "red",
|
||||
backgroundColor: "oklch(var(--nc))",
|
||||
color: "white",
|
||||
backgroundColor: "#38bdf8",
|
||||
},
|
||||
}),
|
||||
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
|
||||
|
||||
Reference in New Issue
Block a user