From f7f8f077782dd024ac940b4bfaf644f76fcb1c49 Mon Sep 17 00:00:00 2001 From: Johannes <72809645+jobenjada@users.noreply.github.com> Date: Tue, 21 Oct 2025 04:06:59 -0700 Subject: [PATCH] chore: clean up login screen (#6710) --- apps/web/images/cal-logo-light.svg | 9 --- .../modules/auth/components/form-wrapper.tsx | 2 +- .../auth/components/testimonial.test.tsx | 59 ------------------- .../modules/auth/components/testimonial.tsx | 51 ---------------- apps/web/modules/auth/login/page.tsx | 42 ++++++------- apps/web/modules/auth/signup/page.test.tsx | 7 +-- apps/web/modules/auth/signup/page.tsx | 52 ++++++++-------- 7 files changed, 43 insertions(+), 179 deletions(-) delete mode 100644 apps/web/images/cal-logo-light.svg delete mode 100644 apps/web/modules/auth/components/testimonial.test.tsx delete mode 100644 apps/web/modules/auth/components/testimonial.tsx diff --git a/apps/web/images/cal-logo-light.svg b/apps/web/images/cal-logo-light.svg deleted file mode 100644 index bccfe813ef..0000000000 --- a/apps/web/images/cal-logo-light.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/apps/web/modules/auth/components/form-wrapper.tsx b/apps/web/modules/auth/components/form-wrapper.tsx index 72f5714dd6..0a50e7d52a 100644 --- a/apps/web/modules/auth/components/form-wrapper.tsx +++ b/apps/web/modules/auth/components/form-wrapper.tsx @@ -8,7 +8,7 @@ interface FormWrapperProps { export const FormWrapper = ({ children }: FormWrapperProps) => { return (
-
+
diff --git a/apps/web/modules/auth/components/testimonial.test.tsx b/apps/web/modules/auth/components/testimonial.test.tsx deleted file mode 100644 index 700ca2d20f..0000000000 --- a/apps/web/modules/auth/components/testimonial.test.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import "@testing-library/jest-dom/vitest"; -import { cleanup, render, screen } from "@testing-library/react"; -import { TFnType } from "@tolgee/react"; -import { afterEach, describe, expect, test, vi } from "vitest"; -import { getTranslate } from "@/tolgee/server"; -import { Testimonial } from "./testimonial"; - -vi.mock("@/tolgee/server", () => ({ - getTranslate: vi.fn(), -})); - -vi.mock("next/image", () => ({ - default: ({ src, alt }: { src: string; alt: string }) => ( - {alt} - ), -})); - -describe("Testimonial", () => { - afterEach(() => { - cleanup(); - }); - - test("renders testimonial content with translations", async () => { - const mockTranslate = vi.mocked(getTranslate); - const mockT: TFnType = (key) => { - const translations: Record = { - "auth.testimonial_title": "Testimonial Title", - "auth.testimonial_all_features_included": "All features included", - "auth.testimonial_free_and_open_source": "Free and open source", - "auth.testimonial_no_credit_card_required": "No credit card required", - "auth.testimonial_1": "Test testimonial quote", - }; - return translations[key] || key; - }; - mockTranslate.mockResolvedValue(mockT); - - render(await Testimonial()); - - // Check title - expect(screen.getByText("Testimonial Title")).toBeInTheDocument(); - - // Check feature points - expect(screen.getByText("All features included")).toBeInTheDocument(); - expect(screen.getByText("Free and open source")).toBeInTheDocument(); - expect(screen.getByText("No credit card required")).toBeInTheDocument(); - - // Check testimonial quote - expect(screen.getByText("Test testimonial quote")).toBeInTheDocument(); - - // Check testimonial author - expect(screen.getByText("Peer Richelsen, Co-Founder Cal.com")).toBeInTheDocument(); - - // Check images - const images = screen.getAllByTestId("mock-image"); - expect(images).toHaveLength(2); - expect(images[0]).toHaveAttribute("alt", "Cal.com Co-Founder Peer Richelsen"); - expect(images[1]).toHaveAttribute("alt", "Cal.com Logo"); - }); -}); diff --git a/apps/web/modules/auth/components/testimonial.tsx b/apps/web/modules/auth/components/testimonial.tsx deleted file mode 100644 index 22ef4badf9..0000000000 --- a/apps/web/modules/auth/components/testimonial.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { CheckCircle2Icon } from "lucide-react"; -import Image from "next/image"; -import CalComLogo from "@/images/cal-logo-light.svg"; -import Peer from "@/images/peer.webp"; -import { getTranslate } from "@/tolgee/server"; - -export const Testimonial = async () => { - const t = await getTranslate(); - return ( -
-
-
-

{t("auth.testimonial_title")}

-
- {/*

- Make customer-centric decisions based on data. -
Keep 100% data ownership. -

*/} -
-
- -

{t("auth.testimonial_all_features_included")}

-
-
- -

{t("auth.testimonial_free_and_open_source")}

-
-
- -

{t("auth.testimonial_no_credit_card_required")}

-
-
- -
-

{t("auth.testimonial_1")}

-
- Cal.com Co-Founder Peer Richelsen -
-

Peer Richelsen, Co-Founder Cal.com

- Cal.com Logo -
-
-
-
-
- ); -}; diff --git a/apps/web/modules/auth/login/page.tsx b/apps/web/modules/auth/login/page.tsx index 025d50d4d2..bab555d15b 100644 --- a/apps/web/modules/auth/login/page.tsx +++ b/apps/web/modules/auth/login/page.tsx @@ -13,7 +13,6 @@ import { SIGNUP_ENABLED, } from "@/lib/constants"; import { FormWrapper } from "@/modules/auth/components/form-wrapper"; -import { Testimonial } from "@/modules/auth/components/testimonial"; import { getIsMultiOrgEnabled, getIsSamlSsoEnabled, @@ -35,29 +34,24 @@ export const LoginPage = async () => { const samlSsoEnabled = isSamlSsoEnabled && SAML_OAUTH_ENABLED; return ( -
-
- -
-
- - - -
+
+ + +
); }; diff --git a/apps/web/modules/auth/signup/page.test.tsx b/apps/web/modules/auth/signup/page.test.tsx index 4aeddf4fe5..6efea7dc22 100644 --- a/apps/web/modules/auth/signup/page.test.tsx +++ b/apps/web/modules/auth/signup/page.test.tsx @@ -13,10 +13,6 @@ import { import { SignupPage } from "./page"; // Mock the necessary dependencies -vi.mock("@/modules/auth/components/testimonial", () => ({ - Testimonial: () =>
Testimonial
, -})); - vi.mock("@/modules/auth/components/form-wrapper", () => ({ FormWrapper: ({ children }: { children: React.ReactNode }) => (
{children}
@@ -131,8 +127,7 @@ describe("SignupPage", () => { const result = await SignupPage({ searchParams: mockSearchParams }); render(result); - // Verify that all components are rendered - expect(screen.getByTestId("testimonial")).toBeInTheDocument(); + // Verify main components are rendered expect(screen.getByTestId("form-wrapper")).toBeInTheDocument(); expect(screen.getByTestId("signup-form")).toBeInTheDocument(); }); diff --git a/apps/web/modules/auth/signup/page.tsx b/apps/web/modules/auth/signup/page.tsx index 5acf0767f6..907b3d6491 100644 --- a/apps/web/modules/auth/signup/page.tsx +++ b/apps/web/modules/auth/signup/page.tsx @@ -20,7 +20,6 @@ import { import { verifyInviteToken } from "@/lib/jwt"; import { findMatchingLocale } from "@/lib/utils/locale"; import { FormWrapper } from "@/modules/auth/components/form-wrapper"; -import { Testimonial } from "@/modules/auth/components/testimonial"; import { getIsValidInviteToken } from "@/modules/auth/signup/lib/invite"; import { getIsMultiOrgEnabled, @@ -56,34 +55,29 @@ export const SignupPage = async ({ searchParams: searchParamsProps }) => { const emailFromSearchParams = searchParams["email"]; return ( -
-
- -
-
- - - -
+
+ + +
); };