<commit_before>/* @flow */
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { PushRouteAction, OnNarrowAction, Narrow } from '../types';
import { STATUSBAR_HEIGHT } from '../styles';
import { ZulipButton } from '../common';
import { homeNarrow, specialNarrow } from '../utils/narrow';
import NavButton from './NavButton';
import SubscriptionsContainer from '../streamlist/SubscriptionsContainer';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: STATUSBAR_HEIGHT,
    flexDirection: 'column',
  },
  iconList: {
    flexDirection: 'row',
    justifyContent: 'space-between',
  },
  button: {
    margin: 8,
  },
});

export default class StreamSidebar extends React.Component {

  props = {
    onNarrow: OnNarrowAction,
    pushRoute: PushRouteAction,
  };

  handleAllStreams = () => {
    const { pushRoute } = this.props;
    pushRoute('subscriptions');
  }

  handleSearch = (narrow: Narrow) => {
    const { pushRoute } = this.props;
    pushRoute('search');
  };

  handleSettings = (narrow: Narrow) => {
    const { pushRoute } = this.props;
    pushRoute('settings');
  };

  render() {
    const { onNarrow } = this.props;

    return (
      <View style={styles.container} scrollsToTop={false}>
        <View style={styles.iconList}>
          <NavButton
            name="md-home"
            onPress={() => onNarrow(homeNarrow())}
          />
          <NavButton
            name="md-mail"
            onPress={() => onNarrow(specialNarrow('private'))}
          />
          <NavButton
            name="md-star"
            onPress={() => onNarrow(specialNarrow('starred'))}
          />
          <NavButton
            name="md-at"
            onPress={() => onNarrow(specialNarrow('mentioned'))}
          />
          <NavButton
            name="md-search"
            onPress={this.handleSearch}
          />
          <NavButton
            name="md-settings"
            onPress={this.handleSettings}
          />
        </View>
        <SubscriptionsContainer onNarrow={onNarrow} />
        <ZulipButton
          style={styles.button}
          secondary
          text="All streams"
          onPress={this.handleAllStreams}
        />
      </View>
    );
  }
}
<commit_msg>Fix annoying run-time warning (#774)<commit_after>/* @flow */
import React from 'react';
import { StyleSheet, View } from 'react-native';

import { PushRouteAction, OnNarrowAction, Narrow } from '../types';
import { STATUSBAR_HEIGHT } from '../styles';
import { ZulipButton } from '../common';
import { homeNarrow, specialNarrow } from '../utils/narrow';
import NavButton from './NavButton';
import SubscriptionsContainer from '../streamlist/SubscriptionsContainer';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingTop: STATUSBAR_HEIGHT,
    flexDirection: 'column',
  },
  iconList: {
    flexDirection: 'row',
    justifyContent: 'space-between',
  },
  button: {
    margin: 8,
  },
});

export default class StreamSidebar extends React.Component {

  props: {
    onNarrow: OnNarrowAction,
    pushRoute: PushRouteAction,
  };

  handleAllStreams = () => {
    const { pushRoute } = this.props;
    pushRoute('subscriptions');
  }

  handleSearch = (narrow: Narrow) => {
    const { pushRoute } = this.props;
    pushRoute('search');
  };

  handleSettings = (narrow: Narrow) => {
    const { pushRoute } = this.props;
    pushRoute('settings');
  };

  render() {
    const { onNarrow } = this.props;

    return (
      <View style={styles.container} scrollsToTop={false}>
        <View style={styles.iconList}>
          <NavButton
            name="md-home"
            onPress={() => onNarrow(homeNarrow())}
          />
          <NavButton
            name="md-mail"
            onPress={() => onNarrow(specialNarrow('private'))}
          />
          <NavButton
            name="md-star"
            onPress={() => onNarrow(specialNarrow('starred'))}
          />
          <NavButton
            name="md-at"
            onPress={() => onNarrow(specialNarrow('mentioned'))}
          />
          <NavButton
            name="md-search"
            onPress={this.handleSearch}
          />
          <NavButton
            name="md-settings"
            onPress={this.handleSettings}
          />
        </View>
        <SubscriptionsContainer onNarrow={onNarrow} />
        <ZulipButton
          style={styles.button}
          secondary
          text="All streams"
          onPress={this.handleAllStreams}
        />
      </View>
    );
  }
}

{'fraction_non_alphanumeric': 0.14248136782113108, 'fraction_numerical': 0.0015344147303814116, 'mean_word_length': 2.206605762473647, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 41, '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': '7286744', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1337, 'n_words': 260}