Merge branch 'trunk' into update/add-edit

This commit is contained in:
Moon 2021-04-21 16:15:50 -07:00 committed by GitHub
commit bbd0b4e7e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 33 deletions

View File

@ -22,8 +22,9 @@
"devDependencies": {
"@woocommerce/dependency-extraction-webpack-plugin": "1.4.0",
"@woocommerce/eslint-plugin": "1.1.0",
"@wordpress/prettier-config": "^1.0.1",
"@wordpress/scripts": "^13.0.3",
"prop-types": "^15.7.2"
"prettier": "^2.2.1"
},
"dependencies": {
"@woocommerce/data": "^1.1.1",

View File

@ -11,26 +11,23 @@ import { AdminNotes } from '../admin-notes';
import { Tools } from '../tools';
import { default as Options } from '../options';
const tabs = applyFilters(
'woocommerce_admin_test_helper_tabs',
[
{
name: 'options',
title: 'Options',
content: <Options/>,
},
{
name: 'admin-notes',
title: 'Admin notes',
content: <AdminNotes/>,
},
{
name: 'tools',
title: 'Tools',
content: <Tools/>,
},
]
);
const tabs = applyFilters('woocommerce_admin_test_helper_tabs', [
{
name: 'options',
title: 'Options',
content: <Options />,
},
{
name: 'admin-notes',
title: 'Admin notes',
content: <AdminNotes />,
},
{
name: 'tools',
title: 'Tools',
content: <Tools />,
},
]);
export function App() {
return (
@ -39,18 +36,18 @@ export function App() {
<TabPanel
className="woocommerce-admin-test-helper__main-tab-panel"
activeClass="active-tab"
tabs={ tabs }
initialTabName={ tabs[ 0 ].name }
tabs={tabs}
initialTabName={tabs[0].name}
>
{ ( tab ) => (
{(tab) => (
<>
{ tab.content }
{ applyFilters(
`woocommerce_admin_test_helper_tab_${ tab.name }`,
{tab.content}
{applyFilters(
`woocommerce_admin_test_helper_tab_${tab.name}`,
[]
) }
)}
</>
) }
)}
</TabPanel>
</div>
);

View File

@ -9,8 +9,10 @@ import { render } from '@wordpress/element';
import { App } from './app';
import './index.scss';
const appRoot = document.getElementById( 'woocommerce-admin-test-helper-app-root' );
const appRoot = document.getElementById(
'woocommerce-admin-test-helper-app-root'
);
if ( appRoot ) {
render( <App/>, appRoot );
}
if (appRoot) {
render(<App />, appRoot);
}