<commit_before>// @flow
import React, { Component } from 'react';
import { observer, inject } from 'mobx-react';
import TopBar from '../components/layout/TopBar';
import NodeSyncStatusIcon from '../components/widgets/NodeSyncStatusIcon';
import WalletTestEnvironmentLabel from '../components/widgets/WalletTestEnvironmentLabel';
import type { InjectedProps } from '../types/injectedPropsType';
import environment from '../../../common/environment';
import { formattedWalletAmount } from '../utils/formatters';

type Props = InjectedProps;

@inject('stores', 'actions') @observer
export default class TopBarContainer extends Component<Props> {

  static defaultProps = { actions: null, stores: null };

  render() {
    const { actions, stores } = this.props;
    const { sidebar, app, networkStatus, wallets } = stores;
    const { active, isWalletRoute, hasAnyWallets } = wallets;
    const isMainnet = environment.isMainnet();
    const testnetLabel = (
      !isMainnet ? <WalletTestEnvironmentLabel network={environment.NETWORK} /> : null
    );

    return (
      <TopBar
        onToggleSidebar={actions.sidebar.toggleSubMenus.trigger}
        activeWallet={active}
        currentRoute={app.currentRoute}
        showSubMenus={sidebar.isShowingSubMenus}
        formattedWalletAmount={formattedWalletAmount}
        showSubMenuToggle={isWalletRoute && hasAnyWallets}
      >
        {testnetLabel}
        <NodeSyncStatusIcon
          networkStatus={networkStatus}
          isMainnet={isMainnet}
        />
      </TopBar>
    );
  }

}<commit_msg>[DDW-262] Replaces env module import with env from AppStore in TopBarContainer.js<commit_after>// @flow
import React, { Component } from 'react';
import { observer, inject } from 'mobx-react';
import TopBar from '../components/layout/TopBar';
import NodeSyncStatusIcon from '../components/widgets/NodeSyncStatusIcon';
import WalletTestEnvironmentLabel from '../components/widgets/WalletTestEnvironmentLabel';
import type { InjectedProps } from '../types/injectedPropsType';
import { formattedWalletAmount } from '../utils/formatters';

type Props = InjectedProps;

@inject('stores', 'actions') @observer
export default class TopBarContainer extends Component<Props> {

  static defaultProps = { actions: null, stores: null };

  render() {
    const { actions, stores } = this.props;
    const { sidebar, app, networkStatus, wallets } = stores;
    const { active, isWalletRoute, hasAnyWallets } = wallets;
    const { currentRoute, environment: { NETWORK } } = app;
    const isMainnet = (NETWORK === 'mainnet');
    const testnetLabel = (
      !isMainnet ? <WalletTestEnvironmentLabel network={NETWORK} /> : null
    );

    return (
      <TopBar
        onToggleSidebar={actions.sidebar.toggleSubMenus.trigger}
        activeWallet={active}
        currentRoute={currentRoute}
        showSubMenus={sidebar.isShowingSubMenus}
        formattedWalletAmount={formattedWalletAmount}
        showSubMenuToggle={isWalletRoute && hasAnyWallets}
      >
        {testnetLabel}
        <NodeSyncStatusIcon
          networkStatus={networkStatus}
          isMainnet={isMainnet}
        />
      </TopBar>
    );
  }

}
{'fraction_non_alphanumeric': 0.11503309171131422, 'fraction_numerical': 0.0009454774661203908, 'mean_word_length': 3.626822157434402, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '523185', 'n_tokens_mistral': 884, 'n_tokens_neox': 875, 'n_words': 200}