#4110: Made vertical tabs in bookings and event types pages sticky. (#4145)

Co-authored-by: Jeroen Reumkens <[email protected]>
This commit is contained in:
Jeroen ReumkensandJeroen Reumkens authored and GitHub committed 2022-09-04 14:59:16 +00:00
1 parent 5e77b95e48
commit 93adf57d00
3 files changed
+10 -4

No files matched your search

@@ -42,7 +42,7 @@ export default function BookingLayout({
<Shell {...rest}>
<div className="flex flex-col p-2 md:p-0 xl:flex-row ">
<div className="hidden xl:block">
<VerticalTabs tabs={tabs} />
<VerticalTabs tabs={tabs} sticky />
</div>
<div className="block xl:hidden">
<HorizontalTabs tabs={tabs} />
@@ -1,16 +1,22 @@
import { FC } from "react";
import { classNames } from "@calcom/lib";
import VerticalTabItem, { VerticalTabItemProps } from "./VerticalTabItem";
export interface NavTabProps {
tabs: VerticalTabItemProps[];
children?: React.ReactNode;
className?: string;
sticky?: boolean;
}
const NavTabs: FC<NavTabProps> = ({ tabs, className = "", ...props }) => {
const NavTabs: FC<NavTabProps> = ({ tabs, className = "", sticky, ...props }) => {
return (
<nav className={`no-scrollbar flex flex-col space-y-1 ${className}`} aria-label="Tabs" {...props}>
<nav
className={classNames(`no-scrollbar flex flex-col space-y-1 ${className}`, sticky && "sticky top-0")}
aria-label="Tabs"
{...props}>
{props.children}
{tabs.map((tab, idx) => (
<VerticalTabItem {...tab} key={idx} />