Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
import React from "react";
import { actionCreators as ac, actionTypes as at } from "common/Actions.mjs";
// Partner link for the top of a widget menu. Opens in a new tab and records
// `userAction`.
export const WidgetMenuPoweredBy = ({
dispatch,
url,
l10nId,
recordUserAction,
userAction,
onClick,
}) => {
const handleClick = () => {
dispatch(
ac.OnlyToMain({
type: at.OPEN_LINK,
data: { url, where: "tab" },
})
);
recordUserAction(userAction, { source: "context_menu" });
onClick?.();
};
return <panel-item data-l10n-id={l10nId} onClick={handleClick} />;
};