add shared navbar on /account, /chat, /bee
Three-link nav (Chat / Account / Bee) with active-route highlighting, plus a t4t Gateway home link on the left. Replaces the bespoke header on the chat page; account and bee gain the same top-of-page nav. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
86e0ab356a
commit
83760c4a9b
4 files changed
+60
-14
No files matched your search
@@ -0,0 +1,37 @@
|
|||||||
|
import { NavLink } from 'react-router';
|
||||||
|
|
||||||
|
const ITEMS = [
|
||||||
|
{ to: '/chat', label: 'Chat' },
|
||||||
|
{ to: '/account', label: 'Account' },
|
||||||
|
{ to: '/bee', label: 'Bee' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export function Nav() {
|
||||||
|
return (
|
||||||
|
<nav className='border-b border-neutral-200 bg-white'>
|
||||||
|
<div className='mx-auto flex max-w-3xl items-center justify-between px-6 py-3'>
|
||||||
|
<a href='/' className='text-sm font-semibold tracking-tight'>
|
||||||
|
t4t Gateway
|
||||||
|
</a>
|
||||||
|
<ul className='flex gap-1'>
|
||||||
|
{ITEMS.map((item) => (
|
||||||
|
<li key={item.to}>
|
||||||
|
<NavLink
|
||||||
|
to={item.to}
|
||||||
|
className={({ isActive }) =>
|
||||||
|
`inline-flex h-8 items-center rounded-md px-3 text-sm font-medium transition-colors ${
|
||||||
|
isActive
|
||||||
|
? 'bg-neutral-900 text-white'
|
||||||
|
: 'text-neutral-700 hover:bg-neutral-100'
|
||||||
|
}`
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{item.label}
|
||||||
|
</NavLink>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { Nav } from '~/components/nav';
|
||||||
|
|
||||||
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
||||||
const WEI_PER_XBZZ = 10n ** 18n;
|
const WEI_PER_XBZZ = 10n ** 18n;
|
||||||
@@ -168,14 +169,19 @@ export default function Account() {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<main className='flex min-h-screen items-center justify-center'>
|
<>
|
||||||
|
<Nav />
|
||||||
|
<main className='flex min-h-[60vh] items-center justify-center'>
|
||||||
<p className='text-sm text-neutral-600'>Loading…</p>
|
<p className='text-sm text-neutral-600'>Loading…</p>
|
||||||
</main>
|
</main>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className='mx-auto min-h-screen max-w-3xl px-6 py-12'>
|
<>
|
||||||
|
<Nav />
|
||||||
|
<main className='mx-auto max-w-3xl px-6 py-10'>
|
||||||
<div className='flex items-center justify-between'>
|
<div className='flex items-center justify-between'>
|
||||||
<div>
|
<div>
|
||||||
<h1 className='text-2xl font-semibold'>Account</h1>
|
<h1 className='text-2xl font-semibold'>Account</h1>
|
||||||
@@ -394,5 +400,6 @@ export default function Account() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</main>
|
</main>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+9
-2
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { Nav } from '~/components/nav';
|
||||||
|
|
||||||
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
||||||
|
|
||||||
@@ -100,14 +101,19 @@ export default function BeePage() {
|
|||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<main className='flex min-h-screen items-center justify-center'>
|
<>
|
||||||
|
<Nav />
|
||||||
|
<main className='flex min-h-[60vh] items-center justify-center'>
|
||||||
<p className='text-sm text-neutral-600'>Loading Bee stats…</p>
|
<p className='text-sm text-neutral-600'>Loading Bee stats…</p>
|
||||||
</main>
|
</main>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className='mx-auto min-h-screen max-w-3xl px-6 py-12'>
|
<>
|
||||||
|
<Nav />
|
||||||
|
<main className='mx-auto max-w-3xl px-6 py-10'>
|
||||||
<h1 className='text-2xl font-semibold'>Bee node</h1>
|
<h1 className='text-2xl font-semibold'>Bee node</h1>
|
||||||
<p className='mt-1 text-sm text-neutral-600'>Read-only status of the operator's Bee node.</p>
|
<p className='mt-1 text-sm text-neutral-600'>Read-only status of the operator's Bee node.</p>
|
||||||
|
|
||||||
@@ -198,5 +204,6 @@ export default function BeePage() {
|
|||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+5
-10
@@ -1,4 +1,5 @@
|
|||||||
import { useEffect, useRef, useState } from 'react';
|
import { useEffect, useRef, useState } from 'react';
|
||||||
|
import { Nav } from '~/components/nav';
|
||||||
|
|
||||||
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
const API_URL = import.meta.env.VITE_API_URL ?? 'https://api.t4t-gateway.com';
|
||||||
|
|
||||||
@@ -100,15 +101,9 @@ export default function Chat() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<main className='flex min-h-screen flex-col'>
|
<main className='flex min-h-screen flex-col'>
|
||||||
<header className='border-b border-neutral-200 bg-white px-6 py-3'>
|
<Nav />
|
||||||
<div className='mx-auto flex max-w-3xl items-center justify-between'>
|
<div className='border-b border-neutral-200 bg-white px-6 py-2'>
|
||||||
<div className='flex items-center gap-3'>
|
<div className='mx-auto flex max-w-3xl items-center justify-end'>
|
||||||
<a href='/account' className='text-sm font-medium text-neutral-700 hover:underline'>
|
|
||||||
← Account
|
|
||||||
</a>
|
|
||||||
<span className='text-neutral-300'>|</span>
|
|
||||||
<h1 className='text-sm font-semibold'>Chat</h1>
|
|
||||||
</div>
|
|
||||||
<select
|
<select
|
||||||
aria-label='Model'
|
aria-label='Model'
|
||||||
value={model}
|
value={model}
|
||||||
@@ -125,7 +120,7 @@ export default function Chat() {
|
|||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
ref={scrollRef}
|
ref={scrollRef}
|
||||||
|
|||||||
Reference in new issue
Block a user