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-name.js

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

export default function ConditionName( props ) {
	// Hide for template types that has another default, like single & archive.
	if ( 'general' !== props.default ) {
		return '';
	}

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

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

ConditionName.propTypes = {
	updateConditions: PropTypes.func.isRequired,
	id: PropTypes.string.isRequired,
	name: PropTypes.string.isRequired,
	options: PropTypes.array.isRequired,
	default: PropTypes.string.isRequired,
};

ConditionName.defaultProps = {
	name: '',
};