woocommerce/plugins/woocommerce-admin/client/layout
Kelly Dwan 6d2eec1c12 Update `layout/*` file structure (https://github.com/woocommerce/woocommerce-admin/pull/463)
* Move section, header, and activity panel out of layout folder

* Update file soures

* Move documentation into component, and update generation script to handle the duplicated exports
2018-09-21 11:19:05 -04:00
..
README.md Update `layout/*` file structure (https://github.com/woocommerce/woocommerce-admin/pull/463) 2018-09-21 11:19:05 -04:00
controller.js Fix wp-admin navigation active state (https://github.com/woocommerce/woocommerce-admin/pull/352) 2018-09-05 14:37:26 -04:00
index.js Update `layout/*` file structure (https://github.com/woocommerce/woocommerce-admin/pull/463) 2018-09-21 11:19:05 -04:00
notices.js Global Header & Activity Panel on all WooCommerce Pages (https://github.com/woocommerce/woocommerce-admin/pull/110) 2018-06-26 10:49:42 -04:00
style.scss Add fallback gutter for browsers that don't support CSS Custom properties (https://github.com/woocommerce/woocommerce-admin/pull/372) 2018-09-11 09:27:13 +02:00

README.md

Layout

This component handles the layout of the WooCommerce app. This also controls the routing, and which component should be shown on each page.

Layout

The Layout component sets up the structure of the page, using the components described below.

Notices

This component will house the list of high priority notices. This appears on every page. Currently just a placeholder div.

Controller

layout/controller.js has two exports, a <Controller /> component and a getPages function.

getPages

This function returns an array of objects, each describing a page in the app. The properties in each object are:

  • container: A component, rendered in the main content area of the Layout
  • path: The path this component should show up on (this should be unique to each entry)
  • wpMenu: The ID of the menu item in the wp-admin sidebar, used to toggle on/off the current menu item classes

<Controller />

This component pulls out the current page from getPages, and renders the container component defined in the object.