refactor: event type settings improvements (#11615)

This commit is contained in:
Udit Takkar authored and GitHub committed 2023-10-11 10:03:54 +01:00
1 parent 4f942e1a13
commit 226ac889c7
12 files changed
+97 -64

No files matched your search

@@ -10,13 +10,13 @@ export function ArrowButton(props: ArrowButtonProps) {
<>
{props.arrowDirection === "up" ? (
<button
className="bg-default text-muted hover:text-emphasis border-default hover:border-emphasis invisible absolute left-[5px] -ml-4 -mt-4 mb-4 hidden h-6 w-6 scale-0 items-center justify-center rounded-md border p-1 transition-all group-hover:visible group-hover:scale-100 sm:ml-0 sm:flex lg:left-[12px]"
className="bg-default text-muted hover:text-emphasis border-default hover:border-emphasis invisible absolute left-0 -ml-4 -mt-4 mb-4 hidden h-6 w-6 scale-0 items-center justify-center rounded-md border p-1 transition-all group-hover:visible group-hover:scale-100 sm:ml-0 sm:flex lg:left-3"
onClick={props.onClick}>
<ArrowUp className="h-5 w-5" />
</button>
) : (
<button
className="bg-default text-muted border-default hover:text-emphasis hover:border-emphasis invisible absolute left-[5px] -ml-4 mt-8 hidden h-6 w-6 scale-0 items-center justify-center rounded-md border p-1 transition-all group-hover:visible group-hover:scale-100 sm:ml-0 sm:flex lg:left-[12px]"
className="bg-default text-muted border-default hover:text-emphasis hover:border-emphasis invisible absolute left-0 -ml-4 mt-8 hidden h-6 w-6 scale-0 items-center justify-center rounded-md border p-1 transition-all group-hover:visible group-hover:scale-100 sm:ml-0 sm:flex lg:left-3"
onClick={props.onClick}>
<ArrowDown className="h-5 w-5" />
</button>
+3 -2
View File
@@ -1,10 +1,11 @@
import { classNames } from "@calcom/lib";
export function Label(props: JSX.IntrinsicElements["label"]) {
const { className, ...restProps } = props;
return (
<label
{...props}
className={classNames("text-default text-emphasis mb-2 block text-sm font-medium", props.className)}>
className={classNames("text-default text-emphasis mb-2 block text-sm font-medium", className)}
{...restProps}>
{props.children}
</label>
);
@@ -20,6 +20,7 @@ type Props = {
toggleSwitchAtTheEnd?: boolean;
childrenClassName?: string;
switchContainerClassName?: string;
labelClassName?: string;
};
function SettingsToggle({
@@ -35,6 +36,7 @@ function SettingsToggle({
toggleSwitchAtTheEnd = false,
childrenClassName,
switchContainerClassName,
labelClassName,
...rest
}: Props) {
const [animateRef] = useAutoAnimate<HTMLDivElement>();
@@ -47,7 +49,8 @@ function SettingsToggle({
<div className={classNames("flex justify-between space-x-3", switchContainerClassName)}>
<div>
<div className="flex items-center">
<Label className="text-emphasis text-base font-semibold leading-none">
<Label
className={classNames("mt-0.5 text-base font-semibold leading-none", labelClassName)}>
{title}
{LockedIcon}
</Label>