PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.5
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.5
4.9.5 4.9.4 4.9.3 4.9.2 4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 All 203 releases
betterdocs / react-src / gutenberg / util / background-control / index.js

index.js in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.5, at react-src/gutenberg/util/background-control/index.js

64 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * WordPress dependencies
3 */
4 const { __ } = wp.i18n;
5 const { ToggleControl } = wp.components;
6
7 /**
8 * Internal dependencies
9 */
10 import OverlayControl from "./overlayControl";
11 import BgControl from "./bgControl";
12
13 export default function BackgroundControl({
14 resRequiredProps,
15 controlName,
16 noOverlay = false,
17 noMainBgi = false,
18 noOverlayBgi = false,
19 noTransition = false,
20
21 //
22 forButton = false,
23 }) {
24 const { setAttributes, attributes } = resRequiredProps;
25
26 const { [`${controlName}isBgOverlay`]: isBgOverlay } = attributes;
27
28 return (
29 <>
30 <BgControl
31 resRequiredProps={resRequiredProps}
32 controlName={controlName}
33 noMainBgi={forButton === true ? true : noMainBgi}
34 noTransition={noTransition}
35 />
36
37 {noOverlay === false && forButton == false && (
38 <>
39 <hr />
40
41 <ToggleControl
42 label={__("Enable Overlay", "betterdocs")}
43 checked={isBgOverlay}
44 onChange={() =>
45 setAttributes({
46 [`${controlName}isBgOverlay`]: !isBgOverlay,
47 })
48 }
49 />
50
51 {isBgOverlay && (
52 <OverlayControl
53 resRequiredProps={resRequiredProps}
54 controlName={controlName}
55 noOverlayBgi={noOverlayBgi}
56 noTransition={noTransition}
57 />
58 )}
59 </>
60 )}
61 </>
62 );
63 }
64