added badge for unconfirmed bookings (#4912)

* added badge for unconfirmed bookings

* added link to unconfirmed bookings

* added rounded prop to badge, added unconfirmed badge to botto nav

* Supporting recurring events + bug fix

* Tooltip and hover style

Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Leo Giovanetti <[email protected]>
This commit is contained in:
authored and GitHub committed 2022-10-10 17:00:09 +00:00
1 parent 2a0a293f8c
commit 4fcdc7bf5c
6 files changed
+65 -3

No files matched your search

+4 -2
View File
@@ -24,17 +24,19 @@ export type BadgeProps = {
size?: keyof typeof classNameBySize;
StartIcon?: Icon;
bold?: boolean;
rounded?: boolean;
} & JSX.IntrinsicElements["div"];
export const Badge = function Badge(props: BadgeProps) {
const { variant, className, size = "default", StartIcon, bold, ...passThroughProps } = props;
const { variant, className, size = "default", rounded, StartIcon, bold, ...passThroughProps } = props;
return (
<div
{...passThroughProps}
className={classNames(
"inline-flex items-center justify-center rounded py-0.5 px-[6px] text-xs",
"inline-flex items-center justify-center py-0.5 px-[6px] text-xs",
bold ? "font-semibold" : "font-normal",
rounded ? "min-w-5 min-h-5 rounded-full pt-1" : "rounded-md",
!StartIcon ? classNameBySize[size] : "",
badgeClassNameByVariant[variant],
className
+9 -1
View File
@@ -8,6 +8,7 @@ import { Toaster } from "react-hot-toast";
import dayjs from "@calcom/dayjs";
import { useIsEmbed } from "@calcom/embed-core/embed-iframe";
import UnconfirmedBookingBadge from "@calcom/features/bookings/UnconfirmedBookingBadge";
import ImpersonatingBanner from "@calcom/features/ee/impersonation/components/ImpersonatingBanner";
import HelpMenuItem from "@calcom/features/ee/support/components/HelpMenuItem";
import CustomBranding from "@calcom/lib/CustomBranding";
@@ -388,6 +389,7 @@ function UserDropdown({ small }: { small?: boolean }) {
export type NavigationItemType = {
name: string;
href: string;
badge?: React.ReactNode;
icon?: SVGComponent;
child?: NavigationItemType[];
pro?: true;
@@ -406,6 +408,7 @@ export type NavigationItemType = {
const requiredCredentialNavigationItems = ["Routing Forms"];
const MORE_SEPARATOR_NAME = "more";
const navigation: NavigationItemType[] = [
{
name: "event_types_page_title",
@@ -416,6 +419,7 @@ const navigation: NavigationItemType[] = [
name: "bookings",
href: "/bookings/upcoming",
icon: Icon.FiCalendar,
badge: <UnconfirmedBookingBadge />,
},
{
name: "availability",
@@ -563,7 +567,10 @@ const NavigationItem: React.FC<{
/>
)}
{isLocaleReady ? (
<span className="hidden lg:inline">{t(item.name)}</span>
<span className="hidden w-full justify-between lg:flex">
<div className="flex">{t(item.name)}</div>
{item.badge && item.badge}
</span>
) : (
<SkeletonText className="h-3 w-32" />
)}
@@ -619,6 +626,7 @@ const MobileNavigationItem: React.FC<{
<a
className="relative my-2 min-w-0 flex-1 overflow-hidden rounded-md py-2 px-1 text-center text-xs font-medium text-neutral-400 hover:bg-gray-200 hover:text-gray-700 focus:z-10 sm:text-sm [&[aria-current='page']]:text-gray-900"
aria-current={current ? "page" : undefined}>
{item.badge && <div className="absolute right-1 top-1">{item.badge}</div>}
{item.icon && (
<item.icon
className="mx-auto mb-1 block h-5 w-5 flex-shrink-0 text-center text-inherit [&[aria-current='page']]:text-gray-900"