<commit_before>import React from "react-native";
import AppbarTouchable from "../components/appbar-touchable";
import AppbarIcon from "../components/appbar-icon";
import routes from "./routes";

const {
	StyleSheet,
	Text
} = React;

const styles = StyleSheet.create({
	title: {
		color: "#fff",
		fontWeight: "bold",
		fontSize: 18,
		marginVertical: 14,
		marginRight: 64,
		paddingHorizontal: 4
	}
});

const NavigationBarRouteMapper = {
	LeftButton(route, navigator) {
		const goBack = () => {
			if (navigator.getCurrentRoutes().length > 1) {
				navigator.pop();
			} else {
				navigator.replace(routes.home());
			}
		};

		if (route.leftComponent) {
			return <route.leftComponent {...route.passProps} navigator={navigator} />;
		}

		if (route.index !== 0) {
			return (
				<AppbarTouchable onPress={goBack}>
					<AppbarIcon name="arrow-back" />
				</AppbarTouchable>
			);
		}
	},

	RightButton(route, navigator) {
		if (route.rightComponent) {
			return <route.rightComponent {...route.passProps} navigator={navigator} />;
		}

		return null;
	},

	Title(route, navigator) {
		if (route.titleComponent) {
			return <route.titleComponent {...route.passProps} navigator={navigator} />;
		}

		return (
			<Text style={styles.title} numberOfLines={1}><commit_msg>Put a phantom view on the right to prevent unwanted taps<commit_after>import React from "react-native";
import AppbarTouchable from "../components/appbar-touchable";
import AppbarIcon from "../components/appbar-icon";
import routes from "./routes";

const {
	StyleSheet,
	View,
	Text
} = React;

const styles = StyleSheet.create({
	title: {
		color: "#fff",
		fontWeight: "bold",
		fontSize: 18,
		marginVertical: 14,
		marginRight: 64,
		paddingHorizontal: 4
	},

	phantom: {
		height: 56,
		width: 56
	}
});

const NavigationBarRouteMapper = {
	LeftButton(route, navigator) {
		const goBack = () => {
			if (navigator.getCurrentRoutes().length > 1) {
				navigator.pop();
			} else {
				navigator.replace(routes.home());
			}
		};

		if (route.leftComponent) {
			return <route.leftComponent {...route.passProps} navigator={navigator} />;
		}

		if (route.index !== 0) {
			return (
				<AppbarTouchable onPress={goBack}>
					<AppbarIcon name="arrow-back" />
				</AppbarTouchable>
			);
		}
	},

	RightButton(route, navigator) {
		if (route.rightComponent) {
			return <route.rightComponent {...route.passProps} navigator={navigator} />;
		}

		return <View style={styles.phantom} />;
	},

	Title(route, navigator) {
		if (route.titleComponent) {
			return <route.titleComponent {...route.passProps} navigator={navigator} />;
		}

		return (
			<Text style={styles.title} numberOfLines={1}>
{'fraction_non_alphanumeric': 0.15617977528089888, 'fraction_numerical': 0.008988764044943821, 'mean_word_length': 3.661431064572426, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 22, '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': '516658', 'n_tokens_mistral': 1033, 'n_tokens_neox': 889, 'n_words': 186}