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 / smart-list / inspect.js

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

105 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
4 import { usePanelBodyContext } from "../../context";
5 import { TabControls } from "../../components";
6
7 import {
8 SmartListGeneralTab,
9 SmartListStyleTab,
10 IconImageGeneralTab,
11 IconImageStyleTab,
12 ContentGeneralTab,
13 ContentStyleTab,
14 BadgeGeneralTab,
15 BadgeStyleTab,
16 } from "./generalTab";
17 import { VisibilityTab, AdvancedTab } from "../shared/advancedTab";
18
19 const Inspector = ({ attributes, setAttributes }) => {
20 const { openPanel, togglePanelBody } = usePanelBodyContext();
21
22 return (
23 <>
24 <PanelBody
25 title={__("General", "post-carousel")}
26 opened={openPanel === "general"}
27 onToggle={() => togglePanelBody("general")}
28 initialOpen={true}
29 >
30 {openPanel === "general" && (
31 <TabControls
32 attributes={attributes}
33 setAttributes={setAttributes}
34 GeneralTab={SmartListGeneralTab}
35 GeneralTabTitle="Basic"
36 StyleTab={SmartListStyleTab}
37 />
38 )}
39 </PanelBody>
40
41 <PanelBody
42 title={__("Icon / Image", "post-carousel")}
43 opened={openPanel === "icon-image"}
44 onToggle={() => togglePanelBody("icon-image")}
45 >
46 {openPanel === "icon-image" && (
47 <TabControls
48 attributes={attributes}
49 setAttributes={setAttributes}
50 GeneralTab={IconImageGeneralTab}
51 StyleTab={IconImageStyleTab}
52 />
53 )}
54 </PanelBody>
55
56 <PanelBody
57 title={__("Content", "post-carousel")}
58 opened={openPanel === "content"}
59 onToggle={() => togglePanelBody("content")}
60 >
61 {openPanel === "content" && (
62 <TabControls
63 attributes={attributes}
64 setAttributes={setAttributes}
65 GeneralTab={ContentGeneralTab}
66 StyleTab={ContentStyleTab}
67 />
68 )}
69 </PanelBody>
70
71 <PanelBody
72 title={__("Badge", "post-carousel")}
73 opened={openPanel === "badge"}
74 onToggle={() => togglePanelBody("badge")}
75 className="sp-smart-post-list-panel-body"
76 >
77 {openPanel === "badge" && (
78 <TabControls
79 attributes={attributes}
80 setAttributes={setAttributes}
81 GeneralTab={BadgeGeneralTab}
82 StyleTab={BadgeStyleTab}
83 />
84 )}
85 </PanelBody>
86 <PanelBody
87 title={__("Advanced", "post-carousel")}
88 opened={openPanel === "advance"}
89 onToggle={() => togglePanelBody("advance")}
90 >
91 <TabControls
92 attributes={attributes}
93 setAttributes={setAttributes}
94 displayIcon={false}
95 initialTab="visibility"
96 VisibilityTab={VisibilityTab}
97 AdvancedTab={AdvancedTab}
98 />
99 </PanelBody>
100 </>
101 );
102 };
103
104 export default Inspector;
105