|
1 | 1 | import { Box, VStack, Text, Icon, Image, HStack, Badge, Button } from '@chakra-ui/react'; |
2 | 2 | import { Link as RouterLink, useLocation } from 'react-router-dom'; |
3 | 3 | import { Wifi, Activity, LogOut, Users } from 'lucide-react'; |
4 | | -import thingConnectIcon from |
5 | | - '@/assets/ThingConnectPulseLogo.svg'; |
| 4 | +import thingConnectIcon from '@/assets/thingconnect-pulse-logo.svg'; |
6 | 5 | import { Clock, Wrench, Settings, Info, Dashboard, Help } from '@/icons'; |
7 | 6 | import { useAuth } from '@/features/auth/context/AuthContext'; |
8 | 7 | interface NavigationProps { |
@@ -58,49 +57,49 @@ export function Navigation({ onItemClick }: NavigationProps) { |
58 | 57 | {navigationItems |
59 | 58 | .filter(item => !item.adminOnly || isAdmin) |
60 | 59 | .map(item => { |
61 | | - const isActive = !item.external && isActiveRoute(item.path); |
62 | | - const ItemContent = ( |
63 | | - <HStack |
64 | | - px={3} |
65 | | - py={2.5} |
66 | | - borderRadius='lg' |
67 | | - color={isActive ? 'blue.600' : 'gray.600'} |
68 | | - bg={isActive ? 'whiteAlpha.950' : 'transparent'} |
69 | | - border={isActive ? '1px solid' : undefined} |
70 | | - borderColor={isActive ? 'border' : undefined} |
71 | | - _hover={ |
72 | | - isActive |
73 | | - ? undefined |
74 | | - : { |
75 | | - bg: 'blackAlpha.50', |
76 | | - _dark: { bg: 'gray.700' }, |
77 | | - } |
78 | | - } |
79 | | - _dark={{ |
80 | | - color: isActive ? 'blue.200' : 'gray.200', |
81 | | - bg: isActive ? 'blackAlpha.200' : undefined, |
82 | | - border: isActive ? '1px solid rgba(255,255,255,0.1)' : undefined, |
83 | | - }} |
84 | | - > |
85 | | - <Icon as={item.icon} boxSize={4} /> |
86 | | - <Text fontSize='sm' fontWeight='medium' letterSpacing='0.025em' lineHeight='1.2'> |
87 | | - {item.label} |
88 | | - </Text> |
89 | | - </HStack> |
90 | | - ); |
| 60 | + const isActive = !item.external && isActiveRoute(item.path); |
| 61 | + const ItemContent = ( |
| 62 | + <HStack |
| 63 | + px={3} |
| 64 | + py={2.5} |
| 65 | + borderRadius='lg' |
| 66 | + color={isActive ? 'blue.600' : 'gray.600'} |
| 67 | + bg={isActive ? 'whiteAlpha.950' : 'transparent'} |
| 68 | + border={isActive ? '1px solid' : undefined} |
| 69 | + borderColor={isActive ? 'border' : undefined} |
| 70 | + _hover={ |
| 71 | + isActive |
| 72 | + ? undefined |
| 73 | + : { |
| 74 | + bg: 'blackAlpha.50', |
| 75 | + _dark: { bg: 'gray.700' }, |
| 76 | + } |
| 77 | + } |
| 78 | + _dark={{ |
| 79 | + color: isActive ? 'blue.200' : 'gray.200', |
| 80 | + bg: isActive ? 'blackAlpha.200' : undefined, |
| 81 | + border: isActive ? '1px solid rgba(255,255,255,0.1)' : undefined, |
| 82 | + }} |
| 83 | + > |
| 84 | + <Icon as={item.icon} boxSize={4} /> |
| 85 | + <Text fontSize='sm' fontWeight='medium' letterSpacing='0.025em' lineHeight='1.2'> |
| 86 | + {item.label} |
| 87 | + </Text> |
| 88 | + </HStack> |
| 89 | + ); |
91 | 90 |
|
92 | | - return item.external ? ( |
93 | | - <Box as='a' key={item.path} asChild onClick={onItemClick}> |
94 | | - <a href={item.path} target='_blank' rel='noopener noreferrer'> |
| 91 | + return item.external ? ( |
| 92 | + <Box as='a' key={item.path} asChild onClick={onItemClick}> |
| 93 | + <a href={item.path} target='_blank' rel='noopener noreferrer'> |
| 94 | + {ItemContent} |
| 95 | + </a> |
| 96 | + </Box> |
| 97 | + ) : ( |
| 98 | + <RouterLink key={item.path} to={item.path} onClick={onItemClick}> |
95 | 99 | {ItemContent} |
96 | | - </a> |
97 | | - </Box> |
98 | | - ) : ( |
99 | | - <RouterLink key={item.path} to={item.path} onClick={onItemClick}> |
100 | | - {ItemContent} |
101 | | - </RouterLink> |
102 | | - ); |
103 | | - })} |
| 100 | + </RouterLink> |
| 101 | + ); |
| 102 | + })} |
104 | 103 | </VStack> |
105 | 104 | <Box p={4} borderTop='1px' borderColor='gray.200' _dark={{ borderColor: 'gray.700' }}> |
106 | 105 | <VStack align='stretch' gap={4}> |
|
0 commit comments