PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.8
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.8
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / src / blocks / button / inspect.js

inspect.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at src/blocks/button/inspect.js

61 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2 import { PanelBody } from "@wordpress/components";
3 import { useState } from "@wordpress/element";
4 import { TabControls } from "../../components";
5 import { AdvancedTab, VisibilityTab } from "../shared/advancedTab";
6 import { SmartBtnGeneralTab, SmartBtnIconTab, SmartBtnLabelTab } from "./sidebarControl";
7
8 const Inspector = ({ attributes, setAttributes }) => {
9 const [togglePanel, setTogglePanel] = useState("general");
10
11 const toggleHandler = (toggleVal, tabName) => {
12 setTogglePanel(toggleVal ? tabName : "");
13 };
14
15 return (
16 <>
17 <PanelBody
18 title={__("General", "post-carousel")}
19 opened={togglePanel === "general"}
20 onToggle={(value) => toggleHandler(value, "general")}
21 >
22 <SmartBtnGeneralTab attributes={attributes} setAttributes={setAttributes} />
23 </PanelBody>
24 <PanelBody
25 title={__("Button Label", "post-carousel")}
26 opened={togglePanel === "buttonLabel"}
27 onToggle={(value) => toggleHandler(value, "buttonLabel")}
28 >
29 <SmartBtnLabelTab attributes={attributes} setAttributes={setAttributes} />
30 </PanelBody>
31
32 <PanelBody
33 title={__("Icon", "post-carousel")}
34 className="sp-button-icon-panel-body"
35 opened={togglePanel === "icon"}
36 onToggle={(value) => toggleHandler(value, "icon")}
37 >
38 <SmartBtnIconTab attributes={attributes} setAttributes={setAttributes} />
39 </PanelBody>
40 <PanelBody
41 title={__("Advanced", "post-carousel")}
42 opened={togglePanel === "advanced"}
43 onToggle={(value) => toggleHandler(value, "advanced")}
44 >
45 {togglePanel === "advanced" && (
46 <TabControls
47 attributes={attributes}
48 setAttributes={setAttributes}
49 AdvancedTab={AdvancedTab}
50 VisibilityTab={VisibilityTab}
51 displayIcon={false}
52 initialTab={"visibility"}
53 />
54 )}
55 </PanelBody>
56 </>
57 );
58 };
59
60 export default Inspector;
61