How to use the @uifabric/example-app-base/lib/index2.EventNames.ChangedPlatform function in @uifabric/example-app-base

To help you get started, we’ve selected a few @uifabric/example-app-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / office-ui-fabric-react / apps / fabric-website / src / components / Site / Site.tsx View on Github external
private _onPlatformChanged = (platformKey: TPlatforms): void => {
    const { siteDefinition } = this.props;
    if (platformKey !== this.state.platform) {
      trackEvent(EventNames.ChangedPlatform, {
        topic: getSiteArea(siteDefinition.pages), // @TODO: Remove topic when data is stale.
        currentArea: getSiteArea(siteDefinition.pages),
        platform: platformKey, // @TODO: Remove platform when data is stale.
        currentPlatform: this.state.platform,
        nextPlatform: platformKey
      });

      const { activePlatforms } = this.state;
      const currentPage = getSiteArea(siteDefinition.pages);

      this.setState(
        {
          platform: platformKey,
          activePlatforms: {
            ...activePlatforms,
            [currentPage]: platformKey