@@ -16,6 +16,8 @@ import { createContext, useContext } from "react";
1616import styled from "styled-components" ;
1717import { NameGenerator } from "comps/utils" ;
1818import { JSONValue } from "util/jsonTypes" ;
19+ import React from "react" ;
20+ import { isEqual } from "lodash" ;
1921
2022const ModalStyled = styled . div < { $background ?: string } > `
2123 .ant-modal-content {
@@ -42,23 +44,23 @@ export const SlotConfigContext = createContext<{
4244 modalWidth : 520 ,
4345} ) ;
4446
45- const ContainerView = ( props : ContainerBaseProps ) => {
47+ const ContainerView = React . memo ( ( props : ContainerBaseProps ) => {
4648 return < InnerGrid { ...props } emptyRows = { 15 } autoHeight /> ;
47- } ;
49+ } ) ;
4850
49- function ModalConfigView ( props : {
51+ const ModalConfigView = React . memo ( ( props : {
5052 visible : boolean ;
5153 containerProps : ConstructorToView < typeof SimpleContainerComp > ;
5254 onCancel : ( ) => void ;
53- } ) {
55+ } ) => {
5456 const { visible, containerProps, onCancel } = props ;
5557 const background = useContext ( BackgroundColorContext ) ;
5658 const { modalWidth = 520 } = useContext ( SlotConfigContext ) ;
5759 if ( ! visible ) {
5860 return null ;
5961 }
6062 return (
61- ( < ModalWrapper >
63+ < ModalWrapper >
6264 < Modal
6365 width = { modalWidth }
6466 open = { visible }
@@ -67,6 +69,7 @@ function ModalConfigView(props: {
6769 footer = { null }
6870 styles = { { body : { padding : "0" } } }
6971 zIndex = { Layers . modal }
72+ maskClosable = { false }
7073 modalRender = { ( node ) => (
7174 < ModalStyled $background = { background } onClick = { ( ) => { } } >
7275 { node }
@@ -81,9 +84,9 @@ function ModalConfigView(props: {
8184 items = { gridItemCompToGridItems ( containerProps . items ) }
8285 />
8386 </ Modal >
84- </ ModalWrapper > )
87+ </ ModalWrapper >
8588 ) ;
86- }
89+ } , ( prevProps , nextProps ) => isEqual ( prevProps , nextProps ) ) ;
8790
8891const childrenMap = {
8992 container : SimpleContainerComp ,
0 commit comments