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

import { RawLabel, Touchable } from '../common';
import Emoji from '../emoji/Emoji';

const styles = StyleSheet.create({
  emojiRow: {
    flexDirection: 'row',
    padding: 8,
    alignItems: 'center',
  },
  text: {
    paddingLeft: 6,
  },
});

type Props = {
  name: string,
  onPress: () => void,
};

export default class EmojiRow extends PureComponent<Props> {
  props: Props;

  render() {
    const { name, onPress } = this.props;

    // TODO: this only handles Unicode emoji (shipped with the app),
    // not realm emoji or Zulip extra emoji.  See our issue #2846.
    return (
      <Touchable onPress={onPress}>
        <View style={styles.emojiRow}>
          <Emoji name={name} size={20} />
          <RawLabel style={styles.text} text={name} />
        </View>
      </Touchable>
    );<commit_msg>emojiRow: Create `handlePress` function to to call onPress with param.<commit_after>/* @flow */
import React, { PureComponent } from 'react';
import { StyleSheet, View } from 'react-native';

import { RawLabel, Touchable } from '../common';
import Emoji from '../emoji/Emoji';

const styles = StyleSheet.create({
  emojiRow: {
    flexDirection: 'row',
    padding: 8,
    alignItems: 'center',
  },
  text: {
    paddingLeft: 6,
  },
});

type Props = {
  name: string,
  onPress: (name: string) => void,
};

export default class EmojiRow extends PureComponent<Props> {
  props: Props;

  handlePress = () => {
    const { name, onPress } = this.props;
    onPress(name);
  };

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

    // TODO: this only handles Unicode emoji (shipped with the app),
    // not realm emoji or Zulip extra emoji.  See our issue #2846.
    return (
      <Touchable onPress={this.handlePress}>
        <View style={styles.emojiRow}>
          <Emoji name={name} size={20} />
          <RawLabel style={styles.text} text={name} />
        </View>
      </Touchable>
    );
{'fraction_non_alphanumeric': 0.14847590953785644, 'fraction_numerical': 0.007866273352999017, 'mean_word_length': 2.825187969924812, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 20, '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': '5862226', 'n_tokens_mistral': 673, 'n_tokens_neox': 665, 'n_words': 190}