Add alignment control

[MAILPOET-2809]
This commit is contained in:
Pavel Dohnal
2020-04-20 12:32:48 +02:00
committed by Veljko V
parent f93379fd70
commit 3c311ce7c5
2 changed files with 15 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import {
Panel,
PanelBody,
RangeControl,
SelectControl,
} from '@wordpress/components';
import MailPoet from 'mailpoet';
import PropTypes from 'prop-types';
@@ -79,6 +80,16 @@ const BasicSettingsPanel = ({ onToggle, isOpened }) => {
value={settings.borderColor}
onChange={partial(updateStyles, 'borderColor')}
/>
<SelectControl
label={MailPoet.I18n.t('formSettingsAlignment')}
onChange={partial(updateStyles, 'alignment')}
options={[
{ value: 'left', label: MailPoet.I18n.t('formSettingsAlignmentLeft') },
{ value: 'center', label: MailPoet.I18n.t('formSettingsAlignmentCenter') },
{ value: 'right', label: MailPoet.I18n.t('formSettingsAlignmentRight') },
]}
value={settings.alignment !== undefined ? settings.alignment : 'left'}
/>
</div>
</PanelBody>
</Panel>