reduce spacing in forms
This commit is contained in:
parent
f224bfa4ee
commit
11cbafb92a
16 changed files with 94 additions and 80 deletions
|
@ -126,7 +126,7 @@ export default function CreateRoleForm({
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
id="create-role-form"
|
||||
>
|
||||
<FormField
|
||||
|
|
|
@ -173,7 +173,7 @@ export default function DeleteRoleForm({
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
id="remove-role-form"
|
||||
>
|
||||
<FormField
|
||||
|
|
|
@ -123,7 +123,7 @@ export default function AccessControlsPage() {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
|
@ -54,18 +54,16 @@ export default function GeneralPage() {
|
|||
});
|
||||
|
||||
async function deleteOrg() {
|
||||
await api
|
||||
.delete(`/org/${org?.org.orgId}`)
|
||||
.catch((e) => {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to delete org",
|
||||
description: formatAxiosError(
|
||||
e,
|
||||
"An error occurred while deleting the org."
|
||||
),
|
||||
});
|
||||
await api.delete(`/org/${org?.org.orgId}`).catch((e) => {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: "Failed to delete org",
|
||||
description: formatAxiosError(
|
||||
e,
|
||||
"An error occurred while deleting the org."
|
||||
)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function onSubmit(data: GeneralFormValues) {
|
||||
|
@ -109,61 +107,63 @@ export default function GeneralPage() {
|
|||
</p>
|
||||
</div>
|
||||
}
|
||||
buttonText="Confirm delete organization"
|
||||
buttonText="Confirm Delete Organization"
|
||||
onConfirm={deleteOrg}
|
||||
string={org?.org.name || ""}
|
||||
title="Delete organization"
|
||||
title="Delete Organization"
|
||||
/>
|
||||
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8 max-w-lg"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Name</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
This is the display name of the org
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<Button type="submit">Save Changes</Button>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
<Card className="max-w-lg border-red-900 mt-5">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2 text-red-600">
|
||||
<AlertTriangle className="h-5 w-5" />
|
||||
Danger Zone
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm mb-4">
|
||||
Once you delete this org, there is no going back. Please
|
||||
be certain.
|
||||
</p>
|
||||
</CardContent>
|
||||
<CardFooter className="flex justify-end gap-2">
|
||||
<Button
|
||||
variant="destructive"
|
||||
onClick={() => setIsDeleteModalOpen(true)}
|
||||
className="flex items-center gap-2"
|
||||
<section className="space-y-8 max-w-lg">
|
||||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-4"
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
Delete
|
||||
</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="name"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Name</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
This is the display name of the org
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<Button type="submit">Save Changes</Button>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
<Card className="border-red-900">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2 text-red-600">
|
||||
<AlertTriangle className="h-5 w-5" />
|
||||
Danger Zone
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm">
|
||||
Once you delete this org, there is no going back.
|
||||
Please be certain.
|
||||
</p>
|
||||
</CardContent>
|
||||
<CardFooter className="flex justify-end gap-2">
|
||||
<Button
|
||||
variant="destructive"
|
||||
onClick={() => setIsDeleteModalOpen(true)}
|
||||
className="flex items-center gap-2"
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
Delete Organization Data
|
||||
</Button>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</section>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -412,7 +412,7 @@ export default function ResourceAuthenticationPage() {
|
|||
onSubmit={usersRolesForm.handleSubmit(
|
||||
onSubmitUsersRoles
|
||||
)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={usersRolesForm.control}
|
||||
|
@ -639,7 +639,7 @@ export default function ResourceAuthenticationPage() {
|
|||
|
||||
{whitelistEnabled && (
|
||||
<Form {...whitelistForm}>
|
||||
<form className="space-y-8">
|
||||
<form className="space-y-4">
|
||||
<FormField
|
||||
control={whitelistForm.control}
|
||||
name="emails"
|
||||
|
|
|
@ -132,8 +132,8 @@ export default function ReverseProxyTargets(props: {
|
|||
async function addTarget(data: AddTargetFormValues) {
|
||||
// Check if target with same IP, port and method already exists
|
||||
const isDuplicate = targets.some(
|
||||
target => target.ip === data.ip &&
|
||||
target.port === data.port &&
|
||||
target => target.ip === data.ip &&
|
||||
target.port === data.port &&
|
||||
target.method === data.method
|
||||
);
|
||||
|
||||
|
@ -157,7 +157,7 @@ export default function ReverseProxyTargets(props: {
|
|||
setTargets([...targets, newTarget]);
|
||||
addTargetForm.reset();
|
||||
}
|
||||
|
||||
|
||||
const removeTarget = (targetId: number) => {
|
||||
setTargets([
|
||||
...targets.filter((target) => target.targetId !== targetId),
|
||||
|
@ -400,7 +400,7 @@ export default function ReverseProxyTargets(props: {
|
|||
onSubmit={addTargetForm.handleSubmit(
|
||||
addTarget as any,
|
||||
)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<div className="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
<FormField
|
||||
|
|
|
@ -135,7 +135,7 @@ export default function GeneralForm() {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
|
@ -232,7 +232,7 @@ export default function CreateShareLinkForm({
|
|||
</CredenzaDescription>
|
||||
</CredenzaHeader>
|
||||
<CredenzaBody>
|
||||
<div className="space-y-8">
|
||||
<div className="space-y-4">
|
||||
{!link && (
|
||||
<Form {...form}>
|
||||
<form
|
||||
|
|
|
@ -77,7 +77,7 @@ export default function GeneralPage() {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
|
@ -203,7 +203,7 @@ PersistentKeepalive = 5`
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
id="create-site-form"
|
||||
>
|
||||
<FormField
|
||||
|
|
|
@ -211,7 +211,7 @@ export default function ResetPasswordForm({
|
|||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-8">
|
||||
<div className="space-y-4">
|
||||
{state === "request" && (
|
||||
<Form {...requestForm}>
|
||||
<form
|
||||
|
|
|
@ -2,6 +2,7 @@ import { verifySession } from "@app/lib/auth/verifySession";
|
|||
import { redirect } from "next/navigation";
|
||||
import { cache } from "react";
|
||||
import ResetPasswordForm from "./ResetPasswordForm";
|
||||
import Link from "next/link";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
|
@ -27,6 +28,19 @@ export default async function Page(props: {
|
|||
tokenParam={searchParams.token}
|
||||
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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ export default function SignupForm({ redirect }: SignupFormProps) {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
|
@ -138,7 +138,7 @@ export default function VerifyEmailForm({
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
|
@ -188,7 +188,7 @@ export default function StepperForm() {
|
|||
<Form {...orgForm}>
|
||||
<form
|
||||
onSubmit={orgForm.handleSubmit(orgSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={orgForm.control}
|
||||
|
|
|
@ -134,7 +134,7 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
@ -203,7 +203,7 @@ export default function LoginForm({ redirect, onLogin }: LoginFormProps) {
|
|||
<Form {...mfaForm}>
|
||||
<form
|
||||
onSubmit={mfaForm.handleSubmit(onSubmit)}
|
||||
className="space-y-8"
|
||||
className="space-y-4"
|
||||
>
|
||||
<FormField
|
||||
control={mfaForm.control}
|
||||
|
|
Loading…
Add table
Reference in a new issue