balloon
1 week ago
block-manager
2 months ago
block-style-manager
2 months ago
custom-block-style
2 months ago
custom-format
2 months ago
import-export
2 months ago
utils
2 months ago
block-category-position.js
2 months ago
breadcrumb.js
2 months ago
custom-css.js
2 months ago
index.js
2 months ago
license.js
2 months ago
load-separate.js
2 months ago
margin.js
2 months ago
new-faq.js
2 months ago
save-button.js
2 months ago
toc.js
2 months ago
custom-css.js
46 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | import { __ } from '@wordpress/i18n'; |
| 5 | import { useContext } from '@wordpress/element'; |
| 6 | import { ToggleControl } from '@wordpress/components'; |
| 7 | |
| 8 | /** |
| 9 | * Internal dependencies |
| 10 | */ |
| 11 | import { AdminContext } from '@vkblocks/admin/index'; |
| 12 | |
| 13 | export default function AdminCustomCss() { |
| 14 | const { vkBlocksOption, setVkBlocksOption } = useContext(AdminContext); |
| 15 | |
| 16 | return ( |
| 17 | <> |
| 18 | <section> |
| 19 | <h3 id="custom-css-setting"> |
| 20 | {__('Custom CSS Setting', 'vk-blocks')} |
| 21 | </h3> |
| 22 | <ToggleControl |
| 23 | name="vk_blocks_options[show_custom_css_editor_flag]" |
| 24 | label={__('Show Custom CSS flag in editor', 'vk-blocks')} |
| 25 | checked={ |
| 26 | vkBlocksOption.show_custom_css_editor_flag === 'show' |
| 27 | ? true |
| 28 | : false |
| 29 | } |
| 30 | onChange={(newValue) => { |
| 31 | if (newValue) { |
| 32 | newValue = 'show'; |
| 33 | } else { |
| 34 | newValue = 'hide'; |
| 35 | } |
| 36 | setVkBlocksOption({ |
| 37 | ...vkBlocksOption, |
| 38 | show_custom_css_editor_flag: newValue, |
| 39 | }); |
| 40 | }} |
| 41 | /> |
| 42 | </section> |
| 43 | </> |
| 44 | ); |
| 45 | } |
| 46 |