2018-05-18 17:31:08 +00:00
|
|
|
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
|
|
|
|
|
2018-06-28 13:52:45 +00:00
|
|
|
The `Layout` component sets up the structure of the page, using the components described below.
|
2018-05-18 17:31:08 +00:00
|
|
|
|
|
|
|
## 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)
|
2018-06-28 13:52:45 +00:00
|
|
|
- `wpMenu`: The ID of the menu item in the wp-admin sidebar, used to toggle on/off the current menu item classes
|
2018-05-18 17:31:08 +00:00
|
|
|
|
|
|
|
### `<Controller />`
|
|
|
|
|
|
|
|
This component pulls out the current page from `getPages`, and renders the container component defined in the object.
|