Removed disconnected calendar notice
This commit is contained in:
parent
046dadbae2
commit
6fdbadc94b
|
@ -1,3 +1,7 @@
|
|||
/**
|
||||
* @deprecated file is not used anymore
|
||||
* Use `/apps/web/pages/v2/event-types/index.tsx` instead
|
||||
*/
|
||||
import { UserPlan } from "@prisma/client";
|
||||
import { Trans } from "next-i18next";
|
||||
import Head from "next/head";
|
||||
|
@ -95,7 +99,10 @@ const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGrou
|
|||
};
|
||||
|
||||
const MemoizedItem = React.memo(Item);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use component from `/apps/web/pages/v2/event-types/index.tsx` instead
|
||||
*/
|
||||
export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeListProps): JSX.Element => {
|
||||
const { t } = useLocale();
|
||||
const router = useRouter();
|
||||
|
@ -527,7 +534,10 @@ const EventTypeListHeading = ({ profile, membershipCount }: EventTypeListHeading
|
|||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use component from `/apps/web/pages/v2/event-types/index.tsx` instead
|
||||
*/
|
||||
const CreateFirstEventTypeView = () => {
|
||||
const { t } = useLocale();
|
||||
|
||||
|
@ -551,7 +561,10 @@ const CTA = () => {
|
|||
};
|
||||
|
||||
const WithQuery = withQuery(["viewer.eventTypes"]);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use component from `/apps/web/pages/v2/event-types/index.tsx` instead
|
||||
*/
|
||||
const EventTypesPage = () => {
|
||||
const { t } = useLocale();
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import { TRPCClientError } from "@trpc/react";
|
|||
|
||||
type EventTypeGroups = inferQueryOutput<"viewer.eventTypes">["eventTypeGroups"];
|
||||
type EventTypeGroupProfile = EventTypeGroups[number]["profile"];
|
||||
type ConnectedCalendars = inferQueryOutput<"viewer.connectedCalendars">["connectedCalendars"][number];
|
||||
|
||||
interface EventTypeListHeadingProps {
|
||||
profile: EventTypeGroupProfile;
|
||||
|
@ -53,21 +52,9 @@ interface EventTypeListProps {
|
|||
types: EventType[];
|
||||
}
|
||||
|
||||
const Item = ({
|
||||
type,
|
||||
group,
|
||||
readOnly,
|
||||
connectedCalendars,
|
||||
}: {
|
||||
type: EventType;
|
||||
group: EventTypeGroup;
|
||||
readOnly: boolean;
|
||||
connectedCalendars: ConnectedCalendars[] | undefined;
|
||||
}) => {
|
||||
const Item = ({ type, group, readOnly }: { type: EventType; group: EventTypeGroup; readOnly: boolean }) => {
|
||||
const { t } = useLocale();
|
||||
|
||||
const isCalendarConnectedMissing = connectedCalendars?.length && !type.team && !type.destinationCalendar;
|
||||
|
||||
return (
|
||||
<Link href={`/event-types/${type.id}`}>
|
||||
<a
|
||||
|
@ -90,11 +77,6 @@ const Item = ({
|
|||
{t("hidden") as string}
|
||||
</span>
|
||||
)}
|
||||
{!!isCalendarConnectedMissing && (
|
||||
<span className="rtl:mr-2inline items-center rounded-sm bg-red-100 px-1.5 py-0.5 text-xs font-medium text-red-800 ltr:ml-2">
|
||||
{t("missing_connected_calendar") as string}
|
||||
</span>
|
||||
)}
|
||||
{readOnly && (
|
||||
<span className="rtl:mr-2inline items-center rounded-sm bg-gray-100 px-1.5 py-0.5 text-xs font-medium text-gray-800 ltr:ml-2">
|
||||
{t("readonly") as string}
|
||||
|
@ -227,8 +209,6 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
|
|||
}
|
||||
}, []);
|
||||
|
||||
const connectedCalendarsQuery = trpc.useQuery(["viewer.connectedCalendars"]);
|
||||
|
||||
return (
|
||||
<div className="mb-16 flex overflow-hidden rounded-md border border-gray-200 bg-white">
|
||||
<ul className="w-full divide-y divide-neutral-200" data-testid="event-types">
|
||||
|
@ -265,12 +245,7 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL
|
|||
</button>
|
||||
</>
|
||||
)}
|
||||
<MemoizedItem
|
||||
type={type}
|
||||
group={group}
|
||||
readOnly={readOnly}
|
||||
connectedCalendars={connectedCalendarsQuery.data?.connectedCalendars}
|
||||
/>
|
||||
<MemoizedItem type={type} group={group} readOnly={readOnly} />
|
||||
<div className="mt-4 hidden flex-shrink-0 sm:mt-0 sm:ml-5 sm:flex">
|
||||
<div className="flex justify-between space-x-2 rtl:space-x-reverse">
|
||||
{type.users?.length > 1 && (
|
||||
|
|
Loading…
Reference in New Issue
Block a user