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 / features / index.js

index.js in ElasticPress 5.0.1, at assets/js/features/index.js

74 lines 1.7 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 { createInterpolateElement, 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 {
12 apiUrl,
13 epioLogoUrl,
14 features,
15 indexMeta,
16 settings,
17 settingsDraft,
18 syncUrl,
19 } from './config';
20 import { FeatureSettingsProvider } from './provider';
21 import Features from './apps/features';
22
23 /**
24 * Styles.
25 */
26 import './style.css';
27
28 /**
29 * App component.
30 *
31 * @returns {WPElement} App component.
32 */
33 const App = () => (
34 <SettingsScreenProvider title={__('Features', 'elasticpress')}>
35 <FeatureSettingsProvider
36 apiUrl={apiUrl}
37 defaultSettings={settingsDraft || settings}
38 epioLogoUrl={epioLogoUrl}
39 features={features}
40 indexMeta={indexMeta}
41 syncedSettings={settings}
42 syncUrl={syncUrl}
43 >
44 <p>
45 {createInterpolateElement(
46 __(
47 'ElasticPress Features add functionality to enhance search and queries on your site. You may choose to activate some or all of these Features depending on your needs. You can learn more about each Feature <a>here</a>.',
48 'elasticpress',
49 ),
50 {
51 a: (
52 // eslint-disable-next-line jsx-a11y/anchor-has-content, jsx-a11y/control-has-associated-label
53 <a
54 target="_blank"
55 href="https://elasticpress.zendesk.com/hc/en-us/articles/16671825423501-Features"
56 rel="noreferrer"
57 />
58 ),
59 },
60 )}
61 </p>
62 <Features />
63 </FeatureSettingsProvider>
64 </SettingsScreenProvider>
65 );
66
67 if (typeof createRoot === 'function') {
68 const root = createRoot(document.getElementById('ep-dashboard'));
69
70 root.render(<App />);
71 } else {
72 render(<App />, document.getElementById('ep-dashboard'));
73 }
74