Use font size setting in form styles settings
[MAILPOET-2604]
This commit is contained in:
committed by
Veljko V
parent
40570f17d0
commit
bed6bf657e
@@ -1,6 +1,5 @@
|
|||||||
import React, { useRef } from 'react';
|
import React, { useRef } from 'react';
|
||||||
import {
|
import {
|
||||||
FontSizePicker,
|
|
||||||
Panel,
|
Panel,
|
||||||
PanelBody,
|
PanelBody,
|
||||||
} from '@wordpress/components';
|
} from '@wordpress/components';
|
||||||
@@ -10,6 +9,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|||||||
import { partial } from 'lodash';
|
import { partial } from 'lodash';
|
||||||
|
|
||||||
import ColorSettings from 'form_editor/components/color_settings';
|
import ColorSettings from 'form_editor/components/color_settings';
|
||||||
|
import FontSizeSettings from 'form_editor/components/font_size_settings';
|
||||||
|
|
||||||
const BasicSettingsPanel = ({ onToggle, isOpened }) => {
|
const BasicSettingsPanel = ({ onToggle, isOpened }) => {
|
||||||
const { changeFormSettings } = useDispatch('mailpoet-form-editor');
|
const { changeFormSettings } = useDispatch('mailpoet-form-editor');
|
||||||
@@ -25,14 +25,6 @@ const BasicSettingsPanel = ({ onToggle, isOpened }) => {
|
|||||||
settingsRef.current = updated;
|
settingsRef.current = updated;
|
||||||
};
|
};
|
||||||
|
|
||||||
const fontSizes = useSelect(
|
|
||||||
(select) => {
|
|
||||||
const { getSettings } = select('core/block-editor');
|
|
||||||
return getSettings().fontSizes;
|
|
||||||
},
|
|
||||||
[]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Panel>
|
<Panel>
|
||||||
<PanelBody
|
<PanelBody
|
||||||
@@ -51,16 +43,11 @@ const BasicSettingsPanel = ({ onToggle, isOpened }) => {
|
|||||||
value={settings.fontColor}
|
value={settings.fontColor}
|
||||||
onChange={partial(updateStyles, 'fontColor')}
|
onChange={partial(updateStyles, 'fontColor')}
|
||||||
/>
|
/>
|
||||||
<div>
|
<FontSizeSettings
|
||||||
<h3 className="mailpoet-styles-settings-heading">
|
name={MailPoet.I18n.t('formSettingsStylesFontSize')}
|
||||||
{MailPoet.I18n.t('formSettingsStylesFontSize')}
|
value={settings.fontSize}
|
||||||
</h3>
|
onChange={partial(updateStyles, 'fontSize')}
|
||||||
<FontSizePicker
|
/>
|
||||||
value={settings.fontSize}
|
|
||||||
onChange={partial(updateStyles, 'fontSize')}
|
|
||||||
fontSizes={fontSizes}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</PanelBody>
|
</PanelBody>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
Reference in New Issue
Block a user