PluginProbe
ElasticPress / 5.0.2
ElasticPress v5.0.2
5.3.5 5.3.4 3.6.5 3.6.6 4.0.0 4.0.1 4.1.0 4.2.0 4.2.1 4.2.2 4.3.0 4.3.1 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.6.0 4.6.1 4.7.0 4.7.1 4.7.2 5.0.0 5.0.1 5.0.2 All 108 releases
elasticpress / assets / js / weighting / index.js

index.js in ElasticPress 5.0.2, at assets/js/weighting/index.js

46 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies.
3 */
4 import { createRoot, render, WPElement } from '@wordpress/element';
5 import { __ } from '@wordpress/i18n';
6
7 /**
8 * Internal Dependencies.
9 */
10 import { SettingsScreenProvider } from '../settings-screen';
11 import { apiUrl, metaMode, syncUrl, weightableFields, weightingConfiguration } from './config';
12 import { WeightingSettingsProvider } from './provider';
13 import Weighting from './apps/weighting';
14
15 /**
16 * Styles.
17 */
18 import './style.css';
19
20 /**
21 * App component.
22 *
23 * @returns {WPElement} App component.
24 */
25 const App = () => (
26 <SettingsScreenProvider title={__('Manage Search Fields & Weighting', 'elasticpress')}>
27 <WeightingSettingsProvider
28 apiUrl={apiUrl}
29 metaMode={metaMode}
30 syncUrl={syncUrl}
31 weightingConfiguration={weightingConfiguration}
32 weightableFields={weightableFields}
33 >
34 <Weighting />
35 </WeightingSettingsProvider>
36 </SettingsScreenProvider>
37 );
38
39 if (typeof createRoot === 'function') {
40 const root = createRoot(document.getElementById('ep-weighting-screen'));
41
42 root.render(<App />);
43 } else {
44 render(<App />, document.getElementById('ep-weighting-screen'));
45 }
46