diff --git a/apps/nextjs/src/app/_components/auth-showcase.tsx b/apps/nextjs/src/app/_components/auth-showcase.tsx deleted file mode 100644 index 4bf5635..0000000 --- a/apps/nextjs/src/app/_components/auth-showcase.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { auth, signIn, signOut } from "@acme/auth"; -import { Button } from "@acme/ui/button"; - -export async function AuthShowcase() { - const session = await auth(); - - if (!session) { - return ( -
- -
- ); - } - - return ( -
-

- Logged in as {session.user.name} -

- -
- -
-
- ); -} diff --git a/apps/nextjs/src/app/_components/header.tsx b/apps/nextjs/src/app/_components/header.tsx new file mode 100644 index 0000000..cf6b54b --- /dev/null +++ b/apps/nextjs/src/app/_components/header.tsx @@ -0,0 +1,47 @@ +import Link from "next/link"; + +import { auth, signIn, signOut } from "@acme/auth"; +import { Button } from "@acme/ui/button"; + +export default async function Header() { + const session = await auth(); + const user = session?.user; + + return ( +
+ +
+ ); +} diff --git a/apps/nextjs/src/app/layout.tsx b/apps/nextjs/src/app/layout.tsx index c3e4d7f..c28d58f 100644 --- a/apps/nextjs/src/app/layout.tsx +++ b/apps/nextjs/src/app/layout.tsx @@ -11,14 +11,15 @@ import { TRPCReactProvider } from "~/trpc/react"; import "~/app/globals.css"; import { env } from "~/env"; +import Header from "./_components/header"; -const PRODUCTION_DOMAINE = +const PRODUCTION_DOMAIN = "https://shared-expensesnext-js-gnrsns-projects.vercel.app"; export const metadata: Metadata = { metadataBase: new URL( env.VERCEL_ENV === "production" - ? PRODUCTION_DOMAINE + ? PRODUCTION_DOMAIN : "http://localhost:3000", ), title: "Shared expenses", @@ -26,7 +27,7 @@ export const metadata: Metadata = { openGraph: { title: "Shared expenses", description: "", - url: PRODUCTION_DOMAINE, + url: PRODUCTION_DOMAIN, siteName: "Shared expenses", }, }; @@ -49,6 +50,8 @@ export default function RootLayout(props: { children: React.ReactNode }) { )} > +
+ {props.children}
diff --git a/apps/nextjs/src/app/page.tsx b/apps/nextjs/src/app/page.tsx index 08982ba..ad96aca 100644 --- a/apps/nextjs/src/app/page.tsx +++ b/apps/nextjs/src/app/page.tsx @@ -1,7 +1,6 @@ import { Suspense } from "react"; import { api } from "~/trpc/server"; -import { AuthShowcase } from "./_components/auth-showcase"; import { CreatePostForm, PostCardSkeleton, @@ -20,7 +19,6 @@ export default function HomePage() {

Shared Expenses

-