<commit_before>/* @flow */

import React, { PropTypes, Component } from 'react';
import ReactNative from 'react-native';
import shallowEqual from 'shallowequal';
import Card from './Card';
import CardTitle from './CardTitle';
import DiscussionSummary from './DiscussionSummary';
import CardAuthor from './CardAuthor';

const {
	StyleSheet
} = ReactNative;

const styles = StyleSheet.create({
	details: {
		paddingVertical: 12,
		marginVertical: 0
	},

	title: {
		marginBottom: 8,
		marginHorizontal: 16
	},

	author: {
		marginTop: 8,
		marginHorizontal: 16
	}
});

type Props = {
	thread: {
		name: string;
		body: string;
		creator: string;
	}
}

export default class DiscussionDetailsCard extends Component<void, Props, void> {
	static propTypes = {
		thread: PropTypes.shape({
			name: PropTypes.string.isRequired,
			body: PropTypes.string.isRequired,
			creator: PropTypes.string.isRequired
		})
	};

	shouldComponentUpdate(nextProps: Props): boolean {
		return !shallowEqual(this.props, nextProps);
	}

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

		return (
			<Card style={styles.details}>
				<CardTitle style={styles.title}>{thread.name}</CardTitle>
				<DiscussionSummary text={thread.body} />
				<CardAuthor nick={thread.creator} style={styles.author} />
			</Card>
		);
	}<commit_msg>Show meta in discussion details<commit_after>/* @flow */

import React, { PropTypes, Component } from 'react';
import ReactNative from 'react-native';
import shallowEqual from 'shallowequal';
import Card from './Card';
import CardTitle from './CardTitle';
import DiscussionSummary from './DiscussionSummary';
import CardAuthor from './CardAuthor';

const {
	StyleSheet
} = ReactNative;

const styles = StyleSheet.create({
	details: {
		paddingVertical: 12,
		marginVertical: 0
	},

	title: {
		marginBottom: 8,
		marginHorizontal: 16
	},

	author: {
		marginTop: 8,
		marginHorizontal: 16
	}
});

type Props = {
	thread: {
		name: string;
		body: string;
		creator: string;
		meta?: Object;
	}
}

export default class DiscussionDetailsCard extends Component<void, Props, void> {
	static propTypes = {
		thread: PropTypes.shape({
			name: PropTypes.string.isRequired,
			body: PropTypes.string.isRequired,
			meta: PropTypes.string.isRequired,
			creator: PropTypes.string.isRequired
		})
	};

	shouldComponentUpdate(nextProps: Props): boolean {
		return !shallowEqual(this.props, nextProps);
	}

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

		return (
			<Card style={styles.details}>
				<CardTitle style={styles.title}>{thread.name}</CardTitle>
				<DiscussionSummary text={thread.body} meta={thread.meta} />
				<CardAuthor nick={thread.creator} style={styles.author} />
			</Card>
		);
	}
{'fraction_non_alphanumeric': 0.13325909428359317, 'fraction_numerical': 0.0066815144766146995, 'mean_word_length': 4.243190661478599, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2395521', 'n_tokens_mistral': 937, 'n_tokens_neox': 839, 'n_words': 211}