diff --git a/redisinsight/ui/src/components/config/Config.tsx b/redisinsight/ui/src/components/config/Config.tsx index 415c07452e..a548103c86 100644 --- a/redisinsight/ui/src/components/config/Config.tsx +++ b/redisinsight/ui/src/components/config/Config.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import { useEffect } from 'react' import { useDispatch, useSelector } from 'react-redux' import { useLocation } from 'react-router-dom' @@ -21,14 +21,12 @@ import { fetchUnsupportedCliCommandsAction } from 'uiSrc/slices/cli/cli-settings import { fetchRedisCommandsInfo } from 'uiSrc/slices/app/redis-commands' import { fetchContentAction as fetchCreateRedisButtonsAction } from 'uiSrc/slices/content/create-redis-buttons' import favicon from 'uiSrc/assets/favicon.ico' -import { ConsentsSettingsPopup } from 'uiSrc/components' const SETTINGS_PAGE_PATH = '/settings' const Config = () => { const serverInfo = useSelector(appServerInfoSelector) const { config, spec } = useSelector(userSettingsSelector) const { segmentWriteKey } = useSelector(appAnalyticsInfoSelector) - const { isShowConceptsPopup: isShowConsents } = useSelector(userSettingsSelector) const { pathname } = useLocation() @@ -73,11 +71,7 @@ const Config = () => { } } - return ( - <> - {isShowConsents && } - - ) + return null } export default Config diff --git a/redisinsight/ui/src/components/main-router/MainRouter.tsx b/redisinsight/ui/src/components/main-router/MainRouter.tsx index 6defb65879..2186b2639c 100644 --- a/redisinsight/ui/src/components/main-router/MainRouter.tsx +++ b/redisinsight/ui/src/components/main-router/MainRouter.tsx @@ -7,6 +7,8 @@ import { registerRouter } from 'uiSrc/services/routing' import RouteWithSubRoutes from 'uiSrc/utils/routerWithSubRoutes' import { appInfoSelector } from 'uiSrc/slices/app/info' import { BuildType } from 'uiSrc/constants/env' +import { ConsentsSettingsPopup } from 'uiSrc/components' +import { userSettingsSelector } from 'uiSrc/slices/user/user-settings' import RedisStackRoutes from './components/RedisStackRoutes' import COMMON_ROUTES from './constants/commonRoutes' @@ -14,26 +16,30 @@ import DEFAULT_ROUTES from './constants/defaultRoutes' const MainRouter = () => { const { server } = useSelector(appInfoSelector) + const { isShowConceptsPopup: isShowConsents } = useSelector(userSettingsSelector) return ( - - {COMMON_ROUTES.map((route, i) => ( - // eslint-disable-next-line react/no-array-index-key - - ))} - { - server?.buildType === BuildType.RedisStack - ? - : ( - <> - {DEFAULT_ROUTES.map((route, i) => ( - // eslint-disable-next-line react/no-array-index-key - - ))} - - - ) - } - + <> + {isShowConsents && ()} + + {COMMON_ROUTES.map((route, i) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + { + server?.buildType === BuildType.RedisStack + ? + : ( + <> + {DEFAULT_ROUTES.map((route, i) => ( + // eslint-disable-next-line react/no-array-index-key + + ))} + + + ) + } + + ) }