Sha256: 3980a49a2dd87348fec5d27176cdc7ce82b4d8235c08073a618213686b4afa8c

Contents?: true

Size: 1.15 KB

Versions: 15

Compression:

Stored size: 1.15 KB

Contents

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

const propTypes = {
  children: PropTypes.oneOfType([
      PropTypes.arrayOf(PropTypes.node),
      PropTypes.node
  ]),
  className: PropTypes.string,
  container: PropTypes.bool,
  dark: PropTypes.bool,
  disable_hover: PropTypes.bool,
  single_line: PropTypes.bool,
  size: PropTypes.oneOf(["sm", "md", "lg"])
};

const defaultProps = {
  container: false,
  dark: false,
  disable_hover: false,
  single_line: false,
  size: "sm"
};

class Table extends React.Component {
  render() {
    const {
      children,
      className,
      container,
      dark,
      disable_hover,
      single_line,
      size
    } = this.props;

    const css = classnames([
      `table-${size}`,
      container ? `table-card` : null,
      dark ? `table-dark` : null,
      single_line ? `single-line` : null,
      disable_hover ? `no-hover` : null,
      className,
    ])

    return (
      <div>
        <table className={css}>
          {children}
        </table>
      </div>
    )
  }
}

Table.propTypes = propTypes;
Table.defaultProps = defaultProps;

export default Table;

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
playbook_ui-2.9.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.9.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.9 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.8 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.7 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.6 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.5 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.4 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.3 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.8.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.7.2 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.7.1 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.7.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.6.0 app/pb_kits/playbook/pb_table/_table.jsx
playbook_ui-2.5.0 app/pb_kits/playbook/pb_table/_table.jsx