@@ -54,6 +54,7 @@ const SUPPORTED_FIELDS = [
54
54
unsupportedOperators : [ 'greater_than' , 'gte' , 'less_than' , 'lte' ] ,
55
55
} ,
56
56
] ;
57
+ const isPro = window . feedzyData . isPro ;
57
58
58
59
const ConditionsControl = ( { conditions, setConditions } ) => {
59
60
const onChangeMatch = ( value ) => {
@@ -87,7 +88,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
87
88
} ) ;
88
89
} ;
89
90
90
- const onChangeCondtion = ( index , value , key ) => {
91
+ const onChangeCondition = ( index , value , key ) => {
91
92
const conditionsCopy = [ ...conditions . conditions ] ;
92
93
93
94
conditionsCopy [ index ] [ key ] = value ;
@@ -117,18 +118,15 @@ const ConditionsControl = ({ conditions, setConditions }) => {
117
118
return (
118
119
< div
119
120
className = { classNames ( 'fz-condition-control' , {
120
- 'is-upsell' : ! window . feedzyData . isPro ,
121
+ 'is-upsell' : ! isPro ,
121
122
} ) }
122
123
>
123
124
< SelectControl
124
125
label = { __ ( 'Include If' , 'feedzy-rss-feeds' ) }
125
126
value = { conditions . match }
126
127
options = { [
127
128
{
128
- label : __ (
129
- 'All conditions are met' ,
130
- 'feedzy-rss-feeds'
131
- ) ,
129
+ label : __ ( 'All conditions are met' , 'feedzy-rss-feeds' ) ,
132
130
value : 'all' ,
133
131
} ,
134
132
{
@@ -137,6 +135,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
137
135
} ,
138
136
] }
139
137
onChange = { onChangeMatch }
138
+ disabled = { ! isPro }
140
139
/>
141
140
142
141
{ conditions . conditions . map ( ( condition , index ) => {
@@ -159,8 +158,9 @@ const ConditionsControl = ({ conditions, setConditions }) => {
159
158
value = { condition ?. field }
160
159
options = { SUPPORTED_FIELDS }
161
160
onChange = { ( value ) =>
162
- onChangeCondtion ( index , value , 'field' )
161
+ onChangeCondition ( index , value , 'field' )
163
162
}
163
+ disabled = { ! isPro }
164
164
/>
165
165
166
166
< SelectControl
@@ -183,8 +183,9 @@ const ConditionsControl = ({ conditions, setConditions }) => {
183
183
}
184
184
value = { condition ?. operator }
185
185
onChange = { ( value ) =>
186
- onChangeCondtion ( index , value , 'operator' )
186
+ onChangeCondition ( index , value , 'operator' )
187
187
}
188
+ disabled = { ! isPro }
188
189
/>
189
190
190
191
{ ! [ 'has_value' , 'empty' ] . includes (
@@ -197,24 +198,26 @@ const ConditionsControl = ({ conditions, setConditions }) => {
197
198
label = { __ ( 'Value' , 'feedzy-rss-feeds' ) }
198
199
value = { condition ?. value }
199
200
onChange = { ( value ) =>
200
- onChangeCondtion (
201
+ onChangeCondition (
201
202
index ,
202
203
value ,
203
204
'value'
204
205
)
205
206
}
207
+ disabled = { ! isPro }
206
208
/>
207
209
) : (
208
210
< TextControl
209
211
label = { __ ( 'Value' , 'feedzy-rss-feeds' ) }
210
212
value = { condition ?. value }
211
213
onChange = { ( value ) =>
212
- onChangeCondtion (
214
+ onChangeCondition (
213
215
index ,
214
216
value ,
215
217
'value'
216
218
)
217
219
}
220
+ disabled = { ! isPro }
218
221
/>
219
222
) }
220
223
</ >
0 commit comments