@fantassin/beacon

1.0.0 • Public • Published

Fantassin Beacon

Installation

Use the package manager npm to install the Beacon.

npm i @fantassin/beacon -D

Usage

By default the Beacon is empty.

If you want to add some sections you have to install @wordpress/hooks package.

npm i @wordpress/hooks -D

Then you can customize your sections with React Components like this :

import { addFilter } from @wordpress/hooks;
import YourComponent from './your-component-folder';

function exampleSection( sections ){
	let newSection = {
		name: 'section-key',
		tabLabel: 'Section name',
		content: <YourComponent />,
	}
	return [ ...sections, newSection ];
}

addFilter( 'fantassin.beacon.getSections', 'your_namespace', exampleSection );

When you want to display the Beacon you can enqueue build/index.js in you HTML file like this :

<script src="build/index.js"></script>

Readme

Keywords

none

Package Sidebar

Install

npm i @fantassin/beacon

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

14.4 kB

Total Files

23

Last publish

Collaborators

  • truchot
  • suriteka
  • maite-fantassin