Sha256: 402abead715126253429c53a39e253fa8d0075059b9119b0e5515c11b0ea0d83

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 KB

Contents

import React, { Component } from "react";
import PropTypes from "prop-types";

const propTypes = {
  dark:PropTypes.bool,
  borderless:PropTypes.bool,
  size:PropTypes.oneOf(["", "large"]),
  ordered:PropTypes.bool,
  layout: PropTypes.oneOf(["", "left", "right"]),
  xpadding:PropTypes.bool,
  children: PropTypes.oneOfType([
      PropTypes.arrayOf(PropTypes.node),
      PropTypes.node
  ])
};

const defaultProps = {
  dark:false,
  borderless:false,
  size:"",
  ordered:false,
  layout:"",
  xpadding:false
};

class List extends Component {
  render() {
    const {
      dark,
      borderless,
      size,
      ordered,
      layout,
      xpadding,
      children
    } = this.props;
    const dark_class = dark === true ? "_dark" : ""
    const borderless_class = borderless === true ? "list_borderless" : ""
    const size_class = "_" + size
    const ordered_class = ordered === true ? "_ordered" : ""
    const layout_class = "_"+ layout
    const xpadding_class = xpadding === true ? "_xpadding" : ""
    return (
      <div className={`pb_list${dark_class}${borderless_class}${size_class}${ordered_class}${layout_class}${xpadding_class}`}>
        <ul>
          {children}
        </ul>
      </div>
    );
  }
}

List.propTypes = propTypes;
List.defaultProps = defaultProps;

export default List;

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
playbook_ui-3.1.0 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-3.0.1 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-3.0.0 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.9 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.8 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.7 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.6 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.5 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.4 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.3 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.2 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.1 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.9.0 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.9 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.8 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.7 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.6 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.5 app/pb_kits/playbook/pb_list/_list.jsx
playbook_ui-2.8.4 app/pb_kits/playbook/pb_list/_list.jsx