Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _onInternalLinkClick = (ev: React.MouseEvent<{}> | React.KeyboardEvent<{}>, url: string): void => {
trackEvent(EventNames.ClickedInternalLink, {
topic: url, // @TODO: Remove topic when data is stale.
currentArea: getSiteArea(),
nextArea: getSiteArea(undefined, url),
nextPage: url,
currentPage: window.location.hash
});
};
private _onTopNavLinkClick = (ev: React.MouseEvent) => {
const { platform } = this.state;
const { siteDefinition } = this.props;
const target = ev.currentTarget as HTMLAnchorElement;
trackEvent(EventNames.ClickedTopNavLink, {
// Use the dom element's title or innerText as the topic.
topic: target.title || target.innerText, // @TODO: Remove topic when data is stale.
currentArea: getSiteArea(siteDefinition.pages),
nextArea: getSiteArea(siteDefinition.pages, target.hash || target.href),
nextPage: target.hash || target.href,
currentPage: window.location.hash,
platform: platform === 'default' ? 'None' : platform, // @TODO: Remove platform when data is stale.
currentPlatform: platform === 'default' ? 'None' : platform // Pages that don't have a platform will say 'none'
});
};
private _onLeftNavLinkClick = (ev: React.MouseEvent) => {
const { platform } = this.state;
const { siteDefinition } = this.props;
const target = ev.currentTarget as HTMLAnchorElement;
trackEvent(EventNames.ClickedLeftNavLink, {
// Use the dom element's title or innerText as the topic.
topic: target.title || target.innerText, // @TODO: Remove topic when data is stale.
currentArea: getSiteArea(siteDefinition.pages),
nextArea: getSiteArea(siteDefinition.pages, target.hash || target.href),
nextPage: target.hash || target.href,
currentPage: window.location.hash,
platform: platform === 'default' ? 'None' : platform, // @TODO: Remove platform when data is stale.
currentPlatform: platform === 'default' ? 'None' : platform // Pages that don't have a platform will say 'none'
});
};
private _onLeftNavSearchBoxClick = (ev: React.MouseEvent) => {
const { platform } = this.state;
const { siteDefinition } = this.props;
trackEvent(EventNames.ClickedSearchFilter, {
// Use the dom element's title or innerText as the topic.
topic: getSiteArea(siteDefinition.pages), // @TODO: Remove topic when data is stale.
currentArea: getSiteArea(siteDefinition.pages),
platform: platform === 'default' ? 'None' : platform, // @TODO: Remove platform when data is stale.
currentPlatform: platform === 'default' ? 'None' : platform // Pages that don't have a platform will say 'none'
});
};