From c4388361ff136a1902afcc1f383147e300fff599 Mon Sep 17 00:00:00 2001
From: VSHAL <136872743+snvshal@users.noreply.github.com>
Date: Tue, 30 Dec 2025 16:55:33 +0000
Subject: [PATCH] feat: prefill subdomain from requested hostname
---
app/not-found.tsx | 4 +++-
app/subdomain-form.tsx | 6 +++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/app/not-found.tsx b/app/not-found.tsx
index 3bdb1ba05..db60505a2 100644
--- a/app/not-found.tsx
+++ b/app/not-found.tsx
@@ -44,7 +44,9 @@ export default function NotFound() {
{subdomain ? `Create ${subdomain}` : `Go to ${rootDomain}`}
diff --git a/app/subdomain-form.tsx b/app/subdomain-form.tsx
index e26371ab1..f1d990314 100644
--- a/app/subdomain-form.tsx
+++ b/app/subdomain-form.tsx
@@ -22,6 +22,7 @@ import {
} from '@/components/ui/emoji-picker';
import { createSubdomainAction } from '@/app/actions';
import { rootDomain } from '@/lib/utils';
+import { useSearchParams } from 'next/navigation';
type CreateState = {
error?: string;
@@ -132,9 +133,12 @@ export function SubdomainForm() {
{}
);
+ const searchParams = useSearchParams();
+ const subdomain = state?.subdomain ?? searchParams.get('subdomain') ?? '';
+
return (