Refactor DropDownMenu to use onToggle method for event tracking

MAILPOET-6365
This commit is contained in:
Oluwaseun Olorunsola
2024-12-19 21:22:29 +01:00
committed by Oluwaseun Olorunsola
parent e73ffc1a79
commit 1e21223a73

View File

@@ -69,18 +69,18 @@ export function EmailTypeInfo() {
'Template actions',
'mailpoet'
) }
>
{ ( { onClose, isOpen } ) => {
if ( isOpen ) {
onToggle={ ( isOpen ) =>
recordEvent(
'sidebar_template_actions_clicked',
{
currentTemplate:
template?.title,
isOpen,
}
);
)
}
return (
>
{ ( { onClose } ) => (
<>
<MenuItem
onClick={ () => {
@@ -115,8 +115,7 @@ export function EmailTypeInfo() {
) }
</MenuItem>
</>
);
} }
) }
</DropdownMenu>
</FlexItem>
</Flex>