diff --git a/apps/web/modules/signup-view.tsx b/apps/web/modules/signup-view.tsx
index 195a6d6592..9875f1717e 100644
--- a/apps/web/modules/signup-view.tsx
+++ b/apps/web/modules/signup-view.tsx
@@ -7,12 +7,12 @@ import dynamic from "next/dynamic";
import Link from "next/link";
import { useRouter } from "next/navigation";
import Script from "next/script";
+import posthog from "posthog-js";
import { useState, useEffect } from "react";
import type { SubmitHandler } from "react-hook-form";
import { useForm, useFormContext } from "react-hook-form";
import { Toaster } from "sonner";
import { z } from "zod";
-import posthog from "posthog-js";
import getStripe from "@calcom/app-store/stripepayment/lib/client";
import { getPremiumPlanPriceValue } from "@calcom/app-store/stripepayment/lib/utils";
@@ -41,7 +41,7 @@ import type { inferSSRProps } from "@calcom/types/inferSSRProps";
import classNames from "@calcom/ui/classNames";
import { Alert } from "@calcom/ui/components/alert";
import { Button } from "@calcom/ui/components/button";
-import { PasswordField, CheckboxField, TextField, Form } from "@calcom/ui/components/form";
+import { PasswordField, CheckboxField, TextField, Form, SelectField } from "@calcom/ui/components/form";
import { Icon } from "@calcom/ui/components/icon";
import { showToast } from "@calcom/ui/components/toast";
@@ -337,7 +337,6 @@ export default function Signup({
}}
/>
)}
+ {IS_CALCOM && (
+
+ {
+ if (option && "value" in option) {
+ const currentUrl = new URL(window.location.href);
+
+ // Handle localhost - add region as URL parameter
+ if (currentUrl.hostname === "localhost") {
+ currentUrl.searchParams.set("region", option.value);
+ window.location.href = currentUrl.toString();
+ return;
+ }
+
+ // Handle production domains - modify hostname only to preserve query params
+ if (option.value === "eu") {
+ currentUrl.hostname = currentUrl.hostname.replace("cal.com", "cal.eu");
+ } else {
+ currentUrl.hostname = currentUrl.hostname.replace("cal.eu", "cal.com");
+ }
+ window.location.href = currentUrl.toString();
+ }
+ }}
+ />
+
+ )}
{/* Form Container */}
@@ -426,14 +475,14 @@ export default function Signup({
addOnLeading={
orgSlug
? truncateDomain(
- `${getOrgFullOrigin(orgSlug, { protocol: true }).replace(
- URL_PROTOCOL_REGEX,
- ""
- )}/`
- )
+ `${getOrgFullOrigin(orgSlug, { protocol: true }).replace(
+ URL_PROTOCOL_REGEX,
+ ""
+ )}/`
+ )
: truncateDomain(
- `${process.env.NEXT_PUBLIC_WEBSITE_URL.replace(URL_PROTOCOL_REGEX, "")}/`
- )
+ `${process.env.NEXT_PUBLIC_WEBSITE_URL.replace(URL_PROTOCOL_REGEX, "")}/`
+ )
}
/>
) : null}
@@ -565,7 +614,10 @@ export default function Signup({
<>
{/* eslint-disable @next/next/no-img-element */}
@@ -748,7 +800,7 @@ export default function Signup({
>
)}
-
+

{/* eslint-disable @next/next/no-img-element */}
![]()