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 / column / Inspector.js

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

46 lines 1.4 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 { useState } from "@wordpress/element";
3 import { PanelBody } from "@wordpress/components";
4 import { TabControls } from "../../components";
5 import { ColumnAdvanceAdvancedTab, ColumnAdvancedGeneralTab, ContainerColumnGeneralTab } from "./generalTab";
6 import { ColumnAdvanceVisibilityTab, ContainerColumnStyleTab } from "./styleTab";
7
8 export 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 <TabControls
23 attributes={attributes}
24 setAttributes={setAttributes}
25 GeneralTab={ContainerColumnGeneralTab}
26 StyleTab={ContainerColumnStyleTab}
27 />
28 </PanelBody>
29 <PanelBody
30 title={__("Advanced", "post-carousel")}
31 opened={togglePanel === "advanced"}
32 onToggle={(value) => toggleHandler(value, "advanced")}
33 >
34 <TabControls
35 attributes={attributes}
36 setAttributes={setAttributes}
37 displayIcon={false}
38 GeneralTab={ColumnAdvancedGeneralTab}
39 VisibilityTab={ColumnAdvanceVisibilityTab}
40 AdvancedTab={ColumnAdvanceAdvancedTab}
41 />
42 </PanelBody>
43 </>
44 );
45 };
46