PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / admin / src / components / NavigationHeaderButton.jsx

NavigationHeaderButton.jsx in Tableberg – Simple Gutenberg Table Block 1.1.5, at admin/src/components/NavigationHeaderButton.jsx

40 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from "react";
2
3 /**
4 * Navigation header button component.
5 *
6 * @param {Object} props component properties
7 * @param {string} props.title button title
8 * @param {string} props.targetPath target path
9 * @param {Function} props.onClickHandler click handler, will call with targetPath as first argument
10 * @param {boolean} props.isActive button active status
11 * @class
12 */
13 function NavigationHeaderButton({
14 title,
15 targetPath,
16 onClickHandler,
17 isActive = false,
18 }) {
19 const onClickHandlerDefault = () => onClickHandler(targetPath);
20
21 return (
22 <div
23 data-active={isActive}
24 data-path={targetPath}
25 className={"tableberg-menu-navigation-header-button"}
26 tabIndex={0}
27 role={"button"}
28 onClick={onClickHandlerDefault}
29 onKeyDown={onClickHandlerDefault}
30 >
31 {title}
32 </div>
33 );
34 }
35
36 /**
37 * @module NavigationHeaderButton
38 */
39 export default NavigationHeaderButton;
40