Skip to content

Commit

Permalink
added create and connect button on neon oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
fomalhautb committed Jan 7, 2025
1 parent 67f7b6d commit 8f7e3c5
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export default function PageClient () {
}
};

const redirectToNeonConfirmWith = searchParams.get("redirect_to_neon_confirm_with");

const onSubmit = async (values: ProjectFormValues, e?: React.BaseSyntheticEvent) => {
e?.preventDefault();
setLoading(true);
Expand All @@ -65,7 +67,7 @@ export default function PageClient () {
} as const)).filter(({ enabled }) => enabled),
}
});
const redirectToNeonConfirmWith = searchParams.get("redirect_to_neon_confirm_with");

if (redirectToNeonConfirmWith) {
const confirmSearchParams = new URLSearchParams(redirectToNeonConfirmWith);
confirmSearchParams.set("default_selected_project_id", newProject.id);
Expand Down Expand Up @@ -108,7 +110,9 @@ export default function PageClient () {
/>

<div className="flex justify-center">
<Button loading={loading} type="submit">Create project</Button>
<Button loading={loading} type="submit">
{redirectToNeonConfirmWith ? "Create & Connect Project" : "Create Project"}
</Button>
</div>
</form>
</Form>
Expand Down

0 comments on commit 8f7e3c5

Please sign in to comment.