/** * External dependencies */ import { __ } from '@wordpress/i18n'; import { TextControl } from '@wordpress/components'; import { trash, Icon } from '@wordpress/icons'; import ChevronUpIcon from 'gridicons/dist/chevron-up'; import ChevronDownIcon from 'gridicons/dist/chevron-down'; import { Component, Fragment } from '@wordpress/element'; import { MenuItem } from '@woocommerce/components'; class SectionControls extends Component { constructor( props ) { super( props ); this.onMoveUp = this.onMoveUp.bind( this ); this.onMoveDown = this.onMoveDown.bind( this ); } onMoveUp() { const { onMove, onToggle } = this.props; onMove( -1 ); // Close the dropdown onToggle(); } onMoveDown() { const { onMove, onToggle } = this.props; onMove( 1 ); // Close the dropdown onToggle(); } render() { const { onRemove, isFirst, isLast, onTitleBlur, onTitleChange, titleInput, } = this.props; return (
{ ! isFirst && ( } label={ __( 'Move up' ) } size={ 20 } className="icon-control" /> { __( 'Move up', 'woocommerce' ) } ) } { ! isLast && ( } size={ 20 } label={ __( 'Move down' ) } className="icon-control" /> { __( 'Move down', 'woocommerce' ) } ) } { __( 'Remove section', 'woocommerce' ) }
); } } export default SectionControls;