mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
added default project name when creating neon project
Some checks failed
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
Some checks failed
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
Docker Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Test / docker (push) Has been cancelled
Runs E2E API Tests / build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (20.x) (push) Has been cancelled
Lint & build / lint_and_build (22.x) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
This commit is contained in:
parent
8f7e3c54d5
commit
8cb4f01782
@ -18,23 +18,25 @@ export const projectFormSchema = yup.object({
|
||||
.defined("At least one sign-in method is required"),
|
||||
});
|
||||
|
||||
export type ProjectFormValues = yup.InferType<typeof projectFormSchema>
|
||||
|
||||
export const defaultValues: Partial<ProjectFormValues> = {
|
||||
displayName: "",
|
||||
signInMethods: ["credential", "google", "github"],
|
||||
};
|
||||
type ProjectFormValues = yup.InferType<typeof projectFormSchema>
|
||||
|
||||
export default function PageClient () {
|
||||
const user = useUser({ or: 'redirect', projectIdMustMatch: "internal" });
|
||||
const [loading, setLoading] = useState(false);
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const displayName = searchParams.get("display_name");
|
||||
|
||||
const defaultValues: Partial<ProjectFormValues> = {
|
||||
displayName: displayName || "",
|
||||
signInMethods: ["credential", "google", "github"],
|
||||
};
|
||||
|
||||
const form = useForm<ProjectFormValues>({
|
||||
resolver: yupResolver<ProjectFormValues>(projectFormSchema),
|
||||
defaultValues,
|
||||
mode: "onChange",
|
||||
});
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
const mockProject = {
|
||||
id: "id",
|
||||
|
||||
@ -75,6 +75,10 @@ export default function NeonConfirmCard(props: { onContinue: (options: { project
|
||||
if (p === "create-new") {
|
||||
const createSearchParams = new URLSearchParams();
|
||||
createSearchParams.set("redirect_to_neon_confirm_with", searchParams.toString());
|
||||
const neonDisplayName = searchParams.get("neon_project_display_name");
|
||||
if (neonDisplayName) {
|
||||
createSearchParams.set("display_name", neonDisplayName);
|
||||
}
|
||||
window.location.href = '/new-project?' + createSearchParams.toString();
|
||||
} else {
|
||||
setSelectedProject(projects.find((project) => project.id === p) ?? null);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user