Spaces:
Build error
Build error
Upload components/Header.jsx with huggingface_hub
Browse files- components/Header.jsx +23 -32
components/Header.jsx
CHANGED
|
@@ -1,16 +1,15 @@
|
|
| 1 |
import React from 'react';
|
| 2 |
-
import { Bell, Search, Menu
|
| 3 |
|
| 4 |
export default function Header({ onMenuClick, onThemeToggle, isDark }) {
|
| 5 |
return (
|
| 6 |
-
<header className="bg-white dark:bg-dark-surface shadow-sm border-b border-gray-200 dark:border-dark-border z-10">
|
| 7 |
<div className="px-4 sm:px-6 lg:px-8">
|
| 8 |
<div className="flex justify-between items-center h-16">
|
| 9 |
-
{/* Left: Menu Button & Search */}
|
| 10 |
<div className="flex items-center">
|
| 11 |
<button
|
| 12 |
type="button"
|
| 13 |
-
className="lg:hidden -ml-2 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary-500"
|
| 14 |
onClick={onMenuClick}
|
| 15 |
>
|
| 16 |
<span className="sr-only">Open sidebar</span>
|
|
@@ -23,7 +22,7 @@ export default function Header({ onMenuClick, onThemeToggle, isDark }) {
|
|
| 23 |
<Search className="h-5 w-5 text-gray-400" />
|
| 24 |
</div>
|
| 25 |
<input
|
| 26 |
-
className="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-
|
| 27 |
placeholder="Search projects, tasks, or team members..."
|
| 28 |
type="search"
|
| 29 |
/>
|
|
@@ -31,55 +30,47 @@ export default function Header({ onMenuClick, onThemeToggle, isDark }) {
|
|
| 31 |
</div>
|
| 32 |
</div>
|
| 33 |
|
| 34 |
-
{/* Right: Actions & Profile */}
|
| 35 |
<div className="flex items-center space-x-4">
|
| 36 |
-
{/* Anycoder Link */}
|
| 37 |
<a
|
| 38 |
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 39 |
target="_blank"
|
| 40 |
rel="noopener noreferrer"
|
| 41 |
-
className="hidden md:inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-
|
| 42 |
>
|
| 43 |
Built with anycoder
|
| 44 |
</a>
|
| 45 |
|
| 46 |
-
{/* Theme Toggle (Visual Placeholder as actual toggle is in Sidebar or can be here) */}
|
| 47 |
<button
|
| 48 |
onClick={onThemeToggle}
|
| 49 |
-
className="p-2 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:hover:text-gray-300 transition-colors"
|
| 50 |
>
|
| 51 |
{isDark ? (
|
| 52 |
-
|
| 53 |
) : (
|
| 54 |
-
|
| 55 |
)}
|
| 56 |
-
{
|
| 57 |
-
<div className={`w-5 h-5 rounded-full ${isDark ? 'bg-yellow-400' : 'bg-gray-700'}`}></div>
|
| 58 |
</button>
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
<span className="absolute top-1.5 right-1.5 block h-2 w-2 rounded-full bg-red-500 ring-2 ring-white dark:ring-dark-surface"></span>
|
| 63 |
<span className="sr-only">View notifications</span>
|
| 64 |
<Bell className="h-6 w-6" />
|
| 65 |
</button>
|
| 66 |
|
| 67 |
-
{/* Profile Dropdown */}
|
| 68 |
<div className="relative ml-3">
|
| 69 |
-
<
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
>
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
</button>
|
| 82 |
-
</div>
|
| 83 |
</div>
|
| 84 |
</div>
|
| 85 |
</div>
|
|
|
|
| 1 |
import React from 'react';
|
| 2 |
+
import { Bell, Search, Menu } from 'lucide-react';
|
| 3 |
|
| 4 |
export default function Header({ onMenuClick, onThemeToggle, isDark }) {
|
| 5 |
return (
|
| 6 |
+
<header className="bg-white dark:bg-dark-surface shadow-sm border-b border-gray-200 dark:border-dark-border z-10 sticky top-0">
|
| 7 |
<div className="px-4 sm:px-6 lg:px-8">
|
| 8 |
<div className="flex justify-between items-center h-16">
|
|
|
|
| 9 |
<div className="flex items-center">
|
| 10 |
<button
|
| 11 |
type="button"
|
| 12 |
+
className="lg:hidden -ml-2 inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary-500 dark:hover:bg-gray-800"
|
| 13 |
onClick={onMenuClick}
|
| 14 |
>
|
| 15 |
<span className="sr-only">Open sidebar</span>
|
|
|
|
| 22 |
<Search className="h-5 w-5 text-gray-400" />
|
| 23 |
</div>
|
| 24 |
<input
|
| 25 |
+
className="block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md leading-5 bg-gray-50 placeholder-gray-500 focus:outline-none focus:bg-white focus:placeholder-gray-400 focus:ring-1 focus:ring-primary-500 focus:border-primary-500 sm:text-sm dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:placeholder-gray-400 dark:focus:bg-gray-900 transition-colors"
|
| 26 |
placeholder="Search projects, tasks, or team members..."
|
| 27 |
type="search"
|
| 28 |
/>
|
|
|
|
| 30 |
</div>
|
| 31 |
</div>
|
| 32 |
|
|
|
|
| 33 |
<div className="flex items-center space-x-4">
|
|
|
|
| 34 |
<a
|
| 35 |
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 36 |
target="_blank"
|
| 37 |
rel="noopener noreferrer"
|
| 38 |
+
className="hidden md:inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-semibold rounded-full text-primary-700 bg-primary-100 hover:bg-primary-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:bg-primary-900/50 dark:text-primary-300 dark:hover:bg-primary-900 transition-all hover:scale-105"
|
| 39 |
>
|
| 40 |
Built with anycoder
|
| 41 |
</a>
|
| 42 |
|
|
|
|
| 43 |
<button
|
| 44 |
onClick={onThemeToggle}
|
| 45 |
+
className="p-2 rounded-full text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:hover:text-gray-300 dark:hover:bg-gray-800 transition-colors"
|
| 46 |
>
|
| 47 |
{isDark ? (
|
| 48 |
+
<span className="sr-only">Enable light mode</span>
|
| 49 |
) : (
|
| 50 |
+
<span className="sr-only">Enable dark mode</span>
|
| 51 |
)}
|
| 52 |
+
<div className={`w-5 h-5 rounded-full shadow-inner ${isDark ? 'bg-yellow-400' : 'bg-indigo-900'}`}></div>
|
|
|
|
| 53 |
</button>
|
| 54 |
|
| 55 |
+
<button className="p-2 rounded-full text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none relative dark:hover:text-gray-300 dark:hover:bg-gray-800 transition-colors">
|
| 56 |
+
<span className="absolute top-1.5 right-1.5 block h-2 w-2 rounded-full bg-red-500 ring-2 ring-white dark:ring-dark-surface animate-pulse"></span>
|
|
|
|
| 57 |
<span className="sr-only">View notifications</span>
|
| 58 |
<Bell className="h-6 w-6" />
|
| 59 |
</button>
|
| 60 |
|
|
|
|
| 61 |
<div className="relative ml-3">
|
| 62 |
+
<button
|
| 63 |
+
type="button"
|
| 64 |
+
className="flex max-w-xs items-center rounded-full bg-white text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:bg-dark-surface ring-2 ring-transparent hover:ring-gray-200 dark:hover:ring-gray-600 transition-all"
|
| 65 |
+
id="user-menu-button"
|
| 66 |
+
>
|
| 67 |
+
<span className="sr-only">Open user menu</span>
|
| 68 |
+
<img
|
| 69 |
+
className="h-8 w-8 rounded-full object-cover"
|
| 70 |
+
src="https://picsum.photos/seed/user1/200/200"
|
| 71 |
+
alt=""
|
| 72 |
+
/>
|
| 73 |
+
</button>
|
|
|
|
|
|
|
| 74 |
</div>
|
| 75 |
</div>
|
| 76 |
</div>
|