Refactor DropDownMenu to use onToggle method for event tracking
MAILPOET-6365
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
e73ffc1a79
commit
1e21223a73
@@ -69,18 +69,18 @@ export function EmailTypeInfo() {
|
|||||||
'Template actions',
|
'Template actions',
|
||||||
'mailpoet'
|
'mailpoet'
|
||||||
) }
|
) }
|
||||||
>
|
onToggle={ ( isOpen ) =>
|
||||||
{ ( { onClose, isOpen } ) => {
|
|
||||||
if ( isOpen ) {
|
|
||||||
recordEvent(
|
recordEvent(
|
||||||
'sidebar_template_actions_clicked',
|
'sidebar_template_actions_clicked',
|
||||||
{
|
{
|
||||||
currentTemplate:
|
currentTemplate:
|
||||||
template?.title,
|
template?.title,
|
||||||
|
isOpen,
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
}
|
}
|
||||||
return (
|
>
|
||||||
|
{ ( { onClose } ) => (
|
||||||
<>
|
<>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={ () => {
|
onClick={ () => {
|
||||||
@@ -115,8 +115,7 @@ export function EmailTypeInfo() {
|
|||||||
) }
|
) }
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</>
|
</>
|
||||||
);
|
) }
|
||||||
} }
|
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</FlexItem>
|
</FlexItem>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
Reference in New Issue
Block a user