File manager - Edit - /home/palg2351/public_html/wp-content/themes/blocksy/static/js/options/options/ct-switch/GutenbergSwitch.js
Back
import { createElement } from '@wordpress/element' import { ToggleControl } from '@wordpress/components' const isActive = ({ option: { behavior = 'words' }, value }) => behavior === 'words' ? value === 'yes' : !!value const alternateValueFor = ({ option = {}, option: { behavior = 'words' }, value, }) => isActive({ option, value }) ? behavior === 'words' ? 'no' : false : behavior === 'words' ? 'yes' : true const GutenbergSwitch = ({ value, option = {}, onChange, onClick, maybeLabel, }) => { return ( <ToggleControl label={maybeLabel} checked={isActive({ option, value })} onChange={() => onChange(alternateValueFor({ option, value }))} onClick={(e) => { onClick && onClick(e) onChange(alternateValueFor({ option, value })) }} /> ) } export default GutenbergSwitch
| ver. 1.4 |
Github
|
.
| PHP 8.3.30 | Generation time: 1.2 |
proxy
|
phpinfo
|
Settings