|
1 | | -import { Box, HStack, IconButton, Img, Text } from '@chakra-ui/react'; |
| 1 | +import { Box, HStack, Img } from '@chakra-ui/react'; |
2 | 2 | import { LinkButton, useCursor } from '@components'; |
3 | 3 | import AmitRaikwarLogo from '@assets/images/AmitRaikwarLogo.png'; |
4 | | -import { RefreshIcon, SearchIcon } from '@assets'; |
| 4 | +import { SearchIcon } from '@assets'; |
5 | 5 | import { useRef } from 'react'; |
6 | 6 | import { useTranslation } from 'react-i18next'; |
7 | 7 | import { useLocation, useNavigate } from 'react-router-dom'; |
8 | 8 | import { useMoveToTop } from '@hooks'; |
9 | 9 | import { BASE_URL_ROUTE } from '@router'; |
10 | | -import { usePingTest } from '@services'; |
11 | | -import { isUndefined } from 'lodash'; |
| 10 | +import PingTest from './PingTest'; |
12 | 11 |
|
13 | 12 | const NavigationLink = [ |
14 | 13 | { |
@@ -36,7 +35,6 @@ const ArticleLink = { |
36 | 35 |
|
37 | 36 | const NavigationBar = () => { |
38 | 37 | const moveToTop = useMoveToTop(); |
39 | | - const { data, refetch, isPending } = usePingTest(); |
40 | 38 | const location = useLocation(); |
41 | 39 | const pathName = location.pathname; |
42 | 40 | const navigate = useNavigate(); |
@@ -136,46 +134,7 @@ const NavigationBar = () => { |
136 | 134 | <HStack |
137 | 135 | onClick={() => {}} // eslint-disable-line |
138 | 136 | > |
139 | | - <HStack |
140 | | - display={ |
141 | | - pathName !== BASE_URL_ROUTE + '/privateRoute' ? 'none' : 'flex' |
142 | | - } |
143 | | - border={'1px solid gray'} |
144 | | - p={2} |
145 | | - > |
146 | | - <IconButton |
147 | | - size={'sm'} |
148 | | - aria-label={''} |
149 | | - icon={<RefreshIcon />} |
150 | | - isDisabled={isPending} |
151 | | - isLoading={isPending} |
152 | | - onClick={() => refetch()} |
153 | | - /> |
154 | | - <Text color={'white'} fontSize={'lg'}> |
155 | | - Server :{' '} |
156 | | - {isUndefined(data) || isPending ? ( |
157 | | - <> |
158 | | - <Box |
159 | | - as="span" |
160 | | - w={3} |
161 | | - h={3} |
162 | | - borderRadius="50%" |
163 | | - bg={'red.500'} |
164 | | - display="inline-block" |
165 | | - /> |
166 | | - </> |
167 | | - ) : ( |
168 | | - <Box |
169 | | - as="span" |
170 | | - w={3} |
171 | | - h={3} |
172 | | - borderRadius="50%" |
173 | | - bg={'green.500'} |
174 | | - display="inline-block" |
175 | | - /> |
176 | | - )} |
177 | | - </Text> |
178 | | - </HStack> |
| 137 | + {pathName === BASE_URL_ROUTE + '/privateRoute' && <PingTest />} |
179 | 138 | <Box |
180 | 139 | onMouseEnter={onMouseEnter} |
181 | 140 | onMouseLeave={onMouseLeave} |
|
0 commit comments