Sha256: 2bceb4bfe11c20893366f4ad81f4738875bfa1f1f28e786a5983591798f1da6f

Contents?: true

Size: 1.07 KB

Versions: 9

Compression:

Stored size: 1.07 KB

Contents

// from https://github.com/AdeleD/react-paginate (converted)

import React from 'react';
import PropTypes from 'prop-types';

// eslint-disable-next-line no-unused-vars
class PageView extends React.Component {
  render() {
    const linkClassName = this.props.pageLinkClassName;
    let cssClassName = this.props.pageClassName;

    if (this.props.selected) {
      if (typeof cssClassName !== 'undefined') {
        cssClassName = cssClassName + ' ' + this.props.activeClassName;
      } else {
        cssClassName = this.props.activeClassName;
      }
    }

    /* eslint-disable jsx-a11y/anchor-is-valid */
    return (
      <li className={cssClassName}>
        <a onClick={this.props.onClick} className={linkClassName}>
          {this.props.page}
        </a>
      </li>
    );
    /* eslint-enable jsx-a11y/anchor-is-valid */
  }
}

PageView.propTypes = {
  pageLinkClassName: PropTypes.string,
  pageClassName: PropTypes.string,
  selected: PropTypes.bool,
  activeClassName: PropTypes.string,
  onClick: PropTypes.func.isRequired,
  page: PropTypes.number,
};

export default PageView;

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lcms-engine-0.5.5 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.5.4 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.5.3 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.5.2 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.5.1 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.5.0 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.4.2 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.4.1 app/javascript/components/paginate/PageView.jsx
lcms-engine-0.4.0 app/javascript/components/paginate/PageView.jsx