reduce spacing in forms

This commit is contained in:
Milo Schwartz 2024-12-22 17:09:22 -05:00
parent f224bfa4ee
commit 11cbafb92a
No known key found for this signature in database
16 changed files with 94 additions and 80 deletions

View file

@ -126,7 +126,7 @@ export default function CreateRoleForm({
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
id="create-role-form" id="create-role-form"
> >
<FormField <FormField

View file

@ -173,7 +173,7 @@ export default function DeleteRoleForm({
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
id="remove-role-form" id="remove-role-form"
> >
<FormField <FormField

View file

@ -123,7 +123,7 @@ export default function AccessControlsPage() {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}

View file

@ -54,16 +54,14 @@ export default function GeneralPage() {
}); });
async function deleteOrg() { async function deleteOrg() {
await api await api.delete(`/org/${org?.org.orgId}`).catch((e) => {
.delete(`/org/${org?.org.orgId}`)
.catch((e) => {
toast({ toast({
variant: "destructive", variant: "destructive",
title: "Failed to delete org", title: "Failed to delete org",
description: formatAxiosError( description: formatAxiosError(
e, e,
"An error occurred while deleting the org." "An error occurred while deleting the org."
), )
}); });
}); });
} }
@ -109,16 +107,17 @@ export default function GeneralPage() {
</p> </p>
</div> </div>
} }
buttonText="Confirm delete organization" buttonText="Confirm Delete Organization"
onConfirm={deleteOrg} onConfirm={deleteOrg}
string={org?.org.name || ""} string={org?.org.name || ""}
title="Delete organization" title="Delete Organization"
/> />
<section className="space-y-8 max-w-lg">
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8 max-w-lg" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}
@ -140,7 +139,7 @@ export default function GeneralPage() {
</form> </form>
</Form> </Form>
<Card className="max-w-lg border-red-900 mt-5"> <Card className="border-red-900">
<CardHeader> <CardHeader>
<CardTitle className="flex items-center gap-2 text-red-600"> <CardTitle className="flex items-center gap-2 text-red-600">
<AlertTriangle className="h-5 w-5" /> <AlertTriangle className="h-5 w-5" />
@ -148,9 +147,9 @@ export default function GeneralPage() {
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<p className="text-sm mb-4"> <p className="text-sm">
Once you delete this org, there is no going back. Please Once you delete this org, there is no going back.
be certain. Please be certain.
</p> </p>
</CardContent> </CardContent>
<CardFooter className="flex justify-end gap-2"> <CardFooter className="flex justify-end gap-2">
@ -160,10 +159,11 @@ export default function GeneralPage() {
className="flex items-center gap-2" className="flex items-center gap-2"
> >
<Trash2 className="h-4 w-4" /> <Trash2 className="h-4 w-4" />
Delete Delete Organization Data
</Button> </Button>
</CardFooter> </CardFooter>
</Card> </Card>
</section>
</> </>
); );
} }

View file

@ -412,7 +412,7 @@ export default function ResourceAuthenticationPage() {
onSubmit={usersRolesForm.handleSubmit( onSubmit={usersRolesForm.handleSubmit(
onSubmitUsersRoles onSubmitUsersRoles
)} )}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={usersRolesForm.control} control={usersRolesForm.control}
@ -639,7 +639,7 @@ export default function ResourceAuthenticationPage() {
{whitelistEnabled && ( {whitelistEnabled && (
<Form {...whitelistForm}> <Form {...whitelistForm}>
<form className="space-y-8"> <form className="space-y-4">
<FormField <FormField
control={whitelistForm.control} control={whitelistForm.control}
name="emails" name="emails"

View file

@ -400,7 +400,7 @@ export default function ReverseProxyTargets(props: {
onSubmit={addTargetForm.handleSubmit( onSubmit={addTargetForm.handleSubmit(
addTarget as any, addTarget as any,
)} )}
className="space-y-8" className="space-y-4"
> >
<div className="grid grid-cols-2 md:grid-cols-3 gap-4"> <div className="grid grid-cols-2 md:grid-cols-3 gap-4">
<FormField <FormField

View file

@ -135,7 +135,7 @@ export default function GeneralForm() {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}

View file

@ -232,7 +232,7 @@ export default function CreateShareLinkForm({
</CredenzaDescription> </CredenzaDescription>
</CredenzaHeader> </CredenzaHeader>
<CredenzaBody> <CredenzaBody>
<div className="space-y-8"> <div className="space-y-4">
{!link && ( {!link && (
<Form {...form}> <Form {...form}>
<form <form

View file

@ -77,7 +77,7 @@ export default function GeneralPage() {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}

View file

@ -203,7 +203,7 @@ PersistentKeepalive = 5`
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
id="create-site-form" id="create-site-form"
> >
<FormField <FormField

View file

@ -211,7 +211,7 @@ export default function ResetPasswordForm({
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div className="space-y-8"> <div className="space-y-4">
{state === "request" && ( {state === "request" && (
<Form {...requestForm}> <Form {...requestForm}>
<form <form

View file

@ -2,6 +2,7 @@ import { verifySession } from "@app/lib/auth/verifySession";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { cache } from "react"; import { cache } from "react";
import ResetPasswordForm from "./ResetPasswordForm"; import ResetPasswordForm from "./ResetPasswordForm";
import Link from "next/link";
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
@ -27,6 +28,19 @@ export default async function Page(props: {
tokenParam={searchParams.token} tokenParam={searchParams.token}
emailParam={searchParams.email} emailParam={searchParams.email}
/> />
<p className="text-center text-muted-foreground mt-4">
<Link
href={
!searchParams.redirect
? `/auth/signup`
: `/auth/signup?redirect=${searchParams.redirect}`
}
className="underline"
>
Go to login
</Link>
</p>
</> </>
); );
} }

View file

@ -114,7 +114,7 @@ export default function SignupForm({ redirect }: SignupFormProps) {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}

View file

@ -138,7 +138,7 @@ export default function VerifyEmailForm({
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}

View file

@ -188,7 +188,7 @@ export default function StepperForm() {
<Form {...orgForm}> <Form {...orgForm}>
<form <form
onSubmit={orgForm.handleSubmit(orgSubmit)} onSubmit={orgForm.handleSubmit(orgSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={orgForm.control} control={orgForm.control}

View file

@ -134,7 +134,7 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
<Form {...form}> <Form {...form}>
<form <form
onSubmit={form.handleSubmit(onSubmit)} onSubmit={form.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={form.control} control={form.control}
@ -203,7 +203,7 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
<Form {...mfaForm}> <Form {...mfaForm}>
<form <form
onSubmit={mfaForm.handleSubmit(onSubmit)} onSubmit={mfaForm.handleSubmit(onSubmit)}
className="space-y-8" className="space-y-4"
> >
<FormField <FormField
control={mfaForm.control} control={mfaForm.control}