File tree Expand file tree Collapse file tree 7 files changed +35
-6
lines changed
Expand file tree Collapse file tree 7 files changed +35
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { headers } from "next/headers";
22import { redirect } from "next/navigation" ;
33import { SignOut } from "@/components/sign-out-button" ;
44import { auth } from "@/lib/auth/auth" ;
5- import { getServersSummary } from "./actions" ;
5+ import { getServersSummary } from "../../catalog /actions" ;
66
77export default async function CatalogPage ( ) {
88 const session = await auth . api . getSession ( {
Original file line number Diff line number Diff line change 1+ import { Navbar } from "@/components/navbar" ;
2+
3+ export default async function AuthedLayout ( {
4+ children,
5+ } : Readonly < {
6+ children : React . ReactNode ;
7+ } > ) {
8+ return (
9+ < >
10+ < Navbar />
11+ { children }
12+ </ >
13+ ) ;
14+ }
File renamed without changes.
Original file line number Diff line number Diff line change 11import { render , screen } from "@testing-library/react" ;
22import { expect , test } from "vitest" ;
3- import Home from ".. /page" ;
3+ import Home from "@/app/(authed) /page" ;
44
55test ( "Home page renders welcome heading and link to catalog when user is logged in" , async ( ) => {
66 render ( await Home ( ) ) ;
Original file line number Diff line number Diff line change 11import type { Metadata } from "next" ;
22import { Inter } from "next/font/google" ;
33import { Toaster } from "sonner" ;
4- import { Navbar } from "@/components/navbar" ;
54import "./globals.css" ;
65
76const inter = Inter ( {
@@ -14,15 +13,14 @@ export const metadata: Metadata = {
1413 description : "Generated by create next app" ,
1514} ;
1615
17- export default function RootLayout ( {
16+ export default async function RootLayout ( {
1817 children,
1918} : Readonly < {
2019 children : React . ReactNode ;
2120} > ) {
2221 return (
2322 < html lang = "en" >
2423 < body className = { `${ inter . variable } antialiased` } >
25- < Navbar />
2624 { children }
2725 < Toaster
2826 richColors
Original file line number Diff line number Diff line change 1+ import Image from "next/image" ;
2+
3+ export function NavbarLogo ( ) {
4+ return (
5+ < div className = "flex items-center gap-2" >
6+ < Image
7+ src = "/toolhive-icon.svg"
8+ alt = "Toolhive"
9+ width = { 17 }
10+ height = { 19 }
11+ className = "shrink-0"
12+ />
13+ < span className = "text-2xl font-bold tracking-tight" > Toolhive</ span >
14+ </ div >
15+ ) ;
16+ }
Original file line number Diff line number Diff line change 11import { headers } from "next/headers" ;
2+ import { NavbarLogo } from "@/components/navbar-logo" ;
23import { UserMenu } from "@/components/user-menu" ;
34import { auth } from "@/lib/auth/auth" ;
45
@@ -10,7 +11,7 @@ export async function Navbar() {
1011 return (
1112 < header className = "w-full border-b bg-muted/50" >
1213 < div className = "container mx-auto flex items-center justify-between px-4 py-4" >
13- < div />
14+ < NavbarLogo />
1415 { session ?. user ?. name && < UserMenu userName = { session . user . name } /> }
1516 </ div >
1617 </ header >
You can’t perform that action at this time.
0 commit comments