diff --git a/assets/js/src/form_editor/blocks/blocks.jsx b/assets/js/src/form_editor/blocks/blocks.jsx index a26e092055..b48d241519 100644 --- a/assets/js/src/form_editor/blocks/blocks.jsx +++ b/assets/js/src/form_editor/blocks/blocks.jsx @@ -5,6 +5,7 @@ import * as email from './email/email.jsx'; import * as submit from './submit/submit.jsx'; import * as firstName from './first_name/first_name.jsx'; import * as lastName from './last_name/last_name.jsx'; +import * as segmentSelect from './segment_select/segment_select.jsx'; export default () => { setCategories([ @@ -16,4 +17,5 @@ export default () => { registerBlockType(submit.name, submit.settings); registerBlockType(firstName.name, firstName.settings); registerBlockType(lastName.name, lastName.settings); + registerBlockType(segmentSelect.name, segmentSelect.settings); }; diff --git a/assets/js/src/form_editor/blocks/segment_select/icon.jsx b/assets/js/src/form_editor/blocks/segment_select/icon.jsx new file mode 100644 index 0000000000..a1d989f275 --- /dev/null +++ b/assets/js/src/form_editor/blocks/segment_select/icon.jsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { G, Path, SVG } from '@wordpress/components'; + +export default ( + + + + + +); diff --git a/assets/js/src/form_editor/blocks/segment_select/segment_select.jsx b/assets/js/src/form_editor/blocks/segment_select/segment_select.jsx new file mode 100644 index 0000000000..3c0844a169 --- /dev/null +++ b/assets/js/src/form_editor/blocks/segment_select/segment_select.jsx @@ -0,0 +1,26 @@ +import MailPoet from 'mailpoet'; +import icon from './icon.jsx'; + +export const name = 'mailpoet-form/segment-select'; + +export const settings = { + title: MailPoet.I18n.t('blockSegmentSelect'), + description: MailPoet.I18n.t('blockLastNameDescription'), + icon, + category: 'fields', + attributes: { + label: { + type: 'string', + default: MailPoet.I18n.t('blockSegmentSelectLabel'), + }, + }, + supports: { + html: false, + customClassName: false, + multiple: false, + }, + edit: () => {}, + save() { + return null; + }, +}; diff --git a/views/form/editor.html b/views/form/editor.html index f9177915b4..97199bbdf0 100644 --- a/views/form/editor.html +++ b/views/form/editor.html @@ -46,6 +46,9 @@ 'blockFirstNameDescription': __('Input field used to catch subscribers’ first names.'), 'blockLastName': __('Last name'), 'blockLastNameDescription': __('Input field used to catch subscribers’ last names.'), + 'blockSegmentSelect': __('List selection'), + 'blockLastNameDescription': __('Allow your subscribers to select which list(s) they want to subscribe to.'), + 'blockSegmentSelectLabel': __('Select list(s):'), 'blockEmail': __('Email'), 'blockEmailDescription': __('Input field used to catch subscribers’ email addresses.'), 'blockSubmit': __('Submit button'),