Add CTA to Meta component & button to add calendar on /settings/calendars (#5099)

Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
Joe Au-YeungandPeer Richelsen authored and GitHub committed 2022-10-20 10:03:39 +00:00
1 parent 7bb3397503
commit e53abd921e
4 files changed
+28 -11

No files matched your search

@@ -4,11 +4,10 @@ import { useRouter } from "next/router";
import { Fragment } from "react";
import DestinationCalendarSelector from "@calcom/features/calendars/DestinationCalendarSelector";
import { WEBAPP_URL } from "@calcom/lib/constants";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { trpc } from "@calcom/trpc/react";
import { Icon } from "@calcom/ui";
import { Alert } from "@calcom/ui/v2";
import { Alert, Button } from "@calcom/ui/v2";
import Badge from "@calcom/ui/v2/core/Badge";
import EmptyScreen from "@calcom/ui/v2/core/EmptyScreen";
import Meta from "@calcom/ui/v2/core/Meta";
@@ -36,6 +35,18 @@ const SkeletonLoader = () => {
);
};
const AddCalendarButton = () => {
const { t } = useLocale();
return (
<>
<Button color="secondary" StartIcon={Icon.FiPlus} href="/apps/categories/calendar">
{t("add_calendar")}
</Button>
</>
);
};
const CalendarsView = () => {
const { t } = useLocale();
const router = useRouter();
@@ -51,7 +62,11 @@ const CalendarsView = () => {
return (
<>
<Meta title="Calendars" description="Configure how your event types interact with your calendars" />
<Meta
title="Calendars"
description="Configure how your event types interact with your calendars"
CTA={<AddCalendarButton />}
/>
<QueryCell
query={query}
customLoader={<SkeletonLoader />}
@@ -174,7 +189,7 @@ const CalendarsView = () => {
headline={t("no_calendar_installed")}
description={t("no_calendar_installed_description")}
buttonText={t("add_a_calendar")}
buttonOnClick={() => router.push(`${WEBAPP_URL}/apps/categories/calendar`)}
buttonOnClick={() => router.push("/apps/categories/calendar")}
/>
);
}}
@@ -1324,5 +1324,6 @@
"saml_sp_entity_id": "SP Entity ID",
"saml_sp_acs_url_copied": "ACS URL copied!",
"saml_sp_entity_id_copied": "SP Entity ID copied!",
"saml_btn_configure": "Configure"
"saml_btn_configure": "Configure",
"add_calendar": "Add Calendar"
}