<commit_before>/* global Turbolinks */

import React, { Component } from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import { orangeA700 } from 'material-ui/styles/colors';
import NoContent from './no_content.es6';

const muiTheme = getMuiTheme({
  palette: {
    primary1Color: orangeA700,
    accent1Color: orangeA700,
  },
});

const Pagination = (props) => (
  <MuiThemeProvider muiTheme={muiTheme}>
    <div className="container">
      <div className="pagination">
        {props.queryObject.page >= 2 ?
          <RaisedButton
            label="Previous"
            className="link previous"
            style={{ boxShadow: 'none', borderRadius: '0', background: 'transparent' }}
            onClick={props.loadPrevious}
          />
          : <NoContent />
        }
        {props.pageInfo != null &&
          props.pageInfo.hasNextPage  ?
          <RaisedButton
            label="Next"
            className="link next"
            style={{ boxShadow: 'none', borderRadius: '0', background: 'transparent' }}
            onClick={props.loadNext}
          />
          : <NoContent />
        }
      </div>
    </div>
  </MuiThemeProvider>
);

Pagination.propTypes = {
  links: React.PropTypes.array,
};

export default Pagination;<commit_msg>Render nothing if not paginating<commit_after>/* global Turbolinks */

import React, { Component } from 'react';
import RaisedButton from 'material-ui/RaisedButton';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import { orangeA700 } from 'material-ui/styles/colors';
import NoContent from './no_content.es6';

const muiTheme = getMuiTheme({
  palette: {
    primary1Color: orangeA700,
    accent1Color: orangeA700,
  },
});

const Pagination = (props) => (
  <MuiThemeProvider muiTheme={muiTheme}>
    <div className="container">
      <div className="pagination">
        {props.queryObject.page >= 2 ?
          <RaisedButton
            label="Previous"
            className="link previous"
            style={{ boxShadow: 'none', borderRadius: '0', background: 'transparent' }}
            onClick={props.loadPrevious}
          />
          : ''
        }
        {props.pageInfo != null &&
          props.pageInfo.hasNextPage  ?
          <RaisedButton
            label="Next"
            className="link next"
            style={{ boxShadow: 'none', borderRadius: '0', background: 'transparent' }}
            onClick={props.loadNext}
          />
          : ''
        }
      </div>
    </div>
  </MuiThemeProvider>
);

Pagination.propTypes = {
  links: React.PropTypes.array,
};

export default Pagination;
{'fraction_non_alphanumeric': 0.12976827094474153, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 2.592829705505762, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '4621827', 'n_tokens_mistral': 838, 'n_tokens_neox': 824, 'n_words': 171}