PluginProbe
ElasticPress / 5.0.1
ElasticPress v5.0.1
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 / sync-ui / index.js

index.js in ElasticPress 5.0.1, at assets/js/sync-ui/index.js

60 lines 1.2 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 { SyncProvider } from '../sync';
12 import {
13 apiUrl,
14 autoIndex,
15 indexables,
16 indexMeta,
17 isEpio,
18 nonce,
19 postTypes,
20 syncHistory,
21 syncTrigger,
22 } from './config';
23 import { SyncSettingsProvider } from './provider';
24 import Sync from './apps/sync';
25
26 /**
27 * Styles.
28 */
29 import './style.css';
30
31 /**
32 * App component.
33 *
34 * @returns {WPElement} App component.
35 */
36 const App = () => (
37 <SyncProvider
38 apiUrl={apiUrl}
39 defaultSyncHistory={syncHistory}
40 defaultSyncTrigger={syncTrigger}
41 indexMeta={indexMeta}
42 isEpio={isEpio}
43 nonce={nonce}
44 >
45 <SyncSettingsProvider autoIndex={autoIndex} indexables={indexables} postTypes={postTypes}>
46 <SettingsScreenProvider title={__('Sync Settings', 'elasticpress')}>
47 <Sync />
48 </SettingsScreenProvider>
49 </SyncSettingsProvider>
50 </SyncProvider>
51 );
52
53 if (typeof createRoot === 'function') {
54 const root = createRoot(document.getElementById('ep-sync'));
55
56 root.render(<App />);
57 } else {
58 render(<App />, document.getElementById('ep-sync'));
59 }
60