Add a top bar component, fix auth

This commit is contained in:
Gabriel Brown 2024-06-03 16:53:39 -05:00
parent 217a0d3952
commit 4794541436
3 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,8 @@
export function Top_Bar() {
return (
<div className="top-bar w-full h-16 bg-black text-white">
</div>
);
};

View File

@ -1,8 +1,10 @@
import "~/styles/globals.css"; import "~/styles/globals.css";
import { GeistSans } from "geist/font/sans"; import { GeistSans } from "geist/font/sans";
import type { Metadata } from "next";
import { Top_Bar } from "~/app/_components/ui/top_bar";
import { SessionProvider } from "next-auth/react";
export const metadata = { export const metadata: Metadata = {
title: "Create T3 App", title: "Create T3 App",
description: "Generated by create-t3-app", description: "Generated by create-t3-app",
icons: [{ rel: "icon", url: "/favicon.ico" }], icons: [{ rel: "icon", url: "/favicon.ico" }],
@ -15,7 +17,12 @@ export default function RootLayout({
}) { }) {
return ( return (
<html lang="en" className={`${GeistSans.variable}`}> <html lang="en" className={`${GeistSans.variable}`}>
<body>{children}</body> <body>
<SessionProvider>
<Top_Bar />
{children}
</SessionProvider>
</body>
</html> </html>
); );
} }

View File

@ -11,7 +11,7 @@ export const env = createEnv({
NODE_ENV: z NODE_ENV: z
.enum(["development", "test", "production"]) .enum(["development", "test", "production"])
.default("development"), .default("development"),
NEXTAUTH_SECRET: AUTH_SECRET:
process.env.NODE_ENV === "production" process.env.NODE_ENV === "production"
? z.string() ? z.string()
: z.string().optional(), : z.string().optional(),
@ -35,7 +35,7 @@ export const env = createEnv({
runtimeEnv: { runtimeEnv: {
DATABASE_URL: process.env.DATABASE_URL, DATABASE_URL: process.env.DATABASE_URL,
NODE_ENV: process.env.NODE_ENV, NODE_ENV: process.env.NODE_ENV,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, AUTH_SECRET: process.env.AUTH_SECRET,
AUTH_GITHUB_ID: process.env.AUTH_GITHUB_ID, AUTH_GITHUB_ID: process.env.AUTH_GITHUB_ID,
AUTH_GITHUB_SECRET: process.env.AUTH_GITHUB_SECRET, AUTH_GITHUB_SECRET: process.env.AUTH_GITHUB_SECRET,
}, },