<commit_before>import React, {Component} from 'react';
import {
    Text,
    View,
    TouchableOpacity,
    Picker,
    Platform,
    Switch,
    StyleSheet,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome'

import {
    EMPTY_METRIC,
    AVG_VELOCITY_METRIC,
    RPE_METRIC,
    DURATION_METRIC,
    ROM_METRIC,
    PKH_METRIC,
    PKV_METRIC,
} from 'app/constants/CollapsedMetricTypes';
import { SETTINGS_PANEL_STYLES } from 'app/appearance/styles/GlobalStyles';
import * as DateUtils from 'app/utility/transforms/DateUtils';
import SettingsEditMetricsScreen from './metric/SettingsEditMetricsScreen';
import SettingsEditQuantifiersScreen from './quantifier/SettingsEditQuantifiersScreen';
import * as CollapsedMetricsUtility from 'app/utility/transforms/CollapsedMetrics';
import * as Device from 'app/utility/Device';

class SettingsMetricsPanel extends Component {

    // ACTIONS

    _tapCurrentMetric(row) {
        this.props.tapMetric(row)
    }

    _tapCurrentQuantifier(row) {
        this.props.tapQuantifier(row)
    }

    // RENDER

    _renderMetric(row, metric) {
        return (
            <TouchableOpacity
                style={[SETTINGS_PANEL_STYLES.blueButton, {width: 90, height: 30, marginLeft: 10, marginBottom: 10}]}
                onPress={() => this._tapCurrentMetric(row)}>
                <Text style={SETTINGS_PANEL_STYLES.buttonText}>
                    {CollapsedMetricsUtility.metricAbbreviation(metric)}
                </Text>
                <Icon name="caret-down" size={10} color='white' style={{right: 10, position:'absolute'}} />
            </TouchableOpacity>
        );
    }

    _renderQuantifier(row, quantifier) {
        return (
            <TouchableOpacity
                style={[SETTINGS_PANEL_STYLES.blueButton, {width: 130, height: 30, marginLeft: 10, marginBottom: 10}]}
                onPress={() => this._tapCurrentQuantifier(row)}>
                <Text style={SETTINGS_PANEL_STYLES.buttonText}>
                    {CollapsedMetricsUtility.quantifierString(quantifier)}
                </Text>
                <Icon name="caret-down" size={10} color='white' style={{right: 10, position:'absolute'}} />
            </TouchableOpacity>
        );
    }

    _renderRow(row, quantifier, metric) {
        if (row === 1) {
            if (metric !== 'RPE') {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.bigMetricBackground}>
                            <Text style={styles.bigMetricNumber}>{row}</Text>
                        </View>
                        {this._renderQuantifier(row, quantifier)}
                        {this._renderMetric(row, metric)}
                    </View>            
                );
            } else {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.bigMetricBackground}>
                            <Text style={styles.bigMetricNumber}>{row}</Text>
                        </View>
                        {this._renderMetric(row, metric)}
                    </View>            
                );     
            }
        } else {
            if (metric === 'RPE') {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.numberBackground}><commit_msg>fixed arrow in ios too close to text<commit_after>import React, {Component} from 'react';
import {
    Text,
    View,
    TouchableOpacity,
    Picker,
    Platform,
    Switch,
    StyleSheet,
} from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome'

import {
    EMPTY_METRIC,
    AVG_VELOCITY_METRIC,
    RPE_METRIC,
    DURATION_METRIC,
    ROM_METRIC,
    PKH_METRIC,
    PKV_METRIC,
} from 'app/constants/CollapsedMetricTypes';
import { SETTINGS_PANEL_STYLES } from 'app/appearance/styles/GlobalStyles';
import * as DateUtils from 'app/utility/transforms/DateUtils';
import SettingsEditMetricsScreen from './metric/SettingsEditMetricsScreen';
import SettingsEditQuantifiersScreen from './quantifier/SettingsEditQuantifiersScreen';
import * as CollapsedMetricsUtility from 'app/utility/transforms/CollapsedMetrics';
import * as Device from 'app/utility/Device';

class SettingsMetricsPanel extends Component {

    // ACTIONS

    _tapCurrentMetric(row) {
        this.props.tapMetric(row)
    }

    _tapCurrentQuantifier(row) {
        this.props.tapQuantifier(row)
    }

    // RENDER

    _renderMetric(row, metric) {
        return (
            <TouchableOpacity
                style={[SETTINGS_PANEL_STYLES.blueButton, {width: 90, height: 30, marginLeft: 10, marginBottom: 10}]}
                onPress={() => this._tapCurrentMetric(row)}>
                <Text style={SETTINGS_PANEL_STYLES.buttonText}>
                    {CollapsedMetricsUtility.metricAbbreviation(metric)}
                </Text>
                <Icon name="caret-down" size={10} color='white' style={{right: 5, position:'absolute'}} />
            </TouchableOpacity>
        );
    }

    _renderQuantifier(row, quantifier) {
        return (
            <TouchableOpacity
                style={[SETTINGS_PANEL_STYLES.blueButton, {width: 130, height: 30, marginLeft: 10, marginBottom: 10}]}
                onPress={() => this._tapCurrentQuantifier(row)}>
                <Text style={SETTINGS_PANEL_STYLES.buttonText}>
                    {CollapsedMetricsUtility.quantifierString(quantifier)}
                </Text>
                <Icon name="caret-down" size={10} color='white' style={{right: 5, position:'absolute'}} />
            </TouchableOpacity>
        );
    }

    _renderRow(row, quantifier, metric) {
        if (row === 1) {
            if (metric !== 'RPE') {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.bigMetricBackground}>
                            <Text style={styles.bigMetricNumber}>{row}</Text>
                        </View>
                        {this._renderQuantifier(row, quantifier)}
                        {this._renderMetric(row, metric)}
                    </View>            
                );
            } else {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.bigMetricBackground}>
                            <Text style={styles.bigMetricNumber}>{row}</Text>
                        </View>
                        {this._renderMetric(row, metric)}
                    </View>            
                );     
            }
        } else {
            if (metric === 'RPE') {
                return (
                    <View style={{flexDirection: 'row'}}>
                        <View style={styles.numberBackground}>
{'fraction_non_alphanumeric': 0.11465153499199768, 'fraction_numerical': 0.007274843590862797, 'mean_word_length': 1.8594009983361064, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 55, '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': '5931582', 'n_tokens_mistral': 1997, 'n_tokens_neox': 1886, 'n_words': 338}