Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/elementor-pro   php

Repository URL to install this package:

Version: 3.2.1 

/ app / modules / site-editor / assets / js / pages / conditions / condition-sub.js

import { Select } from '@elementor/app-ui';

export default function ConditionSub( props ) {
	if ( 'general' === props.name || ! props.subOptions.length ) {
		return '';
	}

	const onChange = ( e ) => props.updateConditions( props.id, { sub: e.target.value, subId: '' } );

	return (
		<div className="e-site-editor-conditions__input-wrapper">
			<Select options={ props.subOptions } value={ props.sub } onChange={ onChange } />
		</div>
	);
}

ConditionSub.propTypes = {
	updateConditions: PropTypes.func.isRequired,
	id: PropTypes.string.isRequired,
	name: PropTypes.string.isRequired,
	sub: PropTypes.string.isRequired,
	subOptions: PropTypes.array.isRequired,
};

ConditionSub.defaultProps = {
	sub: '',
	subOptions: {},
};