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 / social-profile-item / inspector.js

inspector.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.8, at src/blocks/social-profile-item/inspector.js

84 lines 2.5 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 { TabControls } from "../../components";
4 import {
5 SocialSingleContentAreaTab,
6 SocialSingleGeneralTab,
7 SocialSingleIconGeneralTab,
8 SocialSingleLabelGeneralTab,
9 } from "./generalTab";
10 import { useState } from "@wordpress/element";
11 import { SocialSingleIconStyleTab, SocialSingleLabelStyleTab } from "./styleTab";
12 import { AdvancedTab, VisibilityTab } from "../shared/advancedTab";
13
14 export const Inspector = ({ attributes, setAttributes }) => {
15 const { labelEnableParent, subTextEnableParent } = attributes;
16 const [togglePanel, setTogglePanel] = useState("general");
17 const toggleHandler = (toggleVal, tabName) => {
18 setTogglePanel(toggleVal ? tabName : "");
19 };
20
21 return (
22 <>
23 <PanelBody
24 title={__("General", "post-carousel")}
25 opened={"general" === togglePanel}
26 onToggle={(value) => toggleHandler(value, "general")}
27 >
28 <SocialSingleGeneralTab attributes={attributes} setAttributes={setAttributes} />
29 </PanelBody>
30 <PanelBody
31 title={__("Icon", "post-carousel")}
32 opened={"icon" === togglePanel}
33 onToggle={(value) => toggleHandler(value, "icon")}
34 >
35 <TabControls
36 attributes={attributes}
37 setAttributes={setAttributes}
38 GeneralTab={SocialSingleIconGeneralTab}
39 StyleTab={SocialSingleIconStyleTab}
40 />
41 </PanelBody>
42 {(labelEnableParent || subTextEnableParent) && (
43 <>
44 <PanelBody
45 title={__("Social Label", "post-carousel")}
46 opened={"social-label" === togglePanel}
47 onToggle={(value) => toggleHandler(value, "social-label")}
48 >
49 <TabControls
50 attributes={attributes}
51 setAttributes={setAttributes}
52 GeneralTab={SocialSingleLabelGeneralTab}
53 StyleTab={SocialSingleLabelStyleTab}
54 />
55 </PanelBody>
56 </>
57 )}
58 <PanelBody
59 title={__("Content Area", "post-carousel")}
60 opened={"content-area" === togglePanel}
61 onToggle={(value) => toggleHandler(value, "content-area")}
62 >
63 <SocialSingleContentAreaTab attributes={attributes} setAttributes={setAttributes} />
64 </PanelBody>
65 <PanelBody
66 title={__("Advanced", "post-carousel")}
67 opened={togglePanel === "advanced"}
68 onToggle={(value) => toggleHandler(value, "advanced")}
69 >
70 {togglePanel === "advanced" && (
71 <TabControls
72 attributes={attributes}
73 setAttributes={setAttributes}
74 AdvancedTab={AdvancedTab}
75 VisibilityTab={VisibilityTab}
76 displayIcon={false}
77 initialTab={"visibility"}
78 />
79 )}
80 </PanelBody>
81 </>
82 );
83 };
84