From 7ec9ee3f46abab911cbc41447f20f4b3e29831c0 Mon Sep 17 00:00:00 2001 From: Leo Conforti Date: Thu, 9 May 2024 20:22:49 +0000 Subject: [PATCH] save --- apps/trading-site/.env.example | 7 ------- apps/trading-site/app/protected/page.tsx | 2 +- apps/trading-site/app/register/page.tsx | 6 +++--- apps/trading-site/app/submit-button.tsx | 16 +++++++++------- 4 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 apps/trading-site/.env.example diff --git a/apps/trading-site/.env.example b/apps/trading-site/.env.example deleted file mode 100644 index cf97f88..0000000 --- a/apps/trading-site/.env.example +++ /dev/null @@ -1,7 +0,0 @@ -# Create a Postgres database on Vercel: https://vercel.com/postgres -POSTGRES_URL= -POSTGRES_PRISMA_URL= -POSTGRES_URL_NON_POOLING= - -# Generate one here: https://generate-secret.vercel.app/32 (only required for localhost) -AUTH_SECRET= diff --git a/apps/trading-site/app/protected/page.tsx b/apps/trading-site/app/protected/page.tsx index c0215d6..171871e 100644 --- a/apps/trading-site/app/protected/page.tsx +++ b/apps/trading-site/app/protected/page.tsx @@ -16,7 +16,7 @@ export default async function ProtectedPage() { function SignOut() { return (
{ + onSubmit={async () => { "use server"; await signOut(); }} diff --git a/apps/trading-site/app/register/page.tsx b/apps/trading-site/app/register/page.tsx index 8b183ca..a1f6e55 100644 --- a/apps/trading-site/app/register/page.tsx +++ b/apps/trading-site/app/register/page.tsx @@ -1,8 +1,8 @@ -import Link from "next/link"; -import { Form } from "app/form"; -import { redirect } from "next/navigation"; import { createUser, getUser } from "app/db"; +import { Form } from "app/form"; import { SubmitButton } from "app/submit-button"; +import Link from "next/link"; +import { redirect } from "next/navigation"; export default function Login() { async function register(formData: FormData) { diff --git a/apps/trading-site/app/submit-button.tsx b/apps/trading-site/app/submit-button.tsx index 36f88b8..bcce8c0 100644 --- a/apps/trading-site/app/submit-button.tsx +++ b/apps/trading-site/app/submit-button.tsx @@ -1,18 +1,19 @@ "use client"; -import { useFormStatus } from "react-dom"; +// import { useFormStatus } from "react-dom"; export function SubmitButton({ children }: { children: React.ReactNode }) { - const { pending } = useFormStatus(); + // const { pending } = useFormStatus(); return ( );