f62537fc17
* Add lerna & GB package-building script * Move currency library to lerna module * Update lerna config * Add publish commands * Add currency as an faux-external module * Add separate command to build just core files * Update dependency path * Update build script to build all packages into `dist` * Add packages to the jest test setup * Move date library to packages * Update imports to use @woocommerce/date * Output wcSettings definition before any scripts are output Fixes issues where wc-dates lib relies on settings object * Add the build step into travis * Update jest config to dynamically get package paths * Update package postcss config to match wc-admin’s main config * Add combined watch scripts for package+app, add a `clean` command to clean up old build files * Ignore PHPCS error (leave todo message to fix) * Concat files with a space, fix issue where all files join in one continuous string and fail the check |
||
---|---|---|
.. | ||
activity-panel | ||
README.md | ||
index.js | ||
style.scss |
README.md
Header
A basic component for the app header. The header outputs breadcrumbs via the sections
prop (required) and access to the activity panel. It also sets the document title. The Header component used in each section automatically fills into the "header" slot defined in <Layout />
. We're using react-slot-fill to avoid a duplicated div
wrapper from Gutenberg's implementation.
How to use:
import Header from 'header';
render: function() {
return (
<Header
sections={ [
[ '/analytics', __( 'Analytics', 'wc-admin' ) ],
__( 'Report Title', 'wc-admin' ),
] }
/>
);
}
Props
sections
(required): Used to generate breadcrumbs. Accepts a single items or an array of items. To make an item a link, wrap it in an array with a relative link (example:[ '/analytics', __( 'Analytics', 'wc-admin' ) ]
).isEmbedded
: Boolean describing if the header is embedded on an existing wp-admin page. False if rendered as part of a full react page.
Activity Panel
This component contains the Activity Panel. This is shown on every page and is rendered as part of the header.