Upgrade to next 13.1 (#6265)

Co-authored-by: zomars <[email protected]>
This commit is contained in:
Peer Richelsenandzomars authored and GitHub committed 2023-01-06 12:13:56 +00:00
1 parent c9c54db3a1
commit d83411162d
55 files changed
+1025 -921

No files matched your search

+2 -4
View File
@@ -32,10 +32,8 @@ export default function AppCard({
<div className="p-4 text-sm sm:p-8">
<div className="flex w-full flex-col gap-2 sm:flex-row sm:gap-0">
{/* Don't know why but w-[42px] isn't working, started happening when I started using next/dynamic */}
<Link href={"/apps/" + app.slug}>
<a className="mr-3 h-auto w-10 rounded-sm">
<img className="w-full" src={app?.logo} alt={app?.name} />
</a>
<Link href={"/apps/" + app.slug} className="mr-3 h-auto w-10 rounded-sm">
<img className="w-full" src={app?.logo} alt={app?.name} />
</Link>
<div className="flex flex-col">
<span className="text-base font-semibold leading-4 text-black">{app?.name}</span>
@@ -14,8 +14,8 @@ import {
} from "@calcom/types/AppGetServerSideProps";
import {
Alert,
Button,
Badge,
Button,
ButtonGroup,
Dialog,
DialogClose,
@@ -318,9 +318,7 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) {
return (
<div key={router.id} className="mr-2">
<Link href={`/${appUrl}/route-builder/${router.id}`}>
<a>
<Badge variant="gray">{router.name}</Badge>
</a>
<Badge variant="gray">{router.name}</Badge>
</Link>
</div>
);
@@ -342,9 +340,7 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) {
return (
<div key={router.id} className="mr-2">
<Link href={`/${appUrl}/route-builder/${router.id}`}>
<a>
<Badge variant="default">{router.name}</Badge>
</a>
<Badge variant="default">{router.name}</Badge>
</Link>
</div>
);
@@ -399,9 +395,12 @@ function SingleForm({ form, appUrl, Page }: SingleFormComponentProps) {
<div className="font-bold ">{t("route_to")}:</div>
<div className="mt-2">
{RoutingPages.map((page) => {
if (page.value === decidedAction.type) {
return <div data-testid="test-routing-result-type">{page.label}</div>;
}
if (page.value !== decidedAction.type) return null;
return (
<div key={page.value} data-testid="test-routing-result-type">
{page.label}
</div>
);
})}
:{" "}
{decidedAction.type === "customPageMessage" ? (
@@ -213,11 +213,9 @@ const Route = ({
className="mb-6">
<div className="-mt-3">
<Link href={`/${appUrl}/route-builder/${route.id}`}>
<a>
<Badge variant="gray">
<span className="font-semibold">{route.name}</span>
</Badge>
</a>
<Badge variant="gray">
<span className="font-semibold">{route.name}</span>
</Badge>
</Link>
<p className="mt-2 text-sm text-gray-500">
Fields available in <span className="font-bold">{route.name}</span> will be added to this form.
@@ -18,7 +18,7 @@ export default function HowToUse() {
<li>
Make sure that you have{" "}
<Link href="/apps/routing-forms" className="text-base text-gray-500">
<a className="text-base text-gray-500">Routing Forms</a>
Routing Forms
</Link>{" "}
app installed
</li>
@@ -26,39 +26,42 @@ export default function HowToUse() {
Create a Routing Form with fields on the basis of which you want your typeform routing to work
</li>
<li>
<Link href="/api/app-store/typeform/copy-typeform-redirect-url.png">
<a target="_blank" className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Click &quot;Copy Typeform Redirect URL&quot;
</a>
<Link
href="/api/app-store/typeform/copy-typeform-redirect-url.png"
target="_blank"
className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Click &quot;Copy Typeform Redirect URL&quot;
</Link>
</li>
<li>Create a Typeform that you want to route through Cal.com form&apos;s routing</li>
<li>
Add the copied URL as{" "}
<Link href="https://www.typeform.com/help/a/end-screens-and-redirects-360051791392/#h_01G0CFXF21W2EQ8PXKSB4KSC8P">
<a target="_blank" className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Redirect to your typeform
</a>
<Link
href="https://www.typeform.com/help/a/end-screens-and-redirects-360051791392/#h_01G0CFXF21W2EQ8PXKSB4KSC8P"
target="_blank"
className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Redirect to your typeform
</Link>
</li>
<li>
Use{" "}
<Link href="https://www.typeform.com/help/a/use-recall-information-to-reference-typeform-answers-variables-and-more-360052320011/">
<a target="_blank" className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Recall Information in Typeform
</a>
<Link
href="https://www.typeform.com/help/a/use-recall-information-to-reference-typeform-answers-variables-and-more-360052320011/"
target="_blank"
className="inline-flex items-baseline text-base text-gray-500">
<Icon.FiExternalLink
className="h-4 w-4 text-neutral-500 ltr:mr-2 rtl:ml-2"
aria-hidden="true"
/>
Recall Information in Typeform
</Link>{" "}
to add values to query params.
</li>
@@ -68,7 +71,7 @@ export default function HowToUse() {
</li>
</ol>
<Link href="/apps/installed" passHref={true}>
<Link href="/apps/installed" passHref={true} legacyBehavior>
<Button color="secondary">{t("done")}</Button>
</Link>
</div>
@@ -103,7 +103,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
<li>You&apos;re set!</li>
</Trans>
</ol>
<Link href="/apps/installed/automation?hl=zapier" passHref={true}>
<Link href="/apps/installed/automation?hl=zapier" passHref={true} legacyBehavior>
<Button color="secondary">{t("done")}</Button>
</Link>
</div>
@@ -113,7 +113,7 @@ export default function ZapierSetup(props: IZapierSetupProps) {
<div className="mt-5 ml-5">
<div>{t("install_zapier_app")}</div>
<div className="mt-3">
<Link href="/apps/zapier" passHref={true}>
<Link href="/apps/zapier" passHref={true} legacyBehavior>
<Button>{t("go_to_app_store")}</Button>
</Link>
</div>
+1 -1
View File
@@ -10,7 +10,7 @@
],
"dependencies": {
"@calcom/eslint-plugin-eslint": "*",
"eslint-config-next": "^12.2.5",
"eslint-config-next": "^13.1.1",
"eslint-config-prettier": "^8.5.0",
"eslint-config-turbo": "^0.0.3",
"eslint-plugin-playwright": "^0.9.0",
@@ -8,18 +8,15 @@ export default function UnconfirmedBookingBadge() {
const { t } = useLocale();
const { data: unconfirmedBookingCount } = trpc.viewer.bookingUnconfirmedCount.useQuery();
if (!unconfirmedBookingCount) return null;
else
return (
<Link href="/bookings/unconfirmed">
<>
<Badge
rounded
title={t("unconfirmed_bookings_tooltip")}
variant="orange"
className="cursor-pointer hover:bg-orange-800 hover:text-orange-100">
{unconfirmedBookingCount}
</Badge>
</>
</Link>
);
return (
<Link href="/bookings/unconfirmed">
<Badge
rounded
title={t("unconfirmed_bookings_tooltip")}
variant="orange"
className="cursor-pointer hover:bg-orange-800 hover:text-orange-100">
{unconfirmedBookingCount}
</Badge>
</Link>
);
}
@@ -88,10 +88,11 @@ export default function TeamListItem(props: Props) {
!isInvitee && "group hover:bg-neutral-50"
)}>
{!isInvitee ? (
<Link href={"/settings/teams/" + team.id + "/profile"}>
<a className="flex-grow cursor-pointer truncate text-sm" title={`${team.name}`}>
{teamInfo}
</a>
<Link
href={"/settings/teams/" + team.id + "/profile"}
className="flex-grow cursor-pointer truncate text-sm"
title={`${team.name}`}>
{teamInfo}
</Link>
) : (
teamInfo
@@ -263,10 +263,8 @@ const ProfileView = () => {
)}
</div>
<div className="">
<Link href={permalink} passHref={true}>
<a target="_blank">
<LinkIconButton Icon={Icon.FiExternalLink}>{t("preview")}</LinkIconButton>
</a>
<Link href={permalink} passHref={true} target="_blank">
<LinkIconButton Icon={Icon.FiExternalLink}>{t("preview")}</LinkIconButton>
</Link>
<LinkIconButton
Icon={Icon.FiLink}
@@ -122,13 +122,11 @@ const WorkflowListItem = (props: ItemProps) => {
</div>
</div>
<div className="flex-none">
<Link href={`/workflows/${workflow.id}`} passHref={true}>
<a target="_blank">
<Button type="button" color="minimal" className="mr-4">
<div className="hidden ltr:mr-2 rtl:ml-2 sm:block">{t("edit")}</div>
<Icon.FiExternalLink className="-mt-[2px] h-4 w-4 stroke-2 text-gray-600" />
</Button>
</a>
<Link href={`/workflows/${workflow.id}`} passHref={true} target="_blank">
<Button type="button" color="minimal" className="mr-4">
<div className="hidden ltr:mr-2 rtl:ml-2 sm:block">{t("edit")}</div>
<Icon.FiExternalLink className="-mt-[2px] h-4 w-4 stroke-2 text-gray-600" />
</Button>
</Link>
</div>
<Tooltip content={t("turn_off") as string}>
@@ -84,58 +84,56 @@ export default function WorkflowListPage({ workflows }: Props) {
{workflows.map((workflow) => (
<li key={workflow.id}>
<div className="first-line:group flex w-full items-center justify-between p-4 hover:bg-neutral-50 sm:px-6">
<Link href={"/workflows/" + workflow.id}>
<a className="flex-grow cursor-pointer">
<div className="rtl:space-x-reverse">
<div
className={classNames(
"max-w-56 truncate text-sm font-medium leading-6 text-gray-900 md:max-w-max",
workflow.name ? "text-gray-900" : "text-neutral-500"
)}>
{workflow.name
? workflow.name
: "Untitled (" +
`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`
.charAt(0)
.toUpperCase() +
`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) +
")"}
</div>
<ul className="mt-2 flex flex-wrap space-x-1 sm:flex-nowrap ">
<li className="mb-1 flex items-center whitespace-nowrap rounded-sm bg-gray-100 px-1 py-px text-xs text-gray-800 dark:bg-gray-900 dark:text-white">
<div>
{getActionIcon(workflow.steps)}
<Link href={"/workflows/" + workflow.id} className="flex-grow cursor-pointer">
<div className="rtl:space-x-reverse">
<div
className={classNames(
"max-w-56 truncate text-sm font-medium leading-6 text-gray-900 md:max-w-max",
workflow.name ? "text-gray-900" : "text-neutral-500"
)}>
{workflow.name
? workflow.name
: "Untitled (" +
`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`
.charAt(0)
.toUpperCase() +
`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}`.slice(1) +
")"}
</div>
<ul className="mt-2 flex flex-wrap space-x-1 sm:flex-nowrap ">
<li className="mb-1 flex items-center whitespace-nowrap rounded-sm bg-gray-100 px-1 py-px text-xs text-gray-800 dark:bg-gray-900 dark:text-white">
<div>
{getActionIcon(workflow.steps)}
<span className="mr-1">{t("triggers")}</span>
{workflow.timeUnit && workflow.time && (
<span className="mr-1">
{t(`${workflow.timeUnit.toLowerCase()}`, { count: workflow.time })}
</span>
)}
<span>{t(`${workflow.trigger.toLowerCase()}_trigger`)}</span>
</div>
</li>
<li className="mb-1 flex items-center whitespace-nowrap rounded-sm bg-gray-100 px-1 py-px text-xs text-gray-800 dark:bg-gray-900 dark:text-white">
{workflow.activeOn && workflow.activeOn.length > 0 ? (
<Tooltip
content={workflow.activeOn.map((activeOn, key) => (
<p key={key}>{activeOn.eventType.title}</p>
))}>
<div>
<Icon.FiLink className="mr-1.5 inline h-3 w-3" aria-hidden="true" />
{t("active_on_event_types", { count: workflow.activeOn.length })}
</div>
</Tooltip>
) : (
<span className="mr-1">{t("triggers")}</span>
{workflow.timeUnit && workflow.time && (
<span className="mr-1">
{t(`${workflow.timeUnit.toLowerCase()}`, { count: workflow.time })}
</span>
)}
<span>{t(`${workflow.trigger.toLowerCase()}_trigger`)}</span>
</div>
</li>
<li className="mb-1 flex items-center whitespace-nowrap rounded-sm bg-gray-100 px-1 py-px text-xs text-gray-800 dark:bg-gray-900 dark:text-white">
{workflow.activeOn && workflow.activeOn.length > 0 ? (
<Tooltip
content={workflow.activeOn.map((activeOn, key) => (
<p key={key}>{activeOn.eventType.title}</p>
))}>
<div>
<Icon.FiLink className="mr-1.5 inline h-3 w-3" aria-hidden="true" />
{t("no_active_event_types")}
{t("active_on_event_types", { count: workflow.activeOn.length })}
</div>
)}
</li>
</ul>
</div>
</a>
</Tooltip>
) : (
<div>
<Icon.FiLink className="mr-1.5 inline h-3 w-3" aria-hidden="true" />
{t("no_active_event_types")}
</div>
)}
</li>
</ul>
</div>
</Link>
<div className="flex flex-shrink-0">
<div className="hidden sm:block">
@@ -40,36 +40,37 @@ export function ScheduleListItem({
<li key={schedule.id}>
<div className="flex items-center justify-between py-5 hover:bg-neutral-50 ltr:pl-4 rtl:pr-4 sm:ltr:pl-0 sm:rtl:pr-0">
<div className="group flex w-full items-center justify-between hover:bg-neutral-50 sm:px-6">
<Link href={"/availability/" + schedule.id}>
<a className="flex-grow truncate text-sm" title={schedule.name}>
<div className="space-x-2 rtl:space-x-reverse">
<span className="truncate font-medium text-neutral-900">{schedule.name}</span>
{schedule.isDefault && (
<Badge variant="success" className="text-xs">
{t("default")}
</Badge>
)}
</div>
<p className="mt-1 text-xs text-neutral-500">
{schedule.availability
.filter((availability) => !!availability.days.length)
.map((availability) => (
<Fragment key={availability.id}>
{availabilityAsString(availability, {
locale: i18n.language,
hour12: displayOptions?.hour12,
})}
<br />
</Fragment>
))}
{schedule.timeZone && schedule.timeZone !== displayOptions?.timeZone && (
<p className="my-1 flex items-center first-letter:text-xs">
<Icon.FiGlobe />
&nbsp;{schedule.timeZone}
</p>
)}
</p>
</a>
<Link
href={"/availability/" + schedule.id}
className="flex-grow truncate text-sm"
title={schedule.name}>
<div className="space-x-2 rtl:space-x-reverse">
<span className="truncate font-medium text-neutral-900">{schedule.name}</span>
{schedule.isDefault && (
<Badge variant="success" className="text-xs">
{t("default")}
</Badge>
)}
</div>
<p className="mt-1 text-xs text-neutral-500">
{schedule.availability
.filter((availability) => !!availability.days.length)
.map((availability) => (
<Fragment key={availability.id}>
{availabilityAsString(availability, {
locale: i18n.language,
hour12: displayOptions?.hour12,
})}
<br />
</Fragment>
))}
{schedule.timeZone && schedule.timeZone !== displayOptions?.timeZone && (
<p className="my-1 flex items-center first-letter:text-xs">
<Icon.FiGlobe />
&nbsp;{schedule.timeZone}
</p>
)}
</p>
</Link>
</div>
<Dropdown>
@@ -117,16 +117,15 @@ const useTabs = () => {
const BackButtonInSidebar = ({ name }: { name: string }) => {
return (
<Link href="/.">
<a
target="_self"
className="group my-6 flex h-6 max-h-6 w-64 flex-row items-center rounded-md py-2 px-3 text-sm font-medium leading-4 text-black hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900"
data-testid={`vertical-tab-${name}`}>
<Icon.FiArrowLeft className="h-4 w-4 stroke-[2px] ltr:mr-[10px] rtl:ml-[10px] md:mt-0" />
<Skeleton title={name} as="p" className="max-w-36 min-h-4 truncate">
{name}
</Skeleton>
</a>
<Link
href="/."
target="_self"
className="group my-6 flex h-6 max-h-6 w-64 flex-row items-center rounded-md py-2 px-3 text-sm font-medium leading-4 text-black hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900"
data-testid={`vertical-tab-${name}`}>
<Icon.FiArrowLeft className="h-4 w-4 stroke-[2px] ltr:mr-[10px] rtl:ml-[10px] md:mt-0" />
<Skeleton title={name} as="p" className="max-w-36 min-h-4 truncate">
{name}
</Skeleton>
</Link>
);
};
@@ -212,14 +211,12 @@ const SettingsSidebarContainer = ({
<React.Fragment key={tab.href}>
<div className={`${!tab.children?.length ? "mb-3" : ""}`}>
<Link href={tab.href}>
<a>
<div className="group flex h-9 w-64 flex-row items-center rounded-md px-3 py-[10px] text-sm font-medium leading-none text-gray-600 hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900">
{tab && tab.icon && (
<tab.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-3 rtl:ml-3 md:mt-0" />
)}
<p className="text-sm font-medium leading-5">{t(tab.name)}</p>
</div>
</a>
<div className="group flex h-9 w-64 flex-row items-center rounded-md px-3 py-[10px] text-sm font-medium leading-none text-gray-600 hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900">
{tab && tab.icon && (
<tab.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-3 rtl:ml-3 md:mt-0" />
)}
<p className="text-sm font-medium leading-5">{t(tab.name)}</p>
</div>
</Link>
{teams &&
teamMenuState &&
@@ -16,8 +16,8 @@ function AdminPasswordBanner() {
text={t("invalid_admin_password", { user: data.user.username })}
variant="warning"
actions={
<Link href="/settings/security/password">
<a className="border-b border-b-black">{t("change_password_admin")}</a>
<Link href="/settings/security/password" className="border-b border-b-black">
{t("change_password_admin")}
</Link>
}
/>
+17 -17
View File
@@ -30,23 +30,23 @@ export function AppStoreCategories({
},
}}
renderItem={(category) => (
<Link key={category.name} href={"/apps/categories/" + category.name}>
<a
data-testid={`app-store-category-${category.name}`}
className="relative flex rounded-md"
style={{ background: "radial-gradient(farthest-side at top right, #a2abbe 0%, #E3E3E3 100%)" }}>
<div className="w-full self-center bg-[url('/noise.svg')] bg-cover bg-center bg-no-repeat px-6 py-4">
{isLocaleReady ? (
<h3 className="font-medium capitalize">{category.name}</h3>
) : (
<SkeletonText invisible />
)}
<p className="text-sm text-gray-500">
{isLocaleReady ? t("number_apps", { count: category.count }) : <SkeletonText invisible />}{" "}
<Icon.FiArrowRight className="inline-block h-4 w-4" />
</p>
</div>
</a>
<Link
key={category.name}
href={"/apps/categories/" + category.name}
data-testid={`app-store-category-${category.name}`}
className="relative flex rounded-md"
style={{ background: "radial-gradient(farthest-side at top right, #a2abbe 0%, #E3E3E3 100%)" }}>
<div className="w-full self-center bg-[url('/noise.svg')] bg-cover bg-center bg-no-repeat px-6 py-4">
{isLocaleReady ? (
<h3 className="font-medium capitalize">{category.name}</h3>
) : (
<SkeletonText invisible />
)}
<p className="text-sm text-gray-500">
{isLocaleReady ? t("number_apps", { count: category.count }) : <SkeletonText invisible />}{" "}
<Icon.FiArrowRight className="inline-block h-4 w-4" />
</p>
</div>
</Link>
)}
/>
@@ -38,16 +38,14 @@ type BreadcrumbItemProps = {
export const BreadcrumbItem = ({ children, href, listProps }: BreadcrumbItemProps) => {
return (
<li {...listProps}>
<Link href={href}>
<a>{children}</a>
</Link>
<Link href={href}>{children}</Link>
</li>
);
};
export const BreadcrumbContainer = () => {
const router = useRouter();
const [breadcrumbs, setBreadcrumbs] = useState<{ href: string; label: string }[]>();
const [, setBreadcrumbs] = useState<{ href: string; label: string }[]>();
useEffect(() => {
const rawPath = router.asPath.split("?")[0]; // this will ignore any query params for now?
+1 -1
View File
@@ -229,7 +229,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
);
return props.href ? (
<Link passHref href={props.href} shallow={shallow && shallow}>
<Link passHref href={props.href} shallow={shallow && shallow} legacyBehavior>
{element}
</Link>
) : (
+4 -8
View File
@@ -18,16 +18,12 @@ export default function Credits() {
return (
<small className="mx-3 mt-1 mb-2 hidden text-[0.5rem] opacity-50 lg:block">
&copy; {new Date().getFullYear()}{" "}
<Link href="https://go.cal.com/credits">
<a target="_blank" className="hover:underline">
{COMPANY_NAME}
</a>
<Link href="https://go.cal.com/credits" target="_blank" className="hover:underline">
{COMPANY_NAME}
</Link>{" "}
{hasMounted && (
<Link href="https://go.cal.com/releases">
<a target="_blank" className="hover:underline">
{CalComVersion}
</a>
<Link href="https://go.cal.com/releases" target="_blank" className="hover:underline">
{CalComVersion}
</Link>
)}
</small>
+14 -14
View File
@@ -51,7 +51,7 @@ export function ListItem(props: ListItemProps) {
);
return href ? (
<Link passHref href={href}>
<Link passHref href={href} legacyBehavior>
{element}
</Link>
) : (
@@ -79,19 +79,19 @@ export function ListLinkItem(props: ListLinkItemProps) {
"group flex w-full items-center justify-between p-5 hover:bg-neutral-50",
disabled ? "hover:bg-white" : ""
)}>
<Link passHref href={href}>
<a
className={classNames(
"flex-grow truncate text-sm",
disabled ? "pointer-events-none cursor-not-allowed opacity-30" : ""
)}>
<h1 className="text-sm font-semibold leading-none">{heading}</h1>
<h2 className="min-h-4 mt-2 text-sm font-normal leading-none">
{subHeading.substring(0, 100)}
{subHeading.length > 100 && "..."}
</h2>
<div className="mt-2">{children}</div>
</a>
<Link
passHref
href={href}
className={classNames(
"flex-grow truncate text-sm",
disabled ? "pointer-events-none cursor-not-allowed opacity-30" : ""
)}>
<h1 className="text-sm font-semibold leading-none">{heading}</h1>
<h2 className="min-h-4 mt-2 text-sm font-normal leading-none">
{subHeading.substring(0, 100)}
{subHeading.length > 100 && "..."}
</h2>
<div className="mt-2">{children}</div>
</Link>
{actions}
</li>
+1 -1
View File
@@ -24,7 +24,7 @@
"@wojtekmaj/react-daterange-picker": "^3.3.1",
"class-variance-authority": "^0.3.0",
"downshift": "^6.1.9",
"next": "^12.3.1",
"next": "^13.1.1",
"react": "^18.2.0",
"react-colorful": "^5.6.0",
"react-feather": "^2.0.10",
+7 -8
View File
@@ -129,14 +129,13 @@ export function Card({
{variant === "SidebarCard" && (
<div className="mt-2 flex items-center justify-between">
{learnMore && (
<Link href={learnMore.href}>
<a
onClick={actionButton?.onClick}
target="_blank"
rel="noreferrer"
className="text-xs font-medium">
{learnMore.text}
</a>
<Link
href={learnMore.href}
onClick={actionButton?.onClick}
target="_blank"
rel="noreferrer"
className="text-xs font-medium">
{learnMore.text}
</Link>
)}
<button
+2 -2
View File
@@ -114,8 +114,8 @@ export function ButtonOrLink({ href, ...props }: ButtonOrLinkProps) {
if (isLink) {
return (
<Link href={href}>
<a>{content}</a>
<Link href={href} legacyBehavior>
{content}
</Link>
);
}
+51 -64
View File
@@ -590,32 +590,31 @@ const NavigationItem: React.FC<{
return (
<Fragment>
<Link href={item.href}>
<a
aria-label={t(item.name)}
className={classNames(
"group flex items-center rounded-md py-2 px-3 text-sm font-medium text-gray-600 hover:bg-gray-100 lg:px-[14px] [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:hover:text-neutral-900",
isChild
? "[&[aria-current='page']]:text-brand-900 hidden pl-16 lg:flex lg:pl-11 [&[aria-current='page']]:bg-transparent"
: "[&[aria-current='page']]:text-brand-900 "
)}
aria-current={current ? "page" : undefined}>
{item.icon && (
<item.icon
className="h-4 w-4 flex-shrink-0 text-gray-500 ltr:mr-3 rtl:ml-3 [&[aria-current='page']]:text-inherit"
aria-hidden="true"
aria-current={current ? "page" : undefined}
/>
)}
{isLocaleReady ? (
<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" />
)}
</a>
<Link
href={item.href}
aria-label={t(item.name)}
className={classNames(
"group flex items-center rounded-md py-2 px-3 text-sm font-medium text-gray-600 hover:bg-gray-100 lg:px-[14px] [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:hover:text-neutral-900",
isChild
? "[&[aria-current='page']]:text-brand-900 hidden pl-16 lg:flex lg:pl-11 [&[aria-current='page']]:bg-transparent"
: "[&[aria-current='page']]:text-brand-900 "
)}
aria-current={current ? "page" : undefined}>
{item.icon && (
<item.icon
className="h-4 w-4 flex-shrink-0 text-gray-500 ltr:mr-3 rtl:ml-3 [&[aria-current='page']]:text-inherit"
aria-hidden="true"
aria-current={current ? "page" : undefined}
/>
)}
{isLocaleReady ? (
<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" />
)}
</Link>
{item.child &&
isCurrent({ router, isChild, item }) &&
@@ -663,20 +662,20 @@ const MobileNavigationItem: React.FC<{
if (!shouldDisplayNavigationItem) return null;
return (
<Link key={item.name} href={item.href}>
<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"
aria-hidden="true"
aria-current={current ? "page" : undefined}
/>
)}
{isLocaleReady ? <span className="block truncate">{t(item.name)}</span> : <SkeletonText />}
</a>
<Link
key={item.name}
href={item.href}
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"
aria-hidden="true"
aria-current={current ? "page" : undefined}
/>
)}
{isLocaleReady ? <span className="block truncate">{t(item.name)}</span> : <SkeletonText />}
</Link>
);
};
@@ -693,16 +692,12 @@ const MobileNavigationMoreItem: React.FC<{
return (
<li className="border-b last:border-b-0" key={item.name}>
<Link href={item.href}>
<a className="flex items-center justify-between p-5 hover:bg-gray-100">
<span className="flex items-center font-semibold text-gray-700 ">
{item.icon && (
<item.icon className="h-5 w-5 flex-shrink-0 ltr:mr-3 rtl:ml-3" aria-hidden="true" />
)}
{isLocaleReady ? t(item.name) : <SkeletonText />}
</span>
<Icon.FiArrowRight className="h-5 w-5 text-gray-500" />
</a>
<Link href={item.href} className="flex items-center justify-between p-5 hover:bg-gray-100">
<span className="flex items-center font-semibold text-gray-700 ">
{item.icon && <item.icon className="h-5 w-5 flex-shrink-0 ltr:mr-3 rtl:ml-3" aria-hidden="true" />}
{isLocaleReady ? t(item.name) : <SkeletonText />}
</span>
<Icon.FiArrowRight className="h-5 w-5 text-gray-500" />
</Link>
</li>
);
@@ -726,10 +721,8 @@ function SideBar() {
<aside className="desktop-transparent top-0 hidden h-full max-h-screen w-14 flex-col overflow-y-auto border-r border-gray-100 bg-gray-50 md:sticky md:flex lg:w-56 lg:px-4">
<div className="flex h-full flex-col justify-between py-3 lg:pt-5 ">
<header className="items-center justify-between md:hidden lg:flex">
<Link href="/event-types">
<a className="px-4">
<Logo small />
</a>
<Link href="/event-types" className="px-4">
<Logo small />
</Link>
<div className="flex space-x-2 rtl:space-x-reverse">
<button
@@ -751,10 +744,8 @@ function SideBar() {
<hr className="desktop-only absolute -left-3 -right-3 mt-4 block w-full border-gray-200" />
{/* logo icon for tablet */}
<Link href="/event-types">
<a className="text-center md:inline lg:hidden">
<Logo small icon />
</a>
<Link href="/event-types" className="text-center md:inline lg:hidden">
<Logo small icon />
</Link>
<Navigation />
@@ -871,9 +862,7 @@ function TopNav() {
style={isEmbed ? { display: "none" } : {}}
className="sticky top-0 z-40 flex w-full items-center justify-between border-b border-gray-200 bg-gray-50 bg-opacity-50 py-1.5 px-4 backdrop-blur-lg sm:p-4 md:hidden">
<Link href="/event-types">
<a>
<Logo />
</a>
<Logo />
</Link>
<div className="flex items-center gap-2 self-center">
<span className="group flex items-center rounded-full text-sm font-medium text-gray-700 hover:bg-gray-50 hover:text-neutral-900 lg:hidden">
@@ -882,9 +871,7 @@ function TopNav() {
<button className="rounded-full p-1 text-gray-400 hover:bg-gray-50 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-black focus:ring-offset-2">
<span className="sr-only">{t("settings")}</span>
<Link href="/settings/profile">
<a>
<Icon.FiSettings className="h-4 w-4 text-gray-700" aria-hidden="true" />
</a>
<Icon.FiSettings className="h-4 w-4 text-gray-700" aria-hidden="true" />
</Link>
</button>
<UserDropdown small />
+5 -1
View File
@@ -24,7 +24,11 @@ function Stepper<T extends DefaultStep>(props: {
<ol role="list" className="ml-8 flex items-center space-x-5">
{steps.map((mapStep, index) => (
<li key={mapStep.title}>
<Link href={props.disableSteps ? "#" : `${href}?step=${index + 1}`} shallow replace>
<Link
href={props.disableSteps ? "#" : `${href}?step=${index + 1}`}
shallow
replace
legacyBehavior>
{index + 1 < props.step ? (
<a className="block h-2.5 w-2.5 rounded-full bg-gray-600 hover:bg-gray-900">
<span className="sr-only">{mapStep.title}</span>
+1 -7
View File
@@ -56,13 +56,7 @@ export default function FormCard({
<span className="text-sm font-semibold leading-none">{label}</span>
{badge && (
<Badge className="ml-2" variant={badge.variant}>
{badge.href ? (
<Link href={badge.href}>
<a>{badge.text}</a>
</Link>
) : (
badge.text
)}
{badge.href ? <Link href={badge.href}>{badge.text}</Link> : badge.text}
</Badge>
)}
</div>
@@ -23,28 +23,29 @@ const HorizontalTabItem = function ({ name, href, linkProps, ...props }: Horizon
const isCurrent = asPath.startsWith(href);
return (
<Link key={name} href={href} {...linkProps}>
<a
className={classNames(
isCurrent ? "bg-gray-200 text-gray-900" : " text-gray-600 hover:bg-gray-100 hover:text-gray-900 ",
"inline-flex items-center justify-center whitespace-nowrap rounded-[4px] py-[10px] px-4 text-sm font-medium leading-4 md:mb-0",
props.disabled && "pointer-events-none !opacity-30",
props.className
)}
aria-current={isCurrent ? "page" : undefined}>
{props.icon && (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
<props.icon
className={classNames(
isCurrent ? "text-neutral-900" : "text-gray-400 group-hover:text-gray-500",
"-ml-0.5 hidden h-4 w-4 ltr:mr-2 rtl:ml-2 sm:inline-block"
)}
aria-hidden="true"
/>
)}
{isLocaleReady ? t(name) : <SkeletonText className="h-4 w-24" />}
</a>
<Link
key={name}
href={href}
{...linkProps}
className={classNames(
isCurrent ? "bg-gray-200 text-gray-900" : " text-gray-600 hover:bg-gray-100 hover:text-gray-900 ",
"inline-flex items-center justify-center whitespace-nowrap rounded-[4px] py-[10px] px-4 text-sm font-medium leading-4 md:mb-0",
props.disabled && "pointer-events-none !opacity-30",
props.className
)}
aria-current={isCurrent ? "page" : undefined}>
{props.icon && (
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
<props.icon
className={classNames(
isCurrent ? "text-neutral-900" : "text-gray-400 group-hover:text-gray-500",
"-ml-0.5 hidden h-4 w-4 ltr:mr-2 rtl:ml-2 sm:inline-block"
)}
aria-hidden="true"
/>
)}
{isLocaleReady ? t(name) : <SkeletonText className="h-4 w-24" />}
</Link>
);
};
@@ -43,45 +43,46 @@ const VerticalTabItem = function ({
<Fragment key={name}>
{!props.hidden && (
<>
<Link key={name} href={href} {...linkProps}>
<a
target={props.isExternalLink ? "_blank" : "_self"}
className={classNames(
props.textClassNames || "text-sm font-medium leading-none text-gray-600",
"min-h-9 group flex w-64 flex-row items-center rounded-md px-2 py-[10px] hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900",
props.disabled && "pointer-events-none !opacity-30",
(isChild || !props.icon) && "ml-7 w-auto ltr:mr-5 rtl:ml-5",
!info ? "h-6" : "h-14",
props.className
<Link
key={name}
href={href}
{...linkProps}
target={props.isExternalLink ? "_blank" : "_self"}
className={classNames(
props.textClassNames || "text-sm font-medium leading-none text-gray-600",
"min-h-9 group flex w-64 flex-row items-center rounded-md px-2 py-[10px] hover:bg-gray-100 group-hover:text-gray-700 [&[aria-current='page']]:bg-gray-200 [&[aria-current='page']]:text-gray-900",
props.disabled && "pointer-events-none !opacity-30",
(isChild || !props.icon) && "ml-7 w-auto ltr:mr-5 rtl:ml-5",
!info ? "h-6" : "h-14",
props.className
)}
data-testid={`vertical-tab-${name}`}
aria-current={isCurrent ? "page" : undefined}>
{props.icon && (
<props.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-[10px] rtl:ml-[10px] md:mt-0" />
)}
<div className="h-fit">
<span className="flex items-center space-x-2 rtl:space-x-reverse">
<Skeleton title={t(name)} as="p" className="max-w-36 min-h-4 truncate">
{t(name)}
</Skeleton>
{props.isExternalLink ? <Icon.FiExternalLink /> : null}
</span>
{info && (
<Skeleton as="p" title={t(info)} className="max-w-44 mt-1 truncate text-xs font-normal">
{t(info)}
</Skeleton>
)}
data-testid={`vertical-tab-${name}`}
aria-current={isCurrent ? "page" : undefined}>
{props.icon && (
<props.icon className="h-[16px] w-[16px] stroke-[2px] ltr:mr-[10px] rtl:ml-[10px] md:mt-0" />
)}
<div className="h-fit">
<span className="flex items-center space-x-2 rtl:space-x-reverse">
<Skeleton title={t(name)} as="p" className="max-w-36 min-h-4 truncate">
{t(name)}
</Skeleton>
{props.isExternalLink ? <Icon.FiExternalLink /> : null}
</span>
{info && (
<Skeleton as="p" title={t(info)} className="max-w-44 mt-1 truncate text-xs font-normal">
{t(info)}
</Skeleton>
)}
</div>
{!disableChevron && isCurrent && (
<div className="ml-auto self-center">
<Icon.FiChevronRight
width={20}
height={20}
className="h-auto w-[20px] stroke-[1.5px] text-gray-700"
/>
</div>
{!disableChevron && isCurrent && (
<div className="ml-auto self-center">
<Icon.FiChevronRight
width={20}
height={20}
className="h-auto w-[20px] stroke-[1.5px] text-gray-700"
/>
</div>
)}
</a>
)}
</Link>
{props.children?.map((child) => (
<VerticalTabItem key={child.name} {...child} isChild />