@@ -16,6 +16,8 @@ import { createContext, useContext } from "react";
16
16
import styled from "styled-components" ;
17
17
import { NameGenerator } from "comps/utils" ;
18
18
import { JSONValue } from "util/jsonTypes" ;
19
+ import React from "react" ;
20
+ import { isEqual } from "lodash" ;
19
21
20
22
const ModalStyled = styled . div < { $background ?: string } > `
21
23
.ant-modal-content {
@@ -42,23 +44,23 @@ export const SlotConfigContext = createContext<{
42
44
modalWidth : 520 ,
43
45
} ) ;
44
46
45
- const ContainerView = ( props : ContainerBaseProps ) => {
47
+ const ContainerView = React . memo ( ( props : ContainerBaseProps ) => {
46
48
return < InnerGrid { ...props } emptyRows = { 15 } autoHeight /> ;
47
- } ;
49
+ } ) ;
48
50
49
- function ModalConfigView ( props : {
51
+ const ModalConfigView = React . memo ( ( props : {
50
52
visible : boolean ;
51
53
containerProps : ConstructorToView < typeof SimpleContainerComp > ;
52
54
onCancel : ( ) => void ;
53
- } ) {
55
+ } ) => {
54
56
const { visible, containerProps, onCancel } = props ;
55
57
const background = useContext ( BackgroundColorContext ) ;
56
58
const { modalWidth = 520 } = useContext ( SlotConfigContext ) ;
57
59
if ( ! visible ) {
58
60
return null ;
59
61
}
60
62
return (
61
- ( < ModalWrapper >
63
+ < ModalWrapper >
62
64
< Modal
63
65
width = { modalWidth }
64
66
open = { visible }
@@ -67,6 +69,7 @@ function ModalConfigView(props: {
67
69
footer = { null }
68
70
styles = { { body : { padding : "0" } } }
69
71
zIndex = { Layers . modal }
72
+ maskClosable = { false }
70
73
modalRender = { ( node ) => (
71
74
< ModalStyled $background = { background } onClick = { ( ) => { } } >
72
75
{ node }
@@ -81,9 +84,9 @@ function ModalConfigView(props: {
81
84
items = { gridItemCompToGridItems ( containerProps . items ) }
82
85
/>
83
86
</ Modal >
84
- </ ModalWrapper > )
87
+ </ ModalWrapper >
85
88
) ;
86
- }
89
+ } , ( prevProps , nextProps ) => isEqual ( prevProps , nextProps ) ) ;
87
90
88
91
const childrenMap = {
89
92
container : SimpleContainerComp ,
0 commit comments