Last active
February 24, 2023 18:04
-
-
Save josephfusco/b781839e8c33dc729b64f94eaa8a57c3 to your computer and use it in GitHub Desktop.
Testing the ToolbarNodeSkeleton component with Faust.js.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { FaustHooks, FaustPlugin } from '@faustwp/core'; | |
import { FaustToolbarNodes, ToolbarNodeSkeleton } from '@faustwp/core/toolbar'; | |
export class CustomToolbar implements FaustPlugin { | |
apply(hooks: FaustHooks) { | |
hooks.addFilter('toolbarNodes', 'faust', (toolbarNodes: FaustToolbarNodes) => { | |
const customToolbarNodes: FaustToolbarNodes = [ | |
{ | |
id: 'test1', | |
location: 'primary', | |
component: <ToolbarNodeSkeleton />, | |
}, | |
{ | |
id: 'test2', | |
location: 'primary', | |
component: <ToolbarNodeSkeleton />, | |
}, | |
]; | |
return [...toolbarNodes, ...customToolbarNodes]; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment