PluginProbe
ElasticPress / 5.3.5
ElasticPress v5.3.5
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 / synonyms / index.js

index.js in ElasticPress 5.3.5, at assets/js/synonyms/index.js

53 lines 1.0 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, defaultIsSolr, defaultSolr, syncUrl } from './config';
12 import { SynonymsSettingsProvider } from './provider';
13 import SynonymsSettings from './apps/synonyms-settings';
14
15 /**
16 * Styles.
17 */
18 import './style.css';
19
20 /**
21 * App component.
22 *
23 * @returns {WPElement}
24 */
25 const App = () => (
26 <SettingsScreenProvider title={__('Manage Synonyms', 'elasticpress')}>
27 <SynonymsSettingsProvider
28 apiUrl={apiUrl}
29 defaultIsSolr={defaultIsSolr}
30 defaultSolr={defaultSolr}
31 syncUrl={syncUrl}
32 >
33 <SynonymsSettings />
34 </SynonymsSettingsProvider>
35 </SettingsScreenProvider>
36 );
37
38 /**
39 * Root element.
40 */
41 const el = document.getElementById('ep-synonyms');
42
43 /**
44 * Render.
45 */
46 if (typeof createRoot === 'function') {
47 const root = createRoot(el);
48
49 root.render(<App />);
50 } else {
51 render(<App />, el);
52 }
53