Next.js 15 fast follows (#455)
This commit is contained in:
parent
1e8ab6e8e8
commit
7faa5f1c9f
2 changed files with 18 additions and 15 deletions
|
|
@ -1,17 +1,19 @@
|
||||||
import { Input } from "../ui/input";
|
import Form from 'next/form';
|
||||||
import { Label } from "../ui/label";
|
|
||||||
|
import { Input } from '../ui/input';
|
||||||
|
import { Label } from '../ui/label';
|
||||||
|
|
||||||
export function AuthForm({
|
export function AuthForm({
|
||||||
action,
|
action,
|
||||||
children,
|
children,
|
||||||
defaultEmail = "",
|
defaultEmail = '',
|
||||||
}: {
|
}: {
|
||||||
action: any;
|
action: any;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
defaultEmail?: string;
|
defaultEmail?: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<form action={action} className="flex flex-col gap-4 px-4 sm:px-16">
|
<Form action={action} className="flex flex-col gap-4 px-4 sm:px-16">
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<Label
|
<Label
|
||||||
htmlFor="email"
|
htmlFor="email"
|
||||||
|
|
@ -48,6 +50,6 @@ export function AuthForm({
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
</form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,17 @@
|
||||||
import Link from "next/link";
|
import Form from 'next/form';
|
||||||
|
import Link from 'next/link';
|
||||||
|
|
||||||
import { auth, signOut } from "@/app/(auth)/auth";
|
import { auth, signOut } from '@/app/(auth)/auth';
|
||||||
|
|
||||||
import { History } from "./history";
|
import { History } from './history';
|
||||||
import { ThemeToggle } from "./theme-toggle";
|
import { ThemeToggle } from './theme-toggle';
|
||||||
import { Button } from "../ui/button";
|
import { Button } from '../ui/button';
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
DropdownMenuItem,
|
DropdownMenuItem,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from "../ui/dropdown-menu";
|
} from '../ui/dropdown-menu';
|
||||||
|
|
||||||
export const Navbar = async () => {
|
export const Navbar = async () => {
|
||||||
let session = await auth();
|
let session = await auth();
|
||||||
|
|
@ -40,13 +41,13 @@ export const Navbar = async () => {
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
<DropdownMenuItem className="p-1 z-50">
|
<DropdownMenuItem className="p-1 z-50">
|
||||||
<form
|
<Form
|
||||||
className="w-full"
|
className="w-full"
|
||||||
action={async () => {
|
action={async () => {
|
||||||
"use server";
|
'use server';
|
||||||
|
|
||||||
await signOut({
|
await signOut({
|
||||||
redirectTo: "/",
|
redirectTo: '/',
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -56,7 +57,7 @@ export const Navbar = async () => {
|
||||||
>
|
>
|
||||||
Sign out
|
Sign out
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</Form>
|
||||||
</DropdownMenuItem>
|
</DropdownMenuItem>
|
||||||
</DropdownMenuContent>
|
</DropdownMenuContent>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue