<commit_before>import styles from './style.css';
import { Link } from 'react-router';
import Story from 'Components/Story';
import { observer } from 'mobx-react';
import Slider from 'Components/Slider';
import { Iteratable } from 'Library/PropTypes';
import React, { Component, PropTypes } from 'react';

export class StorySwiper extends Component {

	/**
	 * Define the prop types of the component.
	 *
	 * @type {Object}
	 */
	static propTypes = {
		stories: Iteratable,
		index: PropTypes.number,
		onChange: PropTypes.func,
		previousLocation: PropTypes.object,
	}

	/**
	 * Render the back button.
	 *
	 * @return {ReactElement|null}
	 */
	renderBackButton() {
		if (!this.props.previousLocation) return null;

		return (
			<Link
				className={styles.backButton}
				to={this.props.previousLocation.pathname}
			>
				<i className="icon-arrow-back"></i>
			</Link>
		);
	}

	/**
	 * Render the component.
	 *
	 * @return {ReactElement}
	 */
	render() {
		const stories = this.props.stories;

		return (
			<div className={styles.wrapper}>
				<Slider
					ref="swiper"
					currentPane={this.props.index}
					onSlideChange={this.props.onChange}
				>
					{stories.map((story, index) =>
						<Story
							story={story}
							key={story.id}
							className={styles.slide}
							nextStory={stories[index + 1]}
							active={this.props.index === index}
						/>
					)}<commit_msg>Add back the back button<commit_after>import styles from './style.css';
import { Link } from 'react-router';
import Story from 'Components/Story';
import { observer } from 'mobx-react';
import Slider from 'Components/Slider';
import { Iteratable } from 'Library/PropTypes';
import React, { Component, PropTypes } from 'react';

export class StorySwiper extends Component {

	/**
	 * Define the prop types of the component.
	 *
	 * @type {Object}
	 */
	static propTypes = {
		stories: Iteratable,
		index: PropTypes.number,
		onChange: PropTypes.func,
		previousLocation: PropTypes.object,
	}

	/**
	 * Render the back button.
	 *
	 * @return {ReactElement|null}
	 */
	renderBackButton() {
		if (!this.props.previousLocation) return null;

		return (
			<Link
				className={styles.backButton}
				to={this.props.previousLocation.pathname}
			>
				<i className="icon-arrow-back"></i>
			</Link>
		);
	}

	/**
	 * Render the component.
	 *
	 * @return {ReactElement}
	 */
	render() {
		const stories = this.props.stories;

		return (
			<div className={styles.wrapper}>
				{this.renderBackButton()}
				<Slider
					ref="swiper"
					currentPane={this.props.index}
					onSlideChange={this.props.onChange}
				>
					{stories.map((story, index) =>
						<Story
							story={story}
							key={story.id}
							className={styles.slide}
							nextStory={stories[index + 1]}
							active={this.props.index === index}
						/>
					)}
{'fraction_non_alphanumeric': 0.14265486725663717, 'fraction_numerical': 0.0007079646017699115, 'mean_word_length': 3.0779220779220777, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '4659899', 'n_tokens_mistral': 1097, 'n_tokens_neox': 886, 'n_words': 201}