Tidy up on event-types + NITS (#4119)
* Apply correct padding to switch * Make gray badges less eye catching * Update description text color * Tidy up setup tab * Use V2 dialog on edit location * use V2 select * Menu Item component + fix menuitem * Fix dropdown alignment
This commit is contained in:
1 parent
d27b7ab2c4
commit
03a9996c84
6 files changed
+175
-192
No files matched your search
@@ -8,7 +8,7 @@ export const badgeClassNameByVariant = {
|
||||
orange: "bg-orange-100 text-orange-800",
|
||||
success: "bg-green-100 text-green-800",
|
||||
green: "bg-green-100 text-green-800",
|
||||
gray: "bg-gray-200 text-gray-800 dark:bg-transparent dark:text-darkgray-800",
|
||||
gray: "bg-gray-100 text-gray-800 dark:bg-transparent dark:text-darkgray-800",
|
||||
blue: "bg-blue-100 text-blue-800",
|
||||
red: "bg-red-100 text-red-800",
|
||||
error: "bg-red-100 text-red-800",
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { CheckCircleIcon } from "@heroicons/react/outline";
|
||||
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
||||
import Link from "next/link";
|
||||
import { ComponentProps, forwardRef } from "react";
|
||||
import { Icon } from "react-feather";
|
||||
|
||||
import { classNames } from "@calcom/lib";
|
||||
|
||||
export const Dropdown = DropdownMenuPrimitive.Root;
|
||||
|
||||
@@ -24,10 +28,11 @@ export const DropdownMenuTriggerItem = DropdownMenuPrimitive.TriggerItem;
|
||||
|
||||
type DropdownMenuContentProps = ComponentProps<typeof DropdownMenuPrimitive["Content"]>;
|
||||
export const DropdownMenuContent = forwardRef<HTMLDivElement, DropdownMenuContentProps>(
|
||||
({ children, ...props }, forwardedRef) => {
|
||||
({ children, align = "end", ...props }, forwardedRef) => {
|
||||
return (
|
||||
<DropdownMenuPrimitive.Content
|
||||
portalled={props.portalled}
|
||||
align={align}
|
||||
{...props}
|
||||
className="w-50 relative z-10 mt-1 -ml-0 origin-top-right bg-white text-sm ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||
ref={forwardedRef}>
|
||||
@@ -89,6 +94,48 @@ export const DropdownMenuRadioItem = forwardRef<HTMLDivElement, DropdownMenuRadi
|
||||
);
|
||||
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
||||
|
||||
type DropdownItemProps = {
|
||||
children: React.ReactNode;
|
||||
color?: "destructive";
|
||||
StartIcon?: Icon;
|
||||
EndIcon?: Icon;
|
||||
href?: string;
|
||||
disabled?: boolean;
|
||||
} & ButtonOrLinkProps;
|
||||
|
||||
type ButtonOrLinkProps = ComponentProps<"button"> & ComponentProps<"a">;
|
||||
export function ButtonOrLink({ href, ...props }: ButtonOrLinkProps) {
|
||||
const isLink = typeof href !== "undefined";
|
||||
const ButtonOrLink = isLink ? "a" : "button";
|
||||
|
||||
const content = <ButtonOrLink {...props} />;
|
||||
|
||||
if (isLink) {
|
||||
return <Link href={href}>{content}</Link>;
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
export const DropdownItem = (props: DropdownItemProps) => {
|
||||
const { StartIcon, EndIcon } = props;
|
||||
|
||||
return (
|
||||
<ButtonOrLink
|
||||
{...props}
|
||||
className={classNames(
|
||||
"inline-flex items-center px-3 py-[10px] text-gray-600",
|
||||
props.color === "destructive" ? "hover:bg-red-100 hover:text-red-700" : " hover:bg-gray-100"
|
||||
)}>
|
||||
<>
|
||||
{StartIcon && <StartIcon />}
|
||||
<div className="mx-2 text-black">{props.children}</div>
|
||||
{EndIcon && <EndIcon />}
|
||||
</>
|
||||
</ButtonOrLink>
|
||||
);
|
||||
};
|
||||
|
||||
export const DropdownMenuSeparator = DropdownMenuPrimitive.Separator;
|
||||
|
||||
export default Dropdown;
|
||||
Reference in new issue
Block a user