@@ -25,17 +24,12 @@ export default function SSOConfiguration({ teamId }: { teamId: number | null })
const { data: connection, isPending, error } = trpc.viewer.saml.get.useQuery({ teamId });
if (isPending) {
- return
;
+ return
;
}
if (error) {
return (
<>
-
>
);
diff --git a/packages/features/ee/sso/page/orgs-sso-view.tsx b/packages/features/ee/sso/page/orgs-sso-view.tsx
index 15cbe6b505..7db14ff84b 100644
--- a/packages/features/ee/sso/page/orgs-sso-view.tsx
+++ b/packages/features/ee/sso/page/orgs-sso-view.tsx
@@ -14,8 +14,7 @@ const SAMLSSO = () => {
const { data, status } = useSession();
const org = data?.user.org;
- if (status === "loading")
-
;
+ if (status === "loading")
;
if (!org) {
return null;
diff --git a/packages/ui/components/apps/SkeletonLoader.tsx b/packages/ui/components/apps/SkeletonLoader.tsx
index 31165686a9..6a0ca1debe 100644
--- a/packages/ui/components/apps/SkeletonLoader.tsx
+++ b/packages/ui/components/apps/SkeletonLoader.tsx
@@ -1,21 +1,10 @@
import { ShellSubHeading } from "../layout";
-import Meta from "../meta/Meta";
import { SkeletonText } from "../skeleton";
-export function SkeletonLoader({
- className,
- title,
- description,
-}: {
- className?: string;
- title?: string;
- description?: string;
-}) {
+export function SkeletonLoader({ className }: { className?: string }) {
return (
<>
} {...{ className }} />
- {title && description &&
}
-
diff --git a/packages/ui/components/meta/Meta.tsx b/packages/ui/components/meta/Meta.tsx
deleted file mode 100644
index 58ca372a16..0000000000
--- a/packages/ui/components/meta/Meta.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-"use client";
-
-import Head from "next/head";
-import { createContext, useContext, useState, useEffect } from "react";
-import type { ReactNode } from "react";
-
-import { APP_NAME } from "@calcom/lib/constants";
-
-type MetaType = {
- title: string;
- description: string;
- backButton?: boolean;
- CTA?: ReactNode;
- borderInShellHeader?: boolean;
-};
-
-const initialMeta: MetaType = {
- title: "",
- description: "",
- backButton: false,
- CTA: null,
- borderInShellHeader: true,
-};
-
-const MetaContext = createContext({
- meta: initialMeta,
- // eslint-disable-next-line @typescript-eslint/no-empty-function
- setMeta: (_newMeta: Partial) => {},
-});
-
-export function useMeta() {
- return useContext(MetaContext);
-}
-
-export function MetaProvider({ children }: { children: ReactNode }) {
- const [value, setValue] = useState(initialMeta);
- const setMeta = (newMeta: Partial) => {
- setValue((v) => ({ ...v, ...newMeta }));
- };
-
- return {children};
-}
-
-/**
- * The purpose of this component is to simplify title and description handling.
- * Similarly to `next/head`'s `Head` component this allow us to update the metadata for a page
- * from any children, also exposes the metadata via the `useMeta` hook in case we need them
- * elsewhere (ie. on a Heading, Title, Subtitle, etc.)
- * @example
- */
-export default function Meta({ title, description, backButton, CTA, borderInShellHeader }: MetaType) {
- const { setMeta, meta } = useMeta();
-
- /* @TODO: maybe find a way to have this data on first render to prevent flicker */
- useEffect(() => {
- if (meta.title !== title || meta.description !== description || meta.CTA !== CTA) {
- setMeta({ title, description, backButton, CTA, borderInShellHeader });
- }
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [title, description, backButton, CTA]);
-
- const title_ = `${title} | ${APP_NAME}`;
- return (
-
- {title_}
-
-
- );
-}
diff --git a/packages/ui/components/meta/index.ts b/packages/ui/components/meta/index.ts
deleted file mode 100644
index f11468d4e1..0000000000
--- a/packages/ui/components/meta/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { default as Meta, MetaProvider, useMeta } from "./Meta";
diff --git a/packages/ui/components/meta/meta.test.tsx b/packages/ui/components/meta/meta.test.tsx
deleted file mode 100644
index 6c9edaa83d..0000000000
--- a/packages/ui/components/meta/meta.test.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { render } from "@testing-library/react";
-import { vi } from "vitest";
-
-import Meta, { useMeta } from "./Meta";
-
-vi.mock("./Meta", async () => {
- const actualMeta = (await vi.importActual("./Meta")) as object;
- const MockMeta = ({ title, description }: { title: string; description: string }) => (
-
-
{title}
-
{description}
-
- );
-
- type MetaProviderProps = {
- children: React.ReactNode;
- };
-
- return {
- ...actualMeta,
- default: MockMeta,
- useMeta: vi.fn(),
- MetaProvider: ({ children }: MetaProviderProps) => children,
- };
-});
-
-describe("Meta Component", () => {
- test("Should render with default metadata", () => {
- (useMeta as jest.Mock).mockReturnValue({
- meta: { title: "", description: "", backButton: false, CTA: null },
- });
-
- const { getByText } = render();
-
- expect(getByText("Page Title")).toBeInTheDocument();
- expect(getByText("Page Description")).toBeInTheDocument();
- });
-
- test("Should update metadata when props change", () => {
- (useMeta as jest.Mock).mockReturnValue({
- meta: { title: "", description: "", backButton: false, CTA: null },
- });
-
- const { rerender, getByText } = render();
-
- expect(getByText("Page Title")).toBeInTheDocument();
- expect(getByText("Page Description")).toBeInTheDocument();
-
- rerender();
-
- expect(getByText("New Title")).toBeInTheDocument();
- expect(getByText("New Description")).toBeInTheDocument();
- });
-});
diff --git a/packages/ui/index.ts b/packages/ui/index.ts
index b9385a946d..1027668d48 100644
--- a/packages/ui/index.ts
+++ b/packages/ui/index.ts
@@ -124,7 +124,6 @@ export { AppListCard } from "./components/app-list-card";
export { DisconnectIntegrationComponent } from "./components/disconnect-calendar-integration";
export { CalendarSwitchComponent } from "./components/calendar-switch";
export { showToast, ErrorToast, SuccessToast, WarningToast } from "./components/toast"; // We don't export the toast components as they are only used in local storybook file
-export { Meta, MetaProvider, useMeta } from "./components/meta";
export { ShellSubHeading } from "./components/layout";
/** ⬇️ TODO - Move these to components */