<commit_before>import React, { PropTypes } from 'react';
import { Text, View, Image, StyleSheet } from 'react-native';
import moment from 'moment/min/moment-with-locales';
import { Answers } from 'react-native-fabric';

import DigiTouchable from '../../common/DigiTouchable';

import Event from '../event/Event';

moment.locale('fr');

const selectEvent = (navigator, event) => {
  Answers.logContentView(
    `${event.Event.name}`,
    'event',
    `events/${event.Event.id}`
  );
  navigator.push({
    component: Event,
    passProps: {
      event: event,
    },
  });
}

export default function EventsRow({ navigator, event }) {
  const time = moment(event.Event.start_at).format('HH:mm');
  const place = event.Venue.name;
  const timeAndPlace = time === '00:00' ? place : time + ' @ ' + place;
  return (
    <DigiTouchable onPress={() => selectEvent(navigator, event)}>
      <View style={styles.container}>
        <View style={styles.avatarContainer}>
          {
            event.Organization[0] && event.Organization[0].avatar ? (
              <Image
                style={styles.avatar}
                source={{uri: event.Organization[0].avatar}}
              />
            ) : null
          }
        </View>
        <View style={styles.textContainer}>
          <Text style={styles.title}>
            {event.Event.name}
          </Text>
          <Text style={styles.date}>
            {timeAndPlace}
          </Text>
        </View>
      </View>
    </DigiTouchable>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'row',<commit_msg>truncate events title to 1 line<commit_after>import React, { PropTypes } from 'react';
import { Text, View, Image, StyleSheet } from 'react-native';
import moment from 'moment/min/moment-with-locales';
import { Answers } from 'react-native-fabric';

import DigiTouchable from '../../common/DigiTouchable';

import Event from '../event/Event';

moment.locale('fr');

const selectEvent = (navigator, event) => {
  Answers.logContentView(
    `${event.Event.name}`,
    'event',
    `events/${event.Event.id}`
  );
  navigator.push({
    component: Event,
    passProps: {
      event: event,
    },
  });
}

export default function EventsRow({ navigator, event }) {
  const time = moment(event.Event.start_at).format('HH:mm');
  const place = event.Venue.name;
  const timeAndPlace = time === '00:00' ? place : time + ' @ ' + place;
  return (
    <DigiTouchable onPress={() => selectEvent(navigator, event)}>
      <View style={styles.container}>
        <View style={styles.avatarContainer}>
          {
            event.Organization[0] && event.Organization[0].avatar ? (
              <Image
                style={styles.avatar}
                source={{uri: event.Organization[0].avatar}}
              />
            ) : null
          }
        </View>
        <View style={styles.textContainer}>
          <Text style={styles.title} numberOfLines={1}>
            {event.Event.name}
          </Text>
          <Text style={styles.date}>
            {timeAndPlace}
          </Text>
        </View>
      </View>
    </DigiTouchable>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection: 'row',
{'fraction_non_alphanumeric': 0.1558641975308642, 'fraction_numerical': 0.005555555555555556, 'mean_word_length': 2.3795620437956204, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 33, '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': '5082903', 'n_tokens_mistral': 993, 'n_tokens_neox': 988, 'n_words': 205}