chore: drop-downs improvements and bug fixes (#3433)
* chore: dropdowns should close on selecting an option * style: @plane/ui dropdown styling * refactor: @plane/ui dropdowns * fix: build errors * fix: list layout dropdowns positioning * fix: priority dropdown text in dark mode
This commit is contained in:
parent
f88109ef04
commit
801f75f406
52 changed files with 308 additions and 394 deletions
|
|
@ -2,7 +2,6 @@ import { Fragment, ReactNode, useRef, useState } from "react";
|
|||
import { observer } from "mobx-react-lite";
|
||||
import { Combobox } from "@headlessui/react";
|
||||
import { usePopper } from "react-popper";
|
||||
import { Placement } from "@popperjs/core";
|
||||
import { Check, ChevronDown, Search } from "lucide-react";
|
||||
// hooks
|
||||
import { useProject } from "hooks/store";
|
||||
|
|
@ -13,20 +12,13 @@ import { cn } from "helpers/common.helper";
|
|||
import { renderEmoji } from "helpers/emoji.helper";
|
||||
// types
|
||||
import { IProject } from "@plane/types";
|
||||
import { TButtonVariants } from "./types";
|
||||
import { TDropdownProps } from "./types";
|
||||
|
||||
type Props = {
|
||||
type Props = TDropdownProps & {
|
||||
button?: ReactNode;
|
||||
buttonClassName?: string;
|
||||
buttonContainerClassName?: string;
|
||||
buttonVariant: TButtonVariants;
|
||||
className?: string;
|
||||
disabled?: boolean;
|
||||
dropdownArrow?: boolean;
|
||||
onChange: (val: string) => void;
|
||||
placement?: Placement;
|
||||
value: string | null;
|
||||
tabIndex?: number;
|
||||
};
|
||||
|
||||
type ButtonProps = {
|
||||
|
|
@ -166,9 +158,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
|
|||
as="div"
|
||||
ref={dropdownRef}
|
||||
tabIndex={tabIndex}
|
||||
className={cn("h-full flex-shrink-0", {
|
||||
className,
|
||||
})}
|
||||
className={cn("h-full flex-shrink-0", className)}
|
||||
value={value}
|
||||
onChange={onChange}
|
||||
disabled={disabled}
|
||||
|
|
@ -271,6 +261,7 @@ export const ProjectDropdown: React.FC<Props> = observer((props) => {
|
|||
active ? "bg-custom-background-80" : ""
|
||||
} ${selected ? "text-custom-text-100" : "text-custom-text-200"}`
|
||||
}
|
||||
onClick={closeDropdown}
|
||||
>
|
||||
{({ selected }) => (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue