calcom/components/NavTabs.tsx
Deepak Prabhakara 7b65942de2
Feature/sso signup (#1555)
* updated saml-jackson

* if logged in redirect to getting-started page with username in the query param

* fixed issue with mixed up Google login, profile.id is undefined and this is causing the first record to be retrieved instead of the AND query failing

* updated updated saml-jackson

* document PGSSLMODE for Heroku

* tweaks to PGSSLMODE doc

* for self-hosted instance just allow user to signin with any identity (as long as email matches)

* fixed submitting flag

* added username to onboarding flow (if requested during signup)

* added telemetry for google login, saml login, saml config

* check if firstName and lastName are defined

* convert mutation to an async op

* added e2e test to ensure username query param gets picked up during onboarding

* fixed minor typo and added note about configuring Google integration as an Internal app when self-hosting

* cleaned up unnecessary ssr in sso signup routes

* renamed function

* Revert "cleaned up unnecessary ssr in sso signup routes"

This reverts commit 3607ffef79542d8ca4277a64be38d35bd9457960.

* moved client side code to useEffect hook

* - format
- fixed Save button in SAML config component

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-02-02 18:33:27 +00:00

55 lines
1.7 KiB
TypeScript

import Link, { LinkProps } from "next/link";
import { useRouter } from "next/router";
import React, { ElementType, FC } from "react";
import classNames from "@lib/classNames";
interface Props {
tabs: {
name: string;
href: string;
icon?: ElementType;
}[];
linkProps?: Omit<LinkProps, "href">;
}
const NavTabs: FC<Props> = ({ tabs, linkProps }) => {
const router = useRouter();
return (
<>
<nav
className="flex -mb-px space-x-2 space-x-5 rtl:space-x-reverse sm:rtl:space-x-reverse"
aria-label="Tabs">
{tabs.map((tab) => {
const isCurrent = router.asPath === tab.href;
return (
<Link key={tab.name} href={tab.href} {...linkProps}>
<a
className={classNames(
isCurrent
? "border-neutral-900 text-neutral-900"
: "border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300",
"group inline-flex items-center py-4 px-1 border-b-2 font-medium text-sm"
)}
aria-current={isCurrent ? "page" : undefined}>
{tab.icon && (
<tab.icon
className={classNames(
isCurrent ? "text-neutral-900" : "text-gray-400 group-hover:text-gray-500",
"-ml-0.5 ltr:mr-2 rtl:ml-2 h-5 w-5 hidden sm:inline-block"
)}
aria-hidden="true"
/>
)}
<span>{tab.name}</span>
</a>
</Link>
);
})}
</nav>
<hr />
</>
);
};
export default NavTabs;