Add font settings to the submit block

[MAILPOET-2911]
This commit is contained in:
Pavel Dohnal
2020-06-09 15:15:56 +02:00
committed by Veljko V
parent 4792a710ba
commit f60de78da4
2 changed files with 11 additions and 0 deletions

View File

@@ -68,6 +68,10 @@ const SubmitEdit = ({ attributes, setAttributes }) => {
styles.backgroundColor = attributes.styles.backgroundColor; styles.backgroundColor = attributes.styles.backgroundColor;
} }
if (attributes.styles.fontFamily && !attributes.styles.inheritFromTheme) {
styles.fontFamily = attributes.styles.fontFamily;
}
const className = classnames('mailpoet_submit', { button: attributes.styles.inheritFromTheme }); const className = classnames('mailpoet_submit', { button: attributes.styles.inheritFromTheme });
return ( return (

View File

@@ -11,6 +11,7 @@ import { partial } from 'lodash';
import ColorSettings from 'form_editor/components/color_settings'; import ColorSettings from 'form_editor/components/color_settings';
import FontSizeSetting from 'form_editor/components/font_size_settings'; import FontSizeSetting from 'form_editor/components/font_size_settings';
import { FormSettingsType } from 'form_editor/components/form_settings/form_settings'; import { FormSettingsType } from 'form_editor/components/form_settings/form_settings';
import FontFamilySettings from '../../components/font_family_settings';
type Styles = { type Styles = {
fullWidth: boolean, fullWidth: boolean,
@@ -19,6 +20,7 @@ type Styles = {
backgroundColor?: string, backgroundColor?: string,
fontColor?: string, fontColor?: string,
fontSize?: number, fontSize?: number,
fontFamily?: string,
borderSize?: number, borderSize?: number,
borderRadius?: number, borderRadius?: number,
borderColor?: string, borderColor?: string,
@@ -103,6 +105,11 @@ const StylesSettings = ({
onChange={partial(updateStyles, 'bold')} onChange={partial(updateStyles, 'bold')}
className="mailpoet-automation-styles-bold-toggle" className="mailpoet-automation-styles-bold-toggle"
/> />
<FontFamilySettings
name={MailPoet.I18n.t('formSettingsStylesFontFamily')}
value={styles.fontFamily || formSettings.fontFamily}
onChange={partial(updateStyles, 'fontFamily')}
/>
<RangeControl <RangeControl
label={MailPoet.I18n.t('formSettingsInputPadding')} label={MailPoet.I18n.t('formSettingsInputPadding')}
value={ value={