balloon
2 weeks 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
block-category-position.js
57 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | import { __ } from '@wordpress/i18n'; |
| 5 | import { SelectControl } from '@wordpress/components'; |
| 6 | import { useContext } from '@wordpress/element'; |
| 7 | |
| 8 | /** |
| 9 | * Internal dependencies |
| 10 | */ |
| 11 | import { AdminContext } from '@vkblocks/admin/index'; |
| 12 | |
| 13 | export default function AdminBalloon() { |
| 14 | const { vkBlocksOption, setVkBlocksOption } = useContext(AdminContext); |
| 15 | |
| 16 | return ( |
| 17 | <> |
| 18 | <section> |
| 19 | <h3 id="block-category-position-setting"> |
| 20 | {__('Block Category Position Setting', 'vk-blocks')} |
| 21 | </h3> |
| 22 | <SelectControl |
| 23 | id="block-category-position-selector" |
| 24 | className="vk_admin_selectControl" |
| 25 | name="vk_blocks_options[block_category_position]" |
| 26 | value={ |
| 27 | !!vkBlocksOption.block_category_position && |
| 28 | vkBlocksOption.block_category_position |
| 29 | } |
| 30 | onChange={(newValue) => { |
| 31 | setVkBlocksOption({ |
| 32 | ...vkBlocksOption, |
| 33 | block_category_position: newValue, |
| 34 | }); |
| 35 | }} |
| 36 | options={[ |
| 37 | { |
| 38 | label: __( |
| 39 | 'Above the WordPress default blocks', |
| 40 | 'vk-blocks' |
| 41 | ), |
| 42 | value: 'above-core-blocks', |
| 43 | }, |
| 44 | { |
| 45 | label: __( |
| 46 | 'Under the WordPress default blocks', |
| 47 | 'vk-blocks' |
| 48 | ), |
| 49 | value: 'under-core-blocks', |
| 50 | }, |
| 51 | ]} |
| 52 | /> |
| 53 | </section> |
| 54 | </> |
| 55 | ); |
| 56 | } |
| 57 |