Basic threads analytics into Posthog MVP (#7871)
This commit is contained in:
parent
182aedc3d4
commit
75e41b4c1c
10 changed files with 51 additions and 18 deletions
|
@ -24,12 +24,13 @@ import classNames from 'classnames';
|
|||
import Analytics from '../../../Analytics';
|
||||
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { ButtonEvent } from "../elements/AccessibleButton";
|
||||
|
||||
interface IProps {
|
||||
// Whether this button is highlighted
|
||||
isHighlighted: boolean;
|
||||
// click handler
|
||||
onClick: () => void;
|
||||
onClick: (ev: ButtonEvent) => void;
|
||||
// The parameters to track the click event
|
||||
analytics: Parameters<typeof Analytics.trackEvent>;
|
||||
|
||||
|
@ -42,9 +43,9 @@ interface IProps {
|
|||
// TODO: replace this, the composer buttons and the right panel buttons with a unified representation
|
||||
@replaceableComponent("views.right_panel.HeaderButton")
|
||||
export default class HeaderButton extends React.Component<IProps> {
|
||||
private onClick = () => {
|
||||
private onClick = (ev: ButtonEvent) => {
|
||||
Analytics.trackEvent(...this.props.analytics);
|
||||
this.props.onClick();
|
||||
this.props.onClick(ev);
|
||||
};
|
||||
|
||||
public render() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue