Skip to content

Commit d39a54f

Browse files
chore: formatting
1 parent 703a2c5 commit d39a54f

File tree

1 file changed

+79
-44
lines changed

1 file changed

+79
-44
lines changed

js/Conditions/ConditionsControl.js

Lines changed: 79 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@ import classNames from 'classnames';
77
* WordPress dependencies.
88
*/
99
import { __, sprintf } from '@wordpress/i18n';
10-
1110
import { Button, SelectControl, TextControl } from '@wordpress/components';
12-
1311
import { Icon, plus } from '@wordpress/icons';
12+
import { useState } from '@wordpress/element';
1413

1514
/**
1615
* Internal dependencies.
1716
*/
1817
import PanelTab from './PanelTab';
1918
import DateTimeControl from './DateTimeControl';
20-
import { useState } from 'react';
2119

2220
const isPro = window.feedzyData.isPro;
2321
const SUPPORTED_FIELDS = [
@@ -143,24 +141,28 @@ const ConditionsControl = ({ conditions, setConditions }) => {
143141
if (el) {
144142
el.style.zIndex = 0;
145143
}
146-
setModelOpen(false)
147-
}
144+
setModelOpen(false);
145+
};
148146

149147
return (
150148
<>
151-
<div
152-
className='fz-condition-control'
153-
>
149+
<div className="fz-condition-control">
154150
<SelectControl
155151
label={__('Include If', 'feedzy-rss-feeds')}
156152
value={conditions.match}
157153
options={[
158154
{
159-
label: __('All conditions are met', 'feedzy-rss-feeds'),
155+
label: __(
156+
'All conditions are met',
157+
'feedzy-rss-feeds'
158+
),
160159
value: 'all',
161160
},
162161
{
163-
label: __('Any condition is met', 'feedzy-rss-feeds'),
162+
label: __(
163+
'Any condition is met',
164+
'feedzy-rss-feeds'
165+
),
164166
value: 'any',
165167
},
166168
]}
@@ -173,7 +175,9 @@ const ConditionsControl = ({ conditions, setConditions }) => {
173175
);
174176
const operators = Object.keys(
175177
window?.feedzyConditionsData?.operators
176-
).filter((key) => !field?.unsupportedOperators?.includes(key));
178+
).filter(
179+
(key) => !field?.unsupportedOperators?.includes(key)
180+
);
177181

