@@ -56,6 +56,7 @@ const SUPPORTED_FIELDS = [
56
56
] ;
57
57
58
58
const ConditionsControl = ( { conditions, setConditions } ) => {
59
+ const isPro = window . feedzyData . isPro ;
59
60
const onChangeMatch = ( value ) => {
60
61
setConditions ( {
61
62
...conditions ,
@@ -88,6 +89,10 @@ const ConditionsControl = ({ conditions, setConditions }) => {
88
89
} ;
89
90
90
91
const onChangeCondtion = ( index , value , key ) => {
92
+ if ( ! isPro ) {
93
+ return ;
94
+ }
95
+
91
96
const conditionsCopy = [ ...conditions . conditions ] ;
92
97
93
98
conditionsCopy [ index ] [ key ] = value ;
@@ -117,7 +122,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
117
122
return (
118
123
< div
119
124
className = { classNames ( 'fz-condition-control' , {
120
- 'is-upsell' : ! window . feedzyData . isPro ,
125
+ 'is-upsell' : ! isPro ,
121
126
} ) }
122
127
>
123
128
< SelectControl
@@ -137,6 +142,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
137
142
} ,
138
143
] }
139
144
onChange = { onChangeMatch }
145
+ disabled = { ! isPro }
140
146
/>
141
147
142
148
{ conditions . conditions . map ( ( condition , index ) => {
@@ -161,6 +167,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
161
167
onChange = { ( value ) =>
162
168
onChangeCondtion ( index , value , 'field' )
163
169
}
170
+ disabled = { ! isPro }
164
171
/>
165
172
166
173
< SelectControl
@@ -185,6 +192,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
185
192
onChange = { ( value ) =>
186
193
onChangeCondtion ( index , value , 'operator' )
187
194
}
195
+ disabled = { ! isPro }
188
196
/>
189
197
190
198
{ ! [ 'has_value' , 'empty' ] . includes (
@@ -203,6 +211,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
203
211
'value'
204
212
)
205
213
}
214
+ disabled = { ! isPro }
206
215
/>
207
216
) : (
208
217
< TextControl
@@ -215,6 +224,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
215
224
'value'
216
225
)
217
226
}
227
+ disabled = { ! isPro }
218
228
/>
219
229
) }
220
230
</ >
0 commit comments