diff --git a/src/components/Navigation.tsx b/src/components/Navigation.tsx index b63775e..68c77c9 100644 --- a/src/components/Navigation.tsx +++ b/src/components/Navigation.tsx @@ -1,124 +1,124 @@ -import { createContext, useContext, useState } from 'react' -import { Link, useLocation } from 'react-router-dom' -import { motion } from 'framer-motion' -import { Button } from '@/components/ui/button' -import { - List, - X, - House, - Atom, - FlowArrow, - Layout, -} from '@phosphor-icons/react' -import { cn } from '@/lib/utils' - -const navigationItems = [ - { path: '/', label: 'Home', icon: House }, - { path: '/atoms', label: 'Atoms', icon: Atom }, - { path: '/molecules', label: 'Molecules', icon: FlowArrow }, - { path: '/organisms', label: 'Organisms', icon: (props: any) => }, - { path: '/templates', label: 'Templates', icon: Layout }, -] - -interface NavigationContextType { - menuOpen: boolean - setMenuOpen: (open: boolean) => void -} - -const NavigationContext = createContext(undefined) - -export function NavigationProvider({ children }: { children: React.ReactNode }) { - const [menuOpen, setMenuOpen] = useState(false) - - return ( - - {children} - - ) -} - -export function useNavigation() { - const context = useContext(NavigationContext) - if (!context) { - throw new Error('useNavigation must be used within NavigationProvider') - } - return context -} - -export function Navigation() { - const { menuOpen, setMenuOpen } = useNavigation() - - return ( - setMenuOpen(!menuOpen)} - > - - - ) -} - -export function NavigationSidebar() { - const { menuOpen, setMenuOpen } = useNavigation() - const location = useLocation() - - return ( - - - - Navigation - setMenuOpen(false)} - > - - - - - - - {navigationItems.map((item) => { - const Icon = item.icon - const isActive = location.pathname === item.path - - return ( - - setMenuOpen(false)} - className={cn( - "flex items-center gap-3 px-4 py-3 rounded-lg transition-all duration-200", - isActive - ? "bg-primary text-primary-foreground shadow-md" - : "hover:bg-muted text-foreground" - )} - > - - - {item.label} - - - - ) - })} - - - - - - CodeSnippet Library - - - - - ) -} +import { createContext, useContext, useState } from 'react' +import { Link, useLocation } from 'react-router-dom' +import { motion } from 'framer-motion' +import { Button } from '@/components/ui/button' + List, + House + Fl +} from ' + Atom, + FlowArrow, + Layout, +} from '@phosphor-icons/react' +import { cn } from '@/lib/utils' + +const navigationItems = [ + { path: '/', label: 'Home', icon: House }, + + menuOpen: boolean +} +const NavigationContext = createContext setMenuOpen(!menuOpen)} + + + vari + + + + + + + + + + + + + +
- CodeSnippet Library -