Add template actions menu toggle with dummy reset template action
[MAILPOET-6336]
This commit is contained in:
committed by
Rostislav Wolný
parent
9ebcf9b506
commit
ebefee4de7
@ -48,6 +48,20 @@
|
|||||||
span {
|
span {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mailpoet-email-type-info__content_heading {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
div:last-child {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: -8px;
|
||||||
|
margin-top: -6px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
import { Panel, PanelBody, PanelRow } from '@wordpress/components';
|
import {
|
||||||
|
Panel,
|
||||||
|
PanelBody,
|
||||||
|
PanelRow,
|
||||||
|
DropdownMenu,
|
||||||
|
MenuItem,
|
||||||
|
} from '@wordpress/components';
|
||||||
import { __ } from '@wordpress/i18n';
|
import { __ } from '@wordpress/i18n';
|
||||||
import { useSelect } from '@wordpress/data';
|
import { useSelect } from '@wordpress/data';
|
||||||
import { Icon, layout } from '@wordpress/icons';
|
import { Icon, layout, moreVertical } from '@wordpress/icons';
|
||||||
import { storeName } from '../../store';
|
import { storeName } from '../../store';
|
||||||
|
|
||||||
export function TemplateInfo() {
|
export function TemplateInfo() {
|
||||||
@ -20,10 +26,31 @@ export function TemplateInfo() {
|
|||||||
<Icon icon={ layout } />
|
<Icon icon={ layout } />
|
||||||
</span>
|
</span>
|
||||||
<div className="mailpoet-email-type-info__content">
|
<div className="mailpoet-email-type-info__content">
|
||||||
|
<div className="mailpoet-email-type-info__content_heading">
|
||||||
<h2>
|
<h2>
|
||||||
{ /* @ts-expect-error Todo template type is not defined */ }
|
{ /* @ts-expect-error Todo template type is not defined */ }
|
||||||
{ template?.title || __( 'Template', 'mailpoet' ) }
|
{ template?.title ||
|
||||||
|
__( 'Template', 'mailpoet' ) }
|
||||||
</h2>
|
</h2>
|
||||||
|
<DropdownMenu
|
||||||
|
icon={ moreVertical }
|
||||||
|
label={ __( 'Template actions', 'mailpoet' ) }
|
||||||
|
>
|
||||||
|
{ ( { onClose } ) => (
|
||||||
|
<MenuItem
|
||||||
|
onClick={ () => {
|
||||||
|
onClose();
|
||||||
|
} }
|
||||||
|
info={ __(
|
||||||
|
'Reset to default to clear all customizations',
|
||||||
|
'mailpoet'
|
||||||
|
) }
|
||||||
|
>
|
||||||
|
{ __( 'Reset', 'mailpoet' ) }
|
||||||
|
</MenuItem>
|
||||||
|
) }
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
{ description && <p>{ description || '' }</p> }
|
{ description && <p>{ description || '' }</p> }
|
||||||
<p>
|
<p>
|
||||||
{ __(
|
{ __(
|
||||||
|
Reference in New Issue
Block a user