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
new-faq.js
61 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 AdminNewFaq() { |
| 14 | const { vkBlocksOption, setVkBlocksOption } = useContext(AdminContext); |
| 15 | |
| 16 | return ( |
| 17 | <> |
| 18 | <section> |
| 19 | <h3 id="faq-setting">{__('FAQ Block Setting', 'vk-blocks')}</h3> |
| 20 | <p> |
| 21 | {__( |
| 22 | 'Please specify a common accordion setting to be used in the FAQ block.', |
| 23 | 'vk-blocks' |
| 24 | )} |
| 25 | </p> |
| 26 | <SelectControl |
| 27 | name="vk_blocks_options[new_faq_accordion]" |
| 28 | className="vk_admin_selectControl" |
| 29 | value={vkBlocksOption.new_faq_accordion} |
| 30 | onChange={(newValue) => { |
| 31 | setVkBlocksOption({ |
| 32 | ...vkBlocksOption, |
| 33 | new_faq_accordion: newValue, |
| 34 | }); |
| 35 | }} |
| 36 | options={[ |
| 37 | { |
| 38 | label: __('Disable accordion', 'vk-blocks'), |
| 39 | value: 'disable', |
| 40 | }, |
| 41 | { |
| 42 | label: __( |
| 43 | 'Enable accordion and default open', |
| 44 | 'vk-blocks' |
| 45 | ), |
| 46 | value: 'open', |
| 47 | }, |
| 48 | { |
| 49 | label: __( |
| 50 | 'Enable accordion and default close', |
| 51 | 'vk-blocks' |
| 52 | ), |
| 53 | value: 'close', |
| 54 | }, |
| 55 | ]} |
| 56 | /> |
| 57 | </section> |
| 58 | </> |
| 59 | ); |
| 60 | } |
| 61 |