Move icon to a specific component

[MAILPOET-2741]
This commit is contained in:
Pavel Dohnal
2020-03-24 10:02:02 +01:00
committed by Veljko V
parent a840efc6ba
commit e27d6f3d17
2 changed files with 5 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
import FormPlacementSettings from './form_placement_settings';
import Toggle from '../../../../common/toggle';
import Icon from './below_pages_icon';
const BelowPages = () => {
const placeFormBellowAllPages = useSelect(
@@ -37,6 +38,7 @@ const BelowPages = () => {
onSave={save}
description={MailPoet.I18n.t('placeFormBellowPagesDescription')}
label={MailPoet.I18n.t('placeFormBellowPages')}
icon={Icon}
>
<div className="mailpoet-toggle-list">
<div className="mailpoet-toggle-list-description">

View File

@@ -3,7 +3,6 @@ import MailPoet from 'mailpoet';
import { Button } from '@wordpress/components';
import FormPlacementOption from './form_placement_option';
import Icon from './below_pages_icon';
import Modal from '../../../../common/modal/modal.jsx';
type Props = {
@@ -12,6 +11,7 @@ type Props = {
active: boolean,
label: string,
description: string,
icon: JSX.Element,
}
const BelowPages = ({
@@ -20,6 +20,7 @@ const BelowPages = ({
active,
onSave,
children,
icon,
}: Props) => {
const [displaySettings, setDisplaySettings] = useState(false);
@@ -32,7 +33,7 @@ const BelowPages = ({
<>
<FormPlacementOption
label={label}
icon={Icon}
icon={icon}
active={active}
onClick={() => setDisplaySettings(true)}
/>