<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
  ScrollView
} from 'react-native';
import tracker from 'helpers/googleAnalytics';

import I18n from 'locales';
import Theme from 'config/theme';
import List from 'components/common/list';
import styles from './styles';

class FaqList extends Component {
  static navigatorStyle = {
    navBarTextColor: Theme.colors.color1,
    navBarButtonColor: Theme.colors.color1,
    topBarElevationShadowEnabled: false,
    navBarBackgroundColor: Theme.background.main
  };

  static propTypes = {
    navigator: PropTypes.object.isRequired
  };

  componentDidMount() {
    tracker.trackScreenView('FaqList');
  }

  handleStaticLinks = (section, text, list) => {
    this.props.navigator.push({
      screen: section,
      title: text,
      passProps: {
        contentFaq: list
      }
    });
  }

  render() {
    const terms = [
      {
        text: I18n.t('faq.firstQuestion.title'),
        title: I18n.t('faq.firstQuestion.title'),
        list: I18n.t('faq.firstQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.secondQuestion.title'),
        title: I18n.t('faq.secondQuestion.title'),
        list: I18n.t('faq.secondQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.thirdQuestion.title'),
        title: I18n.t('faq.thirdQuestion.title'),
        list: I18n.t('faq.thirdQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.fourthQuestion.title'),
        title: I18n.t('faq.fourthQuestion.title'),
        list: I18n.t('faq.fourthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.fifthQuestion.title'),
        title: I18n.t('faq.fifthQuestion.title'),
        list: I18n.t('faq.fifthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.sixthQuestion.title'),
        title: I18n.t('faq.sixthQuestion.title'),
        list: I18n.t('faq.sixthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.seventhQuestion.title'),
        title: I18n.t('faq.seventhQuestion.title'),
        list: I18n.t('faq.seventhQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.eighthQuestion.title'),
        title: I18n.t('faq.eighthQuestion.title'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.ninethQuestion.title'),
        title: I18n.t('faq.ninethQuestion.title'),
        list: I18n.t('faq.ninethQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.tenthQuestion.title'),
        title: I18n.t('faq.tenthQuestion.title'),
        list: I18n.t('faq.tenthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.eleventhQuestion.title'),
        title: I18n.t('faq.eleventhQuestion.title'),
        list: I18n.t('faq.eleventhQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      }
    ];
    return (
      <ScrollView
        style={styles.container}
        contentContainerStyle={styles.containerContent}
        showsVerticalScrollIndicator={false}
        showsHorizontalScrollIndicator={false}
      >
        <List content={terms} bigSeparation={false}>{}</List>
      </ScrollView>
    );
  }
}

export default FaqList;
<commit_msg>fix: don`t show empty faq questions<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
  ScrollView
} from 'react-native';
import tracker from 'helpers/googleAnalytics';

import I18n from 'locales';
import Theme from 'config/theme';
import List from 'components/common/list';
import styles from './styles';

class FaqList extends Component {
  static navigatorStyle = {
    navBarTextColor: Theme.colors.color1,
    navBarButtonColor: Theme.colors.color1,
    topBarElevationShadowEnabled: false,
    navBarBackgroundColor: Theme.background.main
  };

  static propTypes = {
    navigator: PropTypes.object.isRequired
  };

  componentDidMount() {
    tracker.trackScreenView('FaqList');
  }

  handleStaticLinks = (section, text, list) => {
    this.props.navigator.push({
      screen: section,
      title: text,
      passProps: {
        contentFaq: list
      }
    });
  }

  render() {
    const terms = [
      {
        text: I18n.t('faq.firstQuestion.title'),
        title: I18n.t('faq.firstQuestion.title'),
        list: I18n.t('faq.firstQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.secondQuestion.title'),
        title: I18n.t('faq.secondQuestion.title'),
        list: I18n.t('faq.secondQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.thirdQuestion.title'),
        title: I18n.t('faq.thirdQuestion.title'),
        list: I18n.t('faq.thirdQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.fourthQuestion.title'),
        title: I18n.t('faq.fourthQuestion.title'),
        list: I18n.t('faq.fourthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.fifthQuestion.title'),
        title: I18n.t('faq.fifthQuestion.title'),
        list: I18n.t('faq.fifthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.sixthQuestion.title'),
        title: I18n.t('faq.sixthQuestion.title'),
        list: I18n.t('faq.sixthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.seventhQuestion.title'),
        title: I18n.t('faq.seventhQuestion.title'),
        list: I18n.t('faq.seventhQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.eighthQuestion.title'),
        title: I18n.t('faq.eighthQuestion.title'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.ninethQuestion.title'),
        title: I18n.t('faq.ninethQuestion.title'),
        list: I18n.t('faq.ninethQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.tenthQuestion.title'),
        title: I18n.t('faq.tenthQuestion.title'),
        list: I18n.t('faq.tenthQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      },
      {
        text: I18n.t('faq.eleventhQuestion.title'),
        title: I18n.t('faq.eleventhQuestion.title'),
        list: I18n.t('faq.eleventhQuestion.content'),
        section: 'ForestWatcher.FaqDetail',
        functionOnPress: this.handleStaticLinks

      }
    ].filter(term => (term.list && Object.values(term.list).some(text => (!!text))));
    return (
      <ScrollView
        style={styles.container}
        contentContainerStyle={styles.containerContent}
        showsVerticalScrollIndicator={false}
        showsHorizontalScrollIndicator={false}
      >
        <List content={terms} bigSeparation={false}>{}</List>
      </ScrollView>
    );
  }
}

export default FaqList;

{'fraction_non_alphanumeric': 0.132893948472139, 'fraction_numerical': 0.016297183942480527, 'mean_word_length': 2.6847682119205296, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '1540897', 'n_tokens_mistral': 2804, 'n_tokens_neox': 2669, 'n_words': 387}