From a52b669af3de6912791770184d777030d75d9fcc Mon Sep 17 00:00:00 2001 From: Pavel Dohnal Date: Mon, 29 Nov 2021 15:27:05 +0100 Subject: [PATCH] Make the fields the same width [MAILPOET-3502] --- .../subscriber_subscribed_to_list.tsx | 74 ++++++++++--------- assets/js/src/segments/dynamic/form.tsx | 30 ++++---- 2 files changed, 56 insertions(+), 48 deletions(-) diff --git a/assets/js/src/segments/dynamic/dynamic_segments_filters/subscriber_subscribed_to_list.tsx b/assets/js/src/segments/dynamic/dynamic_segments_filters/subscriber_subscribed_to_list.tsx index e6e260e467..a41a2d5c74 100644 --- a/assets/js/src/segments/dynamic/dynamic_segments_filters/subscriber_subscribed_to_list.tsx +++ b/assets/js/src/segments/dynamic/dynamic_segments_filters/subscriber_subscribed_to_list.tsx @@ -4,6 +4,7 @@ import { useDispatch, useSelect } from '@wordpress/data'; import MailPoet from 'mailpoet'; import Select from 'common/form/select/select'; +import { Grid } from 'common/grid'; import ReactSelect from 'common/form/react_select/react_select'; import { @@ -61,40 +62,45 @@ export const SubscribedToList: React.FunctionComponent = ({ filterIndex } return ( <> - - { - if (!segment.segments) return undefined; - const segmentId = option.value; - return segment.segments.indexOf(segmentId) !== -1; - }, - options - ) - } - onChange={(options: SelectOption[]): void => { - updateSegmentFilter( - { segments: map('value', options) }, - filterIndex - ); - }} - /> + + + + + { + if (!segment.segments) return undefined; + const segmentId = option.value; + return segment.segments.indexOf(segmentId) !== -1; + }, + options + ) + } + onChange={(options: SelectOption[]): void => { + updateSegmentFilter( + { segments: map('value', options) }, + filterIndex + ); + }} + /> + ); }; diff --git a/assets/js/src/segments/dynamic/form.tsx b/assets/js/src/segments/dynamic/form.tsx index 2340e2a337..4696475cca 100644 --- a/assets/js/src/segments/dynamic/form.tsx +++ b/assets/js/src/segments/dynamic/form.tsx @@ -135,20 +135,22 @@ export const Form: React.FunctionComponent = ({ {MinusIcon} )} - { + updateSegmentFilter({ + segmentType: newValue.group, + action: newValue.value, + }, index); + }} + automationId="select-segment-action" + isFullWidth + /> + {filterRow.index !== undefined && ( )}