PluginProbe
WP Ultimate Post Grid / 3.3.0
WP Ultimate Post Grid v3.3.0
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / assets / js / admin-manage / App.js

App.js in WP Ultimate Post Grid 3.3.0, at assets/js/admin-manage/App.js

48 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React, { Component } from 'react';
2 import { Route } from 'react-router-dom';
3
4 import Menu from './Menu';
5 import Notices from './Notices';
6 import DataTable from './DataTable';
7 import ErrorBoundary from 'Shared/ErrorBoundary';
8
9 import '../../css/admin/manage/app.scss';
10 import defaultDatatables from './DataTableConfig';
11 const { hooks } = WPUltimatePostGrid.shared;
12
13 export default class App extends Component {
14 render() {
15 let datatables = hooks.applyFilters( 'datatables', defaultDatatables );
16
17 return (
18 <ErrorBoundary module="Manage">
19 <div id="wpupg-admin-manage-header">
20 <Menu
21 datatables={ datatables }
22 />
23 <Notices />
24 </div>
25 <div id="wpupg-admin-manage-content">
26 <Route path="/:type?" render={( {match} ) => {
27 let type = 'grids';
28 if ( match.params.type && Object.keys(datatables).includes( match.params.type ) ) {
29 type = match.params.type;
30 }
31
32 if ( ! datatables.hasOwnProperty( type ) ) {
33 return null;
34 }
35
36 return (
37 <DataTable
38 type={ type }
39 options={ datatables[ type ] }
40 />
41 )
42 }} />
43 </div>
44 </ErrorBoundary>
45 );
46 }
47 }
48