1
1
import { __ } from '@wordpress/i18n' ;
2
- import { SETTINGS } from '../settings.js' ;
3
- import { PanelBody , ToggleControl } from '@wordpress/components' ;
2
+ import { PanelBody , ToggleControl , Notice , Dashicon } from '@wordpress/components' ;
4
3
5
- export const PanelThemeFeatures = ( { settingsData, updateSettings } ) => {
4
+ export const SettingsPanel = ( { SETTINGS , settingsData, updateSettings } ) => {
6
5
const protocol = window . location . protocol || 'https:' ;
7
6
const hostname = window . location . hostname || 'example.com' ;
8
7
const prefix = protocol + '//' + hostname ;
9
8
10
9
return (
11
- < PanelBody title = { __ ( 'Hello Theme Features' , 'hello-elementor' ) } >
10
+ < PanelBody title = { __ ( 'Hello Theme Settings' , 'hello-elementor' ) } >
11
+
12
+ < Notice status = "warning" isDismissible = "false" >
13
+ < Dashicon icon = "flag" />
14
+ { __ ( 'Be cautious, disabling some of the following options may break your website.' , 'hello-elementor' ) }
15
+ </ Notice >
12
16
13
17
< ToggleControl
14
18
label = { __ ( 'Disable description meta tag' , 'hello-elementor' ) }
@@ -35,12 +39,20 @@ export const PanelThemeFeatures = ( { settingsData, updateSettings } ) => {
35
39
< code className = "code-example" > <header class="page-header"> <h1 class="entry-title"> Post title </h1> </header> </ code >
36
40
37
41
< ToggleControl
38
- label = { __ ( 'Disable WordPress sitemap' , 'hello-elementor' ) }
39
- help = { __ ( 'Remove the WordPress sitemap that contains the site pages.' , 'hello-elementor' ) }
40
- checked = { ! ! settingsData [ SETTINGS . WP_SITEMAP ] || false }
41
- onChange = { ( value ) => updateSettings ( SETTINGS . WP_SITEMAP , value ) }
42
+ label = { __ ( 'Unregister Hello style.css' , 'hello-elementor' ) }
43
+ help = { __ ( "Disable Hello theme's style.css file which contains CSS reset rules for unified cross-browser view." , 'hello-elementor' ) }
44
+ checked = { ! ! settingsData [ SETTINGS . HELLO_STYLE ] || false }
45
+ onChange = { ( value ) => updateSettings ( SETTINGS . HELLO_STYLE , value ) }
46
+ />
47
+ < code className = "code-example" > <link rel="stylesheet" href="{ prefix } /wp-content/themes/hello-elementor/style.min.css" /> </ code >
48
+
49
+ < ToggleControl
50
+ label = { __ ( 'Unregister Hello theme.css' , 'hello-elementor' ) }
51
+ help = { __ ( "Disable Hello theme's theme.css file which contains CSS rules that style WordPress elements." , 'hello-elementor' ) }
52
+ checked = { ! ! settingsData [ SETTINGS . HELLO_THEME ] || false }
53
+ onChange = { ( value ) => updateSettings ( SETTINGS . HELLO_THEME , value ) }
42
54
/>
43
- < code className = "code-example" > <link rel="sitemap " href="{ prefix } /wp-sitemap.xml " /> </ code >
55
+ < code className = "code-example" > <link rel="stylesheet " href="{ prefix } /wp-content/themes/hello-elementor/theme.min.css " /> </ code >
44
56
45
57
</ PanelBody >
46
58
) ;
0 commit comments