178182
return (
179183
<PanelTab
@@ -192,11 +196,13 @@ const ConditionsControl = ({ conditions, setConditions }) => {
192196
/>
193197

194198
<SelectControl
195-
label={__('Compare Operator', 'feedzy-rss-feeds')}
199+
label={__(
200+
'Compare Operator',
201+
'feedzy-rss-feeds'
202+
)}
196203
options={operators.map((key) => ({
197-
label: window.feedzyConditionsData.operators[
198-
key
199-
],
204+
label: window.feedzyConditionsData
205+
.operators[key],
200206
value: key,
201207
}))}
202208
help={
@@ -222,7 +228,10 @@ const ConditionsControl = ({ conditions, setConditions }) => {
222228
{condition?.field === 'date' ? (
223229
<DateTimeControl
224230
id={index}
225-
label={__('Value', 'feedzy-rss-feeds')}
231+
label={__(
232+
'Value',
233+
'feedzy-rss-feeds'
234+
)}
226235
value={condition?.value}
227236
onChange={(value) =>
228237
onChangeCondition(
@@ -234,7 +243,10 @@ const ConditionsControl = ({ conditions, setConditions }) => {
234243
/>
235244
) : (
236245
<TextControl
237-
label={__('Value', 'feedzy-rss-feeds')}
246+
label={__(
247+
'Value',
248+
'feedzy-rss-feeds'
249+
)}
238250
value={condition?.value}
239251
onChange={(value) =>
240252
onChangeCondition(
@@ -251,9 +263,11 @@ const ConditionsControl = ({ conditions, setConditions }) => {
251263
);
252264
})}
253265

254-
<div className={classNames("fz-action-btn mt-24", {
255-
'is-upsell': !isPro && 1 <= conditions.conditions.length
256-
})}
266+
<div
267+
className={classNames('fz-action-btn mt-24', {
268+
'is-upsell':
269+
!isPro && 1 <= conditions.conditions.length,
270+
})}
257271
>
258272
<Button
259273
variant="secondary"
@@ -265,56 +279,77 @@ const ConditionsControl = ({ conditions, setConditions }) => {
265279
</Button>
266280
</div>
267281
</div>
268-
{ modalOpen &&
269-
<div id="feedzy-add-filter-condition" className="wp-core-ui feedzy-modal">
282+
{modalOpen && (
283+
<div
284+
id="feedzy-add-filter-condition"
285+
className="wp-core-ui feedzy-modal"
286+
>
270287
<div className="modal-content">
271-
<button className="fz-notice close-modal" onClick={closeModal}>
272-
<span className="dashicons dashicons-no-alt"></span>
273-
<span className="screen-reader-text">
274-
{ __( 'Dismiss this dialog', 'feedzy-rss-feeds' ) }
275-
</span>
276-
</button>
288+
<button
289+
className="fz-notice close-modal"
290+
onClick={closeModal}
291+
>
292+
<span className="dashicons dashicons-no-alt"></span>
293+
<span className="screen-reader-text">
294+
{__('Dismiss this dialog', 'feedzy-rss-feeds')}
295+
</span>
296+
</button>
277297
<div className="modal-header">
278298
<h2>
279-
{ __( 'Upgrade to Use Unlimited Conditions', 'feedzy-rss-feeds' ) }
299+
{__(
300+
'Upgrade to Use Unlimited Conditions',
301+
'feedzy-rss-feeds'
302+
)}
280303
</h2>
281-
<p style={{color:'red'}}>
282-
{ __( 'Filter Condition limit reached', 'feedzy-rss-feeds' ) }
304+
<p style={{ color: 'red' }}>
305+
{__(
306+
'Filter Condition limit reached',
307+
'feedzy-rss-feeds'
308+
)}
283309
<span>
284-
{
285-
'(' +
310+
{'(' +
286311
sprintf(
287-
// translators: %1$s is the number of imports used, %2$s is the total number of imports allowed.
288-
__( '%1$s/%2$s used', 'feedzy-rss-feeds'),
289-
'1',
290-
'1' ) +
291-
')'
292-
}
312+
// translators: %1$s is the number of imports used, %2$s is the total number of imports allowed.
313+
__(
314+
'%1$s/%2$s used',
315+
'feedzy-rss-feeds'
316+
),
317+
'1',
318+
'1'
319+
) +
320+
')'}
293321
</span>
294322
</p>
295323
</div>
296324
<div className="modal-body">
297325
<p>
298-
{ __( 'Your current plan supports only one filter condition. Upgrade to unlock unlimited import configurations and make the most of Feedzy\'s powerful features!', 'feedzy-rss-feeds' ) }
326+
{__(
327+
"Your current plan supports only one filter condition. Upgrade to unlock unlimited import configurations and make the most of Feedzy's powerful features!",
328+
'feedzy-rss-feeds'
329+
)}
299330
</p>
300331
</div>
301332
<div className="modal-footer">
302333
<div className="button-container">
303334
<a
304335
href="https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=post&utm_campaign=filterCondition&utm_content=feedzy-rss-feeds"
305-
target="_blank" rel="noreferrer "
336+
target="_blank"
337+
rel="noreferrer "
306338
className="button button-primary button-large"
307339
>
308-
{ __( 'Upgrade to PRO', 'feedzy-rss-feeds' ) }
340+
{__('Upgrade to PRO', 'feedzy-rss-feeds')}
309341
</a>
310342
</div>
311343
<span>
312-
{ __( '30-day money-back guarantee. No questions asked.', 'feedzy-rss-feeds' ) }
344+
{__(
345+
'30-day money-back guarantee. No questions asked.',
346+
'feedzy-rss-feeds'
347+
)}
313348
</span>
314349
</div>
315350
</div>
316351
</div>
317-
}
352+
)}
318353
</>
319354
);
320355
};

0 commit comments

Comments
 (0)