forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.tsx
More file actions
54 lines (49 loc) · 1.96 KB
/
Copy pathHeader.tsx
File metadata and controls
54 lines (49 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import Link from 'next/link';
import { BalanceDisplay } from './BalanceDisplay';
import { useAuth } from '@/hooks/useAuth';
export const Header: React.FC = () => {
const { user, isAuthenticated } = useAuth();
return (
<header className="sticky top-0 z-50 w-full border-b border-gray-200 bg-white/80 backdrop-blur-sm dark:border-gray-800 dark:bg-gray-900/80">\n <a href="#main-content" className="sr-only focus-visible:not-sr-only focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500">Skip to main content</a>
<div className="container mx-auto flex h-16 items-center justify-between px-4">
{/* Logo */}
<Link href="/" className="text-xl font-bold text-primary-600 dark:text-primary-400">
Nova Rewards
</Link>
{/* Balance Display */}
{isAuthenticated && user && (
<div className="flex items-center gap-6">
<BalanceDisplay className="text-right" />
</div>
)}
{/* Auth Buttons */}
<div className="flex items-center gap-4">
{!isAuthenticated ? (
<>
<Link href="/login" className="text-sm text-gray-600 hover:text-gray-900 dark:text-gray-400">
Sign In
</Link>
<Link
href="/register"
className="rounded-lg bg-green-600 px-4 py-2 text-sm font-medium text-white hover:bg-green-700"
>
Get Started
</Link>
</>
) : (
<button
type="button"
aria-label="Sign out"
onClick={() => {/* logout logic */}}
className="text-sm text-gray-600 hover:text-gray-900 dark:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"
>
Sign Out
</button>
)}
</div>
</div>
</header>
);
};
export default Header;