From 6e0db9658f9052b094b371d73f4937e1b62fb946 Mon Sep 17 00:00:00 2001 From: veselovnk Date: Fri, 14 Jun 2024 12:28:07 +0300 Subject: [PATCH] MSP-3444 memoized modules components --- src/components/CompareVersionModal/index.tsx | 4 ++-- src/components/ConfigSchemaModal/index.tsx | 4 ++-- src/components/ConfigurationPreviewModal/index.tsx | 4 ++-- src/pages/ConfigurationsPage/index.tsx | 6 +++--- src/pages/ConnectionsPage/index.tsx | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/CompareVersionModal/index.tsx b/src/components/CompareVersionModal/index.tsx index bc0320d..99ca7c3 100644 --- a/src/components/CompareVersionModal/index.tsx +++ b/src/components/CompareVersionModal/index.tsx @@ -1,7 +1,7 @@ import { EditorState, EditorView } from '@uiw/react-codemirror' import { Button, Spin, Table } from 'antd' import { ColumnsType } from 'antd/es/table' -import { FC, useState } from 'react' +import { FC, memo, useState } from 'react' import CodeMirrorMerge from 'react-codemirror-merge' import Modal from '@widgets/Modal' @@ -114,4 +114,4 @@ const CompareVersionModal: FC = ({ ) } -export default CompareVersionModal +export default memo(CompareVersionModal) diff --git a/src/components/ConfigSchemaModal/index.tsx b/src/components/ConfigSchemaModal/index.tsx index 0735a25..038a8f4 100644 --- a/src/components/ConfigSchemaModal/index.tsx +++ b/src/components/ConfigSchemaModal/index.tsx @@ -1,4 +1,4 @@ -import { FC } from 'react' +import { FC, memo } from 'react' import JsonSchemaViewer from '@widgets/JSONViewer' import Modal from '@widgets/Modal' @@ -22,4 +22,4 @@ const ConfigSchemaModal: FC = ({ ) } -export default ConfigSchemaModal +export default memo(ConfigSchemaModal) diff --git a/src/components/ConfigurationPreviewModal/index.tsx b/src/components/ConfigurationPreviewModal/index.tsx index 88a6c23..5a6756c 100644 --- a/src/components/ConfigurationPreviewModal/index.tsx +++ b/src/components/ConfigurationPreviewModal/index.tsx @@ -1,5 +1,5 @@ import { ReactJsonView } from 'isp-ui-kit' -import { FC } from 'react' +import { FC, memo } from 'react' import Modal from '@widgets/Modal' @@ -33,4 +33,4 @@ const ConfigurationPreviewModal: FC = ({ ) } -export default ConfigurationPreviewModal +export default memo(ConfigurationPreviewModal) diff --git a/src/pages/ConfigurationsPage/index.tsx b/src/pages/ConfigurationsPage/index.tsx index 5d0cb39..66b170f 100644 --- a/src/pages/ConfigurationsPage/index.tsx +++ b/src/pages/ConfigurationsPage/index.tsx @@ -1,5 +1,5 @@ import { Button, Spin } from 'antd' -import { useEffect, useMemo, useState } from 'react' +import { memo, useEffect, useMemo, useState } from 'react' import { Outlet, useNavigate, useParams } from 'react-router-dom' import ActiveConfigurationsTable from '@components/ActiveConfigurationsTable' @@ -26,7 +26,7 @@ const Configurations = () => { data: modulesList = [], isLoading: isModulesLoading, isError: isModulesError - } = modulesServiceApi.useGetModulesQuery('modules') + } = modulesServiceApi.useGetModulesQuery('configurations') const { id: selectedItemId = '', configId = '' } = useParams() const { data = { originalResponse: [], activeConfigs: [], inactiveConfigs: [] }, @@ -129,4 +129,4 @@ const Configurations = () => { ) } -export default Configurations +export default memo(Configurations) diff --git a/src/pages/ConnectionsPage/index.tsx b/src/pages/ConnectionsPage/index.tsx index 81f9a8e..639de4d 100644 --- a/src/pages/ConnectionsPage/index.tsx +++ b/src/pages/ConnectionsPage/index.tsx @@ -1,6 +1,6 @@ import { Spin, Table, Tag, Tooltip } from 'antd' import { ColumnsType } from 'antd/es/table' -import { useEffect, useState } from 'react' +import { memo, useEffect, useState } from 'react' import { useNavigate, useParams } from 'react-router-dom' import { AddressType, EndpointType, ModuleStatusType, ModuleType } from '@pages/ModulesPage/module.type.ts' @@ -148,4 +148,4 @@ const Connections = () => { ) } -export default Connections +export default memo(Connections)