PluginProbe
Elementor Website Builder – more than just a page builder / 3.8.0-beta1
Elementor Website Builder – more than just a page builder v3.8.0-beta1
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
elementor / app / assets / js / layout / header-buttons.js

header-buttons.js in Elementor Website Builder – more than just a page builder 3.8.0-beta1, at app/assets/js/layout/header-buttons.js

51 lines 900 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import useAction from 'elementor-app/hooks/use-action';
2
3 import Button from './header-button';
4
5 export default function HeaderButtons( props ) {
6 const action = useAction();
7
8 const actionOnClose = () => {
9 if ( props.onClose ) {
10 props.onClose();
11 } else {
12 action.backToDashboard();
13 }
14 };
15
16 let tools = '';
17
18 if ( props.buttons.length ) {
19 const buttons = props.buttons.map( ( button ) => {
20 return <Button key={ button.id } { ...button } />;
21 } );
22
23 tools = (
24 <>
25 { buttons }
26 </>
27 );
28 }
29
30 return (
31 <div className="eps-app__header-buttons">
32 <Button
33 text={ __( 'Close', 'elementor' ) }
34 icon="eicon-close"
35 className="eps-app__close-button"
36 onClick={ actionOnClose }
37 />
38 { tools }
39 </div>
40 );
41 }
42
43 HeaderButtons.propTypes = {
44 buttons: PropTypes.arrayOf( PropTypes.object ),
45 onClose: PropTypes.func,
46 };
47
48 HeaderButtons.defaultProps = {
49 buttons: [],
50 };
51