index.js 670 Bytes
Newer Older
FE committed
1 2 3 4 5 6
import React, { Component } from 'react';
import classnames from 'classnames';
import './index.scss';

class ListHeader extends Component {
  render() {
zhanghaozhe committed
7
    const { text, size, styles, id } = this.props;
FE committed
8 9
    const cls = size? `list-header--${size}` : '';
    return (
zhanghaozhe committed
10
      <div id={id} className={classnames("list-header", cls)} style={styles}>
FE committed
11 12 13 14 15 16 17 18 19 20 21 22
        <i className="list-header__decorate" data-position="left"></i>
        {
          text
          ? <h2 className="list-header__content">{text}</h2>
          : this.props.children
        }
        <i className="list-header__decorate" data-position="right"></i>
      </div>
    )
  }
}

zhanghaozhe committed
23
export default ListHeader;