-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
540 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => 'a29d6e29e9d190fb2551'); | ||
<?php return array('dependencies' => array('react', 'wp-components', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-i18n', 'wp-notices', 'wp-plugins'), 'version' => '408be787993bd68bb94f'); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Summary: GlobalSettingPanel component. | ||
* | ||
* @description This file contains the GlobalSettingPanel component used to display the plugin's global settings which contains the global correction rules in sidebar for administrators. | ||
* @author Loïc Antignac. | ||
*/ | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n' | ||
import { Panel, PanelHeader, PanelBody, PanelRow } from '@wordpress/components' | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
import { GlobalSettingToggle } from './GlobalSettingToggle' | ||
import { rules } from '../config/rules' | ||
import { categories } from '../config/categories' | ||
|
||
/** | ||
* Define the GlobalSettingPanel component | ||
*/ | ||
const GlobalSettingPanel = () => ( | ||
<Panel className='GlobalSettingPanel'> | ||
<PanelHeader><strong>{ __( 'Global correction rules', 'consistency' ) }</strong></PanelHeader> | ||
{ | ||
[...categories].map( ( cat, key ) => { | ||
return ( <PanelBody | ||
key={ key } | ||
title={ __( cat.label, 'consistency' ) } | ||
initialOpen={ false } | ||
> | ||
{ | ||
[...rules] | ||
.filter(rule => rule.category === cat.slug) | ||
.map( ( rule, key ) => ( | ||
<GlobalSettingToggle | ||
key={ key } | ||
settingSlug={ rule.slug } | ||
settingName={ rule.name } | ||
settingDescription={ { | ||
__html: rule.description | ||
} } | ||
/> | ||
) ) | ||
} | ||
</PanelBody> ) | ||
} ) | ||
} | ||
</Panel> | ||
) | ||
|
||
export default GlobalSettingPanel |
Oops, something went wrong